Browse Source

省份统计开发

anderx 5 years ago
parent
commit
139f7b06e7

+ 2 - 6
GeneratorConfig.xml

@@ -11,19 +11,15 @@
         <!-- beginningDelimiter和endingDelimiter:指明数据库的用于标记数据库对象名的符号,比如ORACLE就是双引号,MYSQL默认是`反引号; -->
         <property name="beginningDelimiter" value="`"/>
         <property name="endingDelimiter" value="`"/>
-        
         <!-- 格式化XML代码 -->
         <property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter"/>
         <plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
         <plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
-
         <!-- 注释 -->
         <commentGenerator>
-            <property name="suppressAllComments" value="true"/><!-- 是否取消注释 -->
+            <property name="suppressAllComments" value="false"/><!-- 是否取消注释 -->
             <property name="suppressDate" value="false"/> <!-- 是否生成注释代时间戳-->
         </commentGenerator>
-        
-        
      <jdbcConnection connectionURL="jdbc:mysql://localhost:3306/aft?serverTimezone=UTC"  
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="root" >
     	 <!-- 防止生成其它库的表 -->
@@ -47,7 +43,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="task_progress"   enableCountByExample="false"
+    <table schema="aft" tableName="t_task_mid"   enableCountByExample="false"
                enableUpdateByExample="false"
                enableDeleteByExample="false"
                enableSelectByExample="false"

+ 17 - 88
src/main/java/com/goafanti/common/dao/TTaskMidMapper.java

@@ -1,100 +1,23 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.TTaskMid;
-import com.goafanti.common.model.TTaskMidExample;
 
 import java.math.BigDecimal;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface TTaskMidMapper {
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    long countByExample(TTaskMidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int deleteByExample(TTaskMidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int deleteByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int insert(TTaskMid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int insertSelective(TTaskMid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    List<TTaskMid> selectByExample(TTaskMidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    TTaskMid selectByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int updateByExampleSelective(@Param("record") TTaskMid record, @Param("example") TTaskMidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int updateByExample(@Param("record") TTaskMid record, @Param("example") TTaskMidExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int updateByPrimaryKeySelective(TTaskMid record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table t_task_mid
-     *
-     * @mbg.generated Thu Jun 18 15:57:30 CST 2020
-     */
-    int updateByPrimaryKey(TTaskMid record);
+	int deleteByPrimaryKey(Integer id);
+
+	int insert(TTaskMid record);
+
+	int insertSelective(TTaskMid record);
+
+	TTaskMid selectByPrimaryKey(Integer id);
+
+	int updateByPrimaryKeySelective(TTaskMid record);
+
+	int updateByPrimaryKey(TTaskMid record);
 
 	int updateCostAmount(@Param("tid")Integer tid, @Param("costAmount")BigDecimal costAmount);
 
@@ -105,4 +28,10 @@ public interface TTaskMidMapper {
 	List<TTaskMid> selectListByTid(Integer tid);
 
 	void updateByTid(TTaskMid tm);
+
+	void addValue(Integer xzs, Integer bhs);
+
+	void updateCountBytid(Integer taskId);
+	
+
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/TaskProgressMapper.java

@@ -8,6 +8,9 @@ import java.util.List;
 
 public interface TaskProgressMapper {
 
+
+
+
 	int deleteByPrimaryKey(Integer id);
 
 	int insert(TaskProgress record);

+ 36 - 15
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1573,7 +1573,7 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
   	</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,a.set_up_amount as setUpAmount,
 	g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent, a.arrival_money as arrivalMoney,
@@ -1583,10 +1583,12 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
 	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.legal_person as legalPerson,
 	e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,
-	a.cost_reduction costReduction,  a.official_cost officialCost
+	a.cost_reduction costReduction,  a.official_cost officialCost,a.set_up_status setUpStatus ,date_format(a.set_up_time,'%Y-%m-%d') setUpTime ,a.high_tech_status highTechStatus ,
+	a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,
+	ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price  commodityPrice,a.commodity_quantity commodityQuantity
 	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 department h on e.order_dep=h.id left join user f on e.buyer_id=f.id LEFT JOIN t_task_mid ttm ON a.id=ttm.tid 
     left join admin g on e.salesman_id=g.id
     where a.id= #{id,jdbcType=VARCHAR}
   </select>
@@ -1824,23 +1826,31 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
   <select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
 	select  date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province  ,c.name depName,e.salesman_name salesmanName,
 	b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
-	a.status projectStatus , a.commodity_price commodityPrice ,a.special_comment,
+	a.status projectStatus,a.id,
 	<if test="status==1">
 	a.set_up_status setUpStatus ,a.set_up_time setUpTime ,a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile , b.legal_person_tel legalPersonTel ,
-	a.certificate_number certificateNumber,a.declaration_batch declarationBatch
+	a.certificate_number certificateNumber,a.declaration_batch declarationBatch,
 	</if>
 	<if test="status==2">
-	a.licence_time licenceTime
+	a.licence_time licenceTime,
 	</if>
 	<if test="status==3">
 	a.commodity_quantity commodityQuantity ,ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial,
-	a.accept_time	acceptTime ,a.licence_time licenceTime,a.certificate_number certificateNumber,ttm.cost_amount costAmount ,
-	(a.commodity_price-ttm.cost_amount)profit
+	tp.licence_time  licenceTime,
+	a.certificate_number certificateNumber,ttm.cost_amount costAmount ,
+	(a.commodity_price-ttm.cost_amount)profit,
 	</if>
-	ttm.reject_count	rejectCount ,ttm.patent_number patentNumber ,
-	ttm.patent_name patentName,
-	a.high_tech_status highTechStatus
-	from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id 
+	<if test="status==4">
+	a.commodity_quantity commodityQuantity ,ttm.certificates_count certificatesCount,a.high_tech_status highTechStatus,
+	tp.patent_name patentName ,tp.patent_no patentNo ,tp.accept_time acceptTime ,tp.licence_time licenceTime ,tp.authorize_time  authorizeTime,
+	ttm.reject_count	rejectCount ,ttm.cost_amount costAmount ,(a.commodity_price-ttm.cost_amount)profit,
+	</if>
+	
+	 a.commodity_price commodityPrice ,a.special_comment specialComment
+	from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
+	<if test="status==3 or status==4">
+	left join task_progress tp  on a.id=tp.task_id 
+	</if> 
 	left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id 
 	left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
 	where a.split_status in (0,2) and a.task_status in (1,2,3)
@@ -1884,9 +1894,9 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
   
   <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
  	select  count(*)
-	from t_order_task a left join t_order_new b on a.order_no =b.order_no  left join department c on b.order_dep =c.id  left join district_glossory d on c.id=d.id 
+	from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
 	left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id 
-	 left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
+	left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
 	where a.split_status in (0,2) and a.task_status in (1,2,3)
   <if test="startDate != null and endDate != null">
   	and a.task_distribution_time between #{startDate} and #{endDate}
@@ -1924,13 +1934,20 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
    <select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
 	select dg.name provinceName,de.name thchDepName ,bc.cname projectStatus,
 	<if test="status==1">
-	x.kcs ,x.pds ,x.wcs,x.lxs,x.ccs,x.wtg,
+	ifnull(x.kcs,0) stockCount, ifnull(x.pds,0) distributeCount,ifnull(x.wcs,0) completeCount,
+	ifnull(x.lxs,0) setUpCount,ifnull(x.ccs,0) spotCheckCount,ifnull(x.wtg,0) failedCount,
+	</if>
+	<if test="status==2">
+	x.sls acceptCount,x.wjs completeCount,x.sqs authorizeCount,x.bhs rejectCount,
 	</if>
 	x.amountCount,x.costAmount,x.profit
 	from (select dep.province, ad.department_id,bp.cid ,
 	<if test="status==1">
 	sum(kcs.cq) kcs,sum(pds.cq)pds,sum(wcs.cq)wcs, sum(lxs.cq)lxs,sum(ccs.cq)ccs,sum(pds.cq)wtg,
 	</if>
+	<if test="status==2">
+	sum(tj.sls) sls,sum(tj.wjs)wjs,sum(tj.sqs)sqs, sum(tj.bhs)bhs,
+	</if>
 	sum(a.commodity_price)amountCount,sum(ttm.cost_amount)costAmount, (sum(a.commodity_price)-sum(ttm.cost_amount))profit
 	from t_order_task a left join t_order_new b on a.order_no =b.order_no left join t_task_mid ttm on a.id=ttm.tid 
 	left join department dep on b.order_dep =dep.id  left join admin ad on a.task_receiver =ad.id
@@ -1943,6 +1960,10 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
 	left join (select id,commodity_quantity cq from t_order_task where spot_check_status in (1,2))ccs on a.id=ccs.id
 	left join (select id,commodity_quantity cq from t_order_task where spot_check_status =1)wtg on a.id=wtg.id
 	</if>
+	<if test="status==2">
+	left join (select tid ,accept_count sls,end_count wjs,authorize_count sqs,reject_count bhs from t_task_mid 
+	where certificates_count &gt; 0)tj on a.id=tj.tid
+	</if>
 	where  b.order_dep is not null and a.split_status in(0,2) and a.task_status in (1,2,3)
 	<if test="startDate != null and endDate != null">
   	and a.task_distribution_time between #{startDate} and #{endDate}

+ 24 - 197
src/main/java/com/goafanti/common/mapper/TTaskMidMapper.xml

@@ -2,160 +2,35 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.TTaskMidMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.TTaskMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="tid" jdbcType="INTEGER" property="tid" />
     <result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
     <result column="party_amount" jdbcType="DECIMAL" property="partyAmount" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="certificates_count" jdbcType="INTEGER" property="certificatesCount" />
   </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 Thu Jun 18 15:57:30 CST 2020.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    id, tid, cost_amount, party_amount, create_time
+    id, tid, cost_amount, party_amount, create_time, certificates_count
   </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.TTaskMidExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from t_task_mid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     select 
     <include refid="Base_Column_List" />
     from t_task_mid
     where id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     delete from t_task_mid
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TTaskMidExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    delete from t_task_mid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.TTaskMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     insert into t_task_mid (id, tid, cost_amount, 
-      party_amount, create_time)
+      party_amount, create_time, certificates_count
+      )
     values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL}, 
-      #{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP})
+      #{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TTaskMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     insert into t_task_mid
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -173,6 +48,9 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="certificatesCount != null">
+        certificates_count,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -190,69 +68,12 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="certificatesCount != null">
+        #{certificatesCount,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.TTaskMidExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    select count(*) from t_task_mid
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    update t_task_mid
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.tid != null">
-        tid = #{record.tid,jdbcType=INTEGER},
-      </if>
-      <if test="record.costAmount != null">
-        cost_amount = #{record.costAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="record.partyAmount != null">
-        party_amount = #{record.partyAmount,jdbcType=DECIMAL},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
-    update t_task_mid
-    set id = #{record.id,jdbcType=INTEGER},
-      tid = #{record.tid,jdbcType=INTEGER},
-      cost_amount = #{record.costAmount,jdbcType=DECIMAL},
-      party_amount = #{record.partyAmount,jdbcType=DECIMAL},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TTaskMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     update t_task_mid
     <set>
       <if test="tid != null">
@@ -267,20 +88,19 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="certificatesCount != null">
+        certificates_count = #{certificatesCount,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TTaskMid">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jun 18 15:57:30 CST 2020.
-    -->
     update t_task_mid
     set tid = #{tid,jdbcType=INTEGER},
       cost_amount = #{costAmount,jdbcType=DECIMAL},
       party_amount = #{partyAmount,jdbcType=DECIMAL},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      certificates_count = #{certificatesCount,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
  
@@ -327,4 +147,11 @@
     </set>
     where tid = #{tid,jdbcType=INTEGER}
   </update>
+  
+  <update id="updateCountBytid">
+  	    update t_task_mid a,(select task_id tid,ifnull(count(licence_time),0)lic ,ifnull(count(accept_time),0)acc,ifnull(count(authorize_time),0)auc,
+    count(if(status=1,1,0))tgc,count(if(status ,2,0))bhc from task_progress where task_id= #{tid} GROUP by task_id )b
+    set a.accept_count =b.acc,a.authorize_count =b.auc,a.certificates_count =b.lic,a.end_count =b.tgc,a.reject_count =b.bhc
+    where a.tid =b.tid
+  </update>
 </mapper>

+ 6 - 4
src/main/java/com/goafanti/common/mapper/TaskProgressMapper.xml

@@ -152,10 +152,12 @@
   </update>
   <select id="selectTaskProgress" resultType="com.goafanti.order.bo.TaskProgressBo">
       select a.id,a.task_id as taskId,a.already_number as alreadyNumber,date_format(a.licence_time,'%Y-%m-%d')as licenceTimes,
-date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTimes ,b.commodity_quantity as ingCount
-from task_progress a left join t_order_task b on a.task_id=b.id
-where a.task_id=  #{id,jdbcType=INTEGER}
-order by a.create_time
+		date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTimes ,b.commodity_quantity as ingCount,
+		date_format(a.accept_time,'%Y-%m-%d')as acceptTimeS, date_format(a.authorize_time,'%Y-%m-%d')as authorizeTimes ,
+		a.patent_name patentName,a.patent_no patentNo,a.status ,a.`type` 
+		from task_progress a left join t_order_task b on a.task_id=b.id
+		where a.task_id =  #{id,jdbcType=INTEGER}
+		order by a.create_time
   </select>
   <select id="AlreadyNuberCount" resultType="java.lang.Integer">
   	select ifnull(sum(already_number),0) from task_progress

+ 28 - 29
src/main/java/com/goafanti/common/model/TTaskMid.java

@@ -2,90 +2,69 @@ package com.goafanti.common.model;
 
 import java.math.BigDecimal;
 import java.util.Date;
-import javax.annotation.Generated;
+import java.io.Serializable;
 
-public class TTaskMid {
-    @Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.616+08:00", comments = "Source field: t_task_mid.id")
+public class TTaskMid implements Serializable {
+	
 	private Integer id;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.622+08:00", comments = "Source field: t_task_mid.tid")
 	private Integer tid;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.cost_amount")
 	private BigDecimal costAmount;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.party_amount")
 	private BigDecimal partyAmount;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.create_time")
 	private Date createTime;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.certificates_count")
 	private Integer certificatesCount;
+	private Integer urgentDay;
+	private Integer ifMaterial;
+	private Integer rejectCount;
+	private static final long serialVersionUID = 1L;
 
-
-
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.622+08:00", comments = "Source field: t_task_mid.id")
 	public Integer getId() {
 		return id;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.622+08:00", comments = "Source field: t_task_mid.id")
 	public void setId(Integer id) {
 		this.id = id;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.622+08:00", comments = "Source field: t_task_mid.tid")
 	public Integer getTid() {
 		return tid;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.622+08:00", comments = "Source field: t_task_mid.tid")
 	public void setTid(Integer tid) {
 		this.tid = tid;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.cost_amount")
 	public BigDecimal getCostAmount() {
 		return costAmount;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.cost_amount")
 	public void setCostAmount(BigDecimal costAmount) {
 		this.costAmount = costAmount;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.party_amount")
 	public BigDecimal getPartyAmount() {
 		return partyAmount;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.party_amount")
 	public void setPartyAmount(BigDecimal partyAmount) {
 		this.partyAmount = partyAmount;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.create_time")
 	public Date getCreateTime() {
 		return createTime;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.create_time")
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.certificates_count")
 	public Integer getCertificatesCount() {
 		return certificatesCount;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:48:45.623+08:00", comments = "Source field: t_task_mid.certificates_count")
 	public void setCertificatesCount(Integer certificatesCount) {
 		this.certificatesCount = certificatesCount;
 	}
 
-	private Integer urgentDay;
-	private Integer ifMaterial;
-	private Integer rejectCount;
-	
-	
-
 	public Integer getUrgentDay() {
 		return urgentDay;
 	}
@@ -110,7 +89,27 @@ public class TTaskMid {
 		this.rejectCount = rejectCount;
 	}
 
-	
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getClass().getSimpleName());
+		sb.append(" [");
+		sb.append("Hash = ").append(hashCode());
+		sb.append(", id=").append(id);
+		sb.append(", tid=").append(tid);
+		sb.append(", costAmount=").append(costAmount);
+		sb.append(", partyAmount=").append(partyAmount);
+		sb.append(", createTime=").append(createTime);
+		sb.append(", certificatesCount=").append(certificatesCount);
+		sb.append(", urgentDay=").append(urgentDay);
+		sb.append(", ifMaterial=").append(ifMaterial);
+		sb.append(", rejectCount=").append(rejectCount);
+		sb.append(", serialVersionUID=").append(serialVersionUID);
+		sb.append("]");
+		return sb.toString();
+	}
+
+
 	public TTaskMid() {}
     
     public TTaskMid(Integer tid,BigDecimal costAmount) {

+ 38 - 51
src/main/java/com/goafanti/common/model/TaskProgress.java

@@ -1,106 +1,63 @@
 package com.goafanti.common.model;
 
 import java.util.Date;
-import javax.annotation.Generated;
 import java.io.Serializable;
 
 public class TaskProgress implements Serializable {
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.978+08:00", comments = "Source field: task_progress.id")
 	private Integer id;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.979+08:00", comments = "Source field: task_progress.already_number")
 	private Integer alreadyNumber;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.98+08:00", comments = "Source field: task_progress.licence_time")
 	private Date licenceTime;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.981+08:00", comments = "Source field: task_progress.task_id")
 	private Integer taskId;
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.981+08:00", comments = "Source field: task_progress.create_time")
 	private Date createTime;
+	private Date acceptTime;
+	private Date authorizeTime;
+	private String patentNo;
+	private String patentName;
+	private Integer status;
+	private Integer type;
 	private static final long serialVersionUID = 1L;
 
-
-
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.978+08:00", comments = "Source field: task_progress.id")
 	public Integer getId() {
 		return id;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.978+08:00", comments = "Source field: task_progress.id")
 	public void setId(Integer id) {
 		this.id = id;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.979+08:00", comments = "Source field: task_progress.already_number")
 	public Integer getAlreadyNumber() {
 		return alreadyNumber;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.98+08:00", comments = "Source field: task_progress.already_number")
 	public void setAlreadyNumber(Integer alreadyNumber) {
 		this.alreadyNumber = alreadyNumber;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.98+08:00", comments = "Source field: task_progress.licence_time")
 	public Date getLicenceTime() {
 		return licenceTime;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.98+08:00", comments = "Source field: task_progress.licence_time")
 	public void setLicenceTime(Date licenceTime) {
 		this.licenceTime = licenceTime;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.981+08:00", comments = "Source field: task_progress.task_id")
 	public Integer getTaskId() {
 		return taskId;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.981+08:00", comments = "Source field: task_progress.task_id")
 	public void setTaskId(Integer taskId) {
 		this.taskId = taskId;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.981+08:00", comments = "Source field: task_progress.create_time")
 	public Date getCreateTime() {
 		return createTime;
 	}
 
-	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-12-23T11:51:42.981+08:00", comments = "Source field: task_progress.create_time")
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
 
-	
-
-	@Override
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append(getClass().getSimpleName());
-		sb.append(" [");
-		sb.append("Hash = ").append(hashCode());
-		sb.append(", id=").append(id);
-		sb.append(", alreadyNumber=").append(alreadyNumber);
-		sb.append(", licenceTime=").append(licenceTime);
-		sb.append(", taskId=").append(taskId);
-		sb.append(", createTime=").append(createTime);
-		sb.append(", acceptTime=").append(acceptTime);
-		sb.append(", authorizeTime=").append(authorizeTime);
-		sb.append(", patentNo=").append(patentNo);
-		sb.append(", patentName=").append(patentName);
-		sb.append(", status=").append(status);
-		sb.append(", serialVersionUID=").append(serialVersionUID);
-		sb.append("]");
-		return sb.toString();
-	}
-
-	private Date acceptTime;
-	private Date authorizeTime;
-	private String patentNo;
-	private String patentName;
-	private Integer status;
-	
-	
-
 	public Date getAcceptTime() {
 		return acceptTime;
 	}
@@ -122,7 +79,7 @@ public class TaskProgress implements Serializable {
 	}
 
 	public void setPatentNo(String patentNo) {
-		this.patentNo = patentNo;
+		this.patentNo = patentNo == null ? null : patentNo.trim();
 	}
 
 	public String getPatentName() {
@@ -130,7 +87,7 @@ public class TaskProgress implements Serializable {
 	}
 
 	public void setPatentName(String patentName) {
-		this.patentName = patentName;
+		this.patentName = patentName == null ? null : patentName.trim();
 	}
 
 	public Integer getStatus() {
@@ -140,4 +97,34 @@ public class TaskProgress implements Serializable {
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getClass().getSimpleName());
+		sb.append(" [");
+		sb.append("Hash = ").append(hashCode());
+		sb.append(", id=").append(id);
+		sb.append(", alreadyNumber=").append(alreadyNumber);
+		sb.append(", licenceTime=").append(licenceTime);
+		sb.append(", taskId=").append(taskId);
+		sb.append(", createTime=").append(createTime);
+		sb.append(", acceptTime=").append(acceptTime);
+		sb.append(", authorizeTime=").append(authorizeTime);
+		sb.append(", patentNo=").append(patentNo);
+		sb.append(", patentName=").append(patentName);
+		sb.append(", status=").append(status);
+		sb.append(", type=").append(type);
+		sb.append(", serialVersionUID=").append(serialVersionUID);
+		sb.append("]");
+		return sb.toString();
+	}
 }

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

@@ -20,7 +20,8 @@ public class InputProjectStatistics {
 	private Integer status;
 	private String depName;
 	private String thchDepName;
-	
+	private String projectStatusName;
+	private String projectTypeName;
 	
 	public Integer getStatus() {
 		return status;
@@ -124,6 +125,18 @@ public class InputProjectStatistics {
 	public void setProjectAmount(Integer projectAmount) {
 		this.projectAmount = projectAmount;
 	}
+	public String getProjectStatusName() {
+		return projectStatusName;
+	}
+	public void setProjectStatusName(String projectStatusName) {
+		this.projectStatusName = projectStatusName;
+	}
+	public String getProjectTypeName() {
+		return projectTypeName;
+	}
+	public void setProjectTypeName(String projectTypeName) {
+		this.projectTypeName = projectTypeName;
+	}
 	
 	
 	

+ 14 - 0
src/main/java/com/goafanti/order/bo/OutProjectStatistics.java

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 
 
 public class OutProjectStatistics {
+	private Integer id;
 	private String distributionTime; 
 	private String province;
 	private String depName;
@@ -54,6 +55,7 @@ public class OutProjectStatistics {
 	private String	patentName;
 	/**受理时间*/
 	private String	acceptTime;
+	private String	specialComment;
 	
 	
 	public Integer getSetUpStatus() {
@@ -260,5 +262,17 @@ public class OutProjectStatistics {
 	public void setHighTechstatus(Integer highTechstatus) {
 		this.highTechstatus = highTechstatus;
 	}
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public String getSpecialComment() {
+		return specialComment;
+	}
+	public void setSpecialComment(String specialComment) {
+		this.specialComment = specialComment;
+	}
 
 }

+ 55 - 17
src/main/java/com/goafanti/order/bo/OutProvincialStatistics.java

@@ -10,46 +10,58 @@ public class OutProvincialStatistics {
 	
 	private String projectStatus;
 	
+	/** 库存数 */
 	private Integer stockCount;
-	
+	/** 派单数 */
 	private Integer distributeCount;
-	
+	/** 完成数 */
 	private Integer completeCount;
-	
+	/** 立项数 */
 	private Integer setUpCount;
-	
+	/** 抽查数 */
 	private Integer spotCheckCount;
-	
+	/** 未通过数 */
 	private Integer failedCount;
+	/** 授理数 */
+	private Integer acceptCount;
+	/** 授权数 */
+	private Integer authorizeCount;
+	/** 驳回数 */
+	private Integer rejectCount;
 	
 	private BigDecimal amountCount;
 	
 	private BigDecimal costAmount;
 	
 	private BigDecimal profit;
+	
+	
 
-	public String getProvinceName() {
-		return provinceName;
+	
+	
+
+	public Integer getAcceptCount() {
+		return acceptCount;
 	}
 
-	public void setProvinceName(String provinceName) {
-		this.provinceName = provinceName;
+	public void setAcceptCount(Integer acceptCount) {
+		this.acceptCount = acceptCount;
 	}
 
-	public String getThchDepName() {
-		return thchDepName;
+	public Integer getAuthorizeCount() {
+		return authorizeCount;
 	}
 
-	public void setThchDepName(String thchDepName) {
-		this.thchDepName = thchDepName;
+	public void setAuthorizeCount(Integer authorizeCount) {
+		this.authorizeCount = authorizeCount;
 	}
 
-	public String getProjectStatus() {
-		return projectStatus;
+	public Integer getRejectCount() {
+		return rejectCount;
 	}
 
-	public void setProjectStatus(String projectStatus) {
-		this.projectStatus = projectStatus;
+	public void setRejectCount(Integer rejectCount) {
+		this.rejectCount = rejectCount;
 	}
 
 	public Integer getStockCount() {
@@ -100,6 +112,32 @@ public class OutProvincialStatistics {
 		this.failedCount = failedCount;
 	}
 
+	public String getProvinceName() {
+		return provinceName;
+	}
+
+	public void setProvinceName(String provinceName) {
+		this.provinceName = provinceName;
+	}
+
+	public String getThchDepName() {
+		return thchDepName;
+	}
+
+	public void setThchDepName(String thchDepName) {
+		this.thchDepName = thchDepName;
+	}
+
+	public String getProjectStatus() {
+		return projectStatus;
+	}
+
+	public void setProjectStatus(String projectStatus) {
+		this.projectStatus = projectStatus;
+	}
+
+	
+
 	public BigDecimal getAmountCount() {
 		return amountCount;
 	}

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

@@ -1,5 +1,7 @@
 package com.goafanti.order.bo;
 
+import java.math.BigDecimal;
+
 import com.goafanti.common.utils.StringUtils;
 
 public class TOrderTaskDetailBo {
@@ -95,11 +97,43 @@ public class TOrderTaskDetailBo {
 	
 	private Integer urgentDay;
 	private Integer ifMaterial;
-	private Integer rejectCount;
 	private String specialComment;
+	private Integer rejectCount;
+	
+	private Integer certificatesCount;
+	private Integer authorizeCount; 
+	private Integer endCount;
+	private Integer acceptCount;
+	private BigDecimal commodityPrice;
+	private Integer	commodityQuantity;
+	
 	
 	
 	
+	public Integer getCertificatesCount() {
+		return certificatesCount;
+	}
+	public void setCertificatesCount(Integer certificatesCount) {
+		this.certificatesCount = certificatesCount;
+	}
+	public Integer getAuthorizeCount() {
+		return authorizeCount;
+	}
+	public void setAuthorizeCount(Integer authorizeCount) {
+		this.authorizeCount = authorizeCount;
+	}
+	public Integer getEndCount() {
+		return endCount;
+	}
+	public void setEndCount(Integer endCount) {
+		this.endCount = endCount;
+	}
+	public Integer getAcceptCount() {
+		return acceptCount;
+	}
+	public void setAcceptCount(Integer acceptCount) {
+		this.acceptCount = acceptCount;
+	}
 	public Integer getSetUpStatus() {
 		return setUpStatus;
 	}
@@ -438,6 +472,18 @@ public class TOrderTaskDetailBo {
 	public void setSpecialComment(String specialComment) {
 		this.specialComment = specialComment;
 	}
+	public BigDecimal getCommodityPrice() {
+		return commodityPrice;
+	}
+	public void setCommodityPrice(BigDecimal commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+	public Integer getCommodityQuantity() {
+		return commodityQuantity;
+	}
+	public void setCommodityQuantity(Integer commodityQuantity) {
+		this.commodityQuantity = commodityQuantity;
+	}
 	
 	
 }

+ 7 - 2
src/main/java/com/goafanti/order/bo/TaskProgressBo.java

@@ -6,6 +6,11 @@ import com.goafanti.common.model.TaskProgress;
 
 public class TaskProgressBo extends TaskProgress {
 	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
 	private String licenceTimes;
 	
 	private String createTimes;
@@ -13,10 +18,10 @@ public class TaskProgressBo extends TaskProgress {
 	private String acceptTimes;
 	private String authorizeTimes;
 	
-	private Integer ingCount;
-	
 	private Integer notCount;
 
+	private Integer ingCount;
+
 	public String getLicenceTimes() {
 		return licenceTimes;
 	}

+ 14 - 2
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -8,7 +8,6 @@ import java.text.SimpleDateFormat;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.lang3.text.StrTokenizer;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -165,7 +164,7 @@ public class OrderProjectApiController extends CertifyApiController {
 	@RequestMapping(value="/createTaskProgress" ,method = RequestMethod.POST)
 	public Result createTaskProgress(TaskProgressBo t){
 		Result res=new Result();
-		if (StringUtils.isBlank(t.getLicenceTimes())|| null==t.getTaskId()|| null==t.getAlreadyNumber()) {
+		if ( null==t.getTaskId()|| null==t.getAlreadyNumber()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
 		}
 		res.setData(orderProjectService.createTaskProgress(t));
@@ -173,6 +172,19 @@ public class OrderProjectApiController extends CertifyApiController {
 	}
 	
 	/**
+	 * 	新增项目申报进度
+	 */
+	@RequestMapping(value="/updateTaskProgress" ,method = RequestMethod.POST)
+	public Result updateTaskProgress(TaskProgressBo t){
+		Result res=new Result();
+		if (null==t.getTaskId()|| null==t.getAlreadyNumber()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
+		}
+		res.setData(orderProjectService.updateTaskProgress(t));
+		return res;
+	}
+	
+	/**
 	 * 	删除项目申报进度
 	 */
 	@RequestMapping(value="/delectTaskProgress" ,method = RequestMethod.POST)

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

@@ -63,6 +63,8 @@ public interface OrderProjectService {
 
 	List<OutTaskProgressLog> selectTaskProgressLog(Integer tid);
 
+	int updateTaskProgress(TaskProgressBo t);
+
 
 
 }

+ 36 - 9
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -88,7 +88,6 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.OutNewOrderDunBo;
 import com.goafanti.order.bo.OutTaskProgressLog;
-import com.goafanti.order.bo.Outproject;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
@@ -768,30 +767,58 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		count +=t.getAlreadyNumber();
 		if(tt.getCommodityQuantity()<count)throw new BusinessException(new Error( "数量不能大于总量!" ,"数量不能大于总量!"));
 		tp.setAlreadyNumber(t.getAlreadyNumber());
-		tp.setLicenceTime(DateUtils.StringToDate(t.getLicenceTimes(), AFTConstants.YYYYMMDD));
 		tp.setPatentName(t.getPatentName());
 		tp.setPatentNo(t.getPatentNo());
-		tp.setAcceptTime(DateUtils.StringToDate(t.getAcceptTimes(), AFTConstants.YYYYMMDD));
-		tp.setAuthorizeTime(DateUtils.StringToDate(t.getAuthorizeTimes(), AFTConstants.YYYYMMDD));
+		tp.setType(t.getType());
+		if (t.getLicenceTimes()!=null) tp.setLicenceTime(DateUtils.StringToDate(t.getLicenceTimes(), AFTConstants.YYYYMMDD));
+		if (t.getAcceptTimes()!=null) tp.setAcceptTime(DateUtils.StringToDate(t.getAcceptTimes(), AFTConstants.YYYYMMDD));
+		if (t.getAuthorizeTimes()!=null) tp.setAuthorizeTime(DateUtils.StringToDate(t.getAuthorizeTimes(), AFTConstants.YYYYMMDD));
 		tp.setStatus(t.getStatus());
 		tp.setTaskId(t.getTaskId());
 		tTaskMidMapper.updateCertificatesCountByTid(t.getTaskId(),count);
 		TaskProgressLog tpl=new TaskProgressLog(t.getTaskId(),t.getPatentName(),0,new Date());
 		taskProgressLogMapper.insertSelective(tpl);
-		return taskProgressMapper.insertSelective(tp);
+		int i=taskProgressMapper.insertSelective(tp);
+		tTaskMidMapper.updateCountBytid(t.getTaskId());
+		return i; 
 	}
+	
+	
+	@Override
+	public int updateTaskProgress(TaskProgressBo t) {
+		TaskProgress tp=taskProgressMapper.selectByPrimaryKey(t.getId());
+		TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(t.getTaskId());
+		int count =taskProgressMapper.AlreadyNuberCount(t.getTaskId());
+		count = count-tp.getAlreadyNumber()+t.getAlreadyNumber();
+		if(tt.getCommodityQuantity()<count)throw new BusinessException(new Error( "数量不能大于总量!" ,"数量不能大于总量!"));
+		tp.setAlreadyNumber(t.getAlreadyNumber());
+		tp.setPatentName(t.getPatentName());
+		tp.setPatentNo(t.getPatentNo());
+		tp.setType(t.getType());
+		if (t.getLicenceTimes()!=null) tp.setLicenceTime(DateUtils.StringToDate(t.getLicenceTimes(), AFTConstants.YYYYMMDD));
+		if (t.getAcceptTimes()!=null) tp.setAcceptTime(DateUtils.StringToDate(t.getAcceptTimes(), AFTConstants.YYYYMMDD));
+		if (t.getAuthorizeTimes()!=null) tp.setAuthorizeTime(DateUtils.StringToDate(t.getAuthorizeTimes(), AFTConstants.YYYYMMDD));
+		tp.setStatus(t.getStatus());
+		tp.setTaskId(t.getTaskId());
+		tTaskMidMapper.updateCertificatesCountByTid(t.getTaskId(),count);
+		TaskProgressLog tpl=new TaskProgressLog(t.getTaskId(),t.getPatentName(),2,new Date());
+		taskProgressLogMapper.insertSelective(tpl);
+		int i=taskProgressMapper.updateByPrimaryKeySelective(tp);
+		tTaskMidMapper.updateCountBytid(t.getTaskId());
+		return i; 
+	}
+
 	@Override
 	public int delectTaskProgress(Integer id) {
 		TaskProgress tp=taskProgressMapper.selectByPrimaryKey(id);
 		if (tp==null) {
 			return 0;
 		}
-		taskProgressMapper.deleteByPrimaryKey(id);
-		int count =taskProgressMapper.AlreadyNuberCount(tp.getTaskId());
+		int i=taskProgressMapper.deleteByPrimaryKey(id);
 		TaskProgressLog tpl=new TaskProgressLog(tp.getTaskId(),tp.getPatentName(),1,new Date());
 		taskProgressLogMapper.insertSelective(tpl);
-		tTaskMidMapper.updateCertificatesCountByTid(tp.getTaskId(),count);
-		return 1;
+		tTaskMidMapper.updateCountBytid(tp.getTaskId());
+		return i;
 	}
 	@Override
 	public List<TaskProgressBo> selectTaskProgress(Integer tid) {

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

@@ -69,7 +69,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 			params.put("amountStart", s);
 			params.put("amountEnd", e);
 		}
-		if (ps.getStatus() !=null) params.put("status",ps.getStatus());
+		params.put("status",ps.getStatus()==null?0:ps.getStatus());
 		if(ps.getPageNo()!=null)pageNo=ps.getPageNo();
 		if(ps.getPageSize()!=null)pageSize=ps.getPageSize();
 		Pagination<OutProjectStatistics> p = (Pagination<OutProjectStatistics>)findPage("selectProjectStatisticsListByPage",
@@ -192,8 +192,8 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 		if(ib.getEndDate()!=null)str=StringUtils.join(str,i++,"-结束时间:",ib.getEndDate(),"   ");
 		if(ib.getDepId()!=null)str=StringUtils.join(str,i++,"-订单部门:",ib.getDepName(),"   ");
 		if(ib.getThchDepId()!=null)str=StringUtils.join(str,i++,"-责任部门:",ib.getThchDepName(),"   ");
-		if(ib.getProjectStatus()!=null)str=StringUtils.join(str,i++,"-项目别类:",ib.getProjectStatus(),"   ");
-		if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectType(),"   ");
+		if(ib.getProjectStatus()!=null)str=StringUtils.join(str,i++,"-项目别类:",ib.getProjectStatusName(),"   ");
+		if(ib.getProjectType()!=null)str=StringUtils.join(str,i++,"-项目分类:",ib.getProjectTypeName(),"   ");
 		if(ib.getOrderNo()!=null)str=StringUtils.join(str,i++,"-订单编号:",ib.getOrderNo(),"   ");
 		if(ib.getContractNo()!=null)str=StringUtils.join(str,i++,"-合同编号:",ib.getContractNo(),"   ");
 		if(ib.getUserName()!=null)str=StringUtils.join(str,i++,"-客户名称:",ib.getUserName(),"   ");
@@ -242,6 +242,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 		if(is.getProjectType()!=null)params.put("projectType", is.getProjectType());
 		if(is.getProvince()!=null)params.put("province", is.getProvince());
 		if(is.getProjectId()!=null)params.put("projectId", is.getProjectId());
+		params.put("status",is.getStatus()==null?2:is.getStatus());
 		if(is.getPageNo()!=null)pageNo=is.getPageNo();
 		if(is.getPageSize()!=null)pageSize=is.getPageSize();
 		Pagination<OutProvincialStatistics> p = (Pagination<OutProvincialStatistics>)findPage("selectProvincialStatisticsListByPage",