Browse Source

项目统计修改开发

anderx 3 years ago
parent
commit
012aaa7714

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

@@ -34,4 +34,4 @@ public interface TTaskMidMapper {
 
     TTaskMid selectCountBytid(@Param("tid")Integer tid, @Param("type")Integer type);
 
-}
+}

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

@@ -1762,7 +1762,8 @@
         b.fail_count ,b.certificates_count,     b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
         a.commodity_price ,b.cost_amount, a.task_distribution_time     from t_order_task a
         left join t_task_mid b on a.id=b.tid     left join business_project bp on a.commodity_id =bp.id
-        where a.task_status in(1,2,3)
+    left join t_order_new ton on a.order_no =ton .order_no
+    where a.task_status in(1,2,3)  and ton.delete_sign in (0,2)
     <if test="projectId !=null">
     and a.commodity_id = #{projectId}
     </if>
@@ -1800,7 +1801,8 @@
     from t_order_task a
     left join t_task_mid b on a.id=b.tid
     left join business_project bp on a.commodity_id =bp.id
-    where a.task_status in(1,2,3)
+    left join t_order_new ton on a.order_no =ton .order_no
+    where a.task_status in(1,2,3)  and ton.delete_sign in (0,2)
     <if test="projectId !=null">
       and a.commodity_id = #{projectId}
     </if>

+ 178 - 21
src/main/java/com/goafanti/common/mapper/TTaskMidMapper.xml

@@ -16,14 +16,24 @@
     <result column="authorize_count" jdbcType="INTEGER" property="authorizeCount" />
     <result column="apply_count" jdbcType="INTEGER" property="applyCount" />
     <result column="high_new_retrial" jdbcType="INTEGER" property="highNewRetrial" />
+    <result column="dispatch_count" jdbcType="INTEGER" property="dispatchCount" />
+    <result column="stock_count" jdbcType="INTEGER" property="stockCount" />
+    <result column="complete_count" jdbcType="INTEGER" property="completeCount" />
+    <result column="promulgate_count" jdbcType="INTEGER" property="promulgateCount" />
+    <result column="dispatch_province" jdbcType="INTEGER" property="dispatchProvince" />
+    <result column="duty_dep" jdbcType="VARCHAR" property="dutyDep" />
+    <result column="set_up_count" jdbcType="INTEGER" property="setUpCount" />
+    <result column="spot_check_count" jdbcType="INTEGER" property="spotCheckCount" />
+    <result column="fail_count" jdbcType="INTEGER" property="failCount" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, tid, cost_amount, party_amount, create_time, certificates_count, urgent_day, 
-    if_material, reject_count, accept_count, end_count, authorize_count, apply_count, 
-    high_new_retrial
+    id, tid, cost_amount, party_amount, create_time, certificates_count, urgent_day,
+    if_material, reject_count, accept_count, end_count, authorize_count, apply_count,
+    high_new_retrial, dispatch_count, stock_count, complete_count, promulgate_count,
+    dispatch_province, duty_dep, set_up_count, spot_check_count, fail_count
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from t_task_mid
     where id = #{id,jdbcType=INTEGER}
@@ -33,16 +43,22 @@
     where id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.TTaskMid">
-    insert into t_task_mid (id, tid, cost_amount, 
-      party_amount, create_time, certificates_count, 
-      urgent_day, if_material, reject_count, 
-      accept_count, end_count, authorize_count, 
-      apply_count, high_new_retrial)
-    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL}, 
-      #{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER}, 
-      #{urgentDay,jdbcType=INTEGER}, #{ifMaterial,jdbcType=INTEGER}, #{rejectCount,jdbcType=INTEGER}, 
-      #{acceptCount,jdbcType=INTEGER}, #{endCount,jdbcType=INTEGER}, #{authorizeCount,jdbcType=INTEGER}, 
-      #{applyCount,jdbcType=INTEGER}, #{highNewRetrial,jdbcType=INTEGER})
+    insert into t_task_mid (id, tid, cost_amount,
+      party_amount, create_time, certificates_count,
+      urgent_day, if_material, reject_count,
+      accept_count, end_count, authorize_count,
+      apply_count, high_new_retrial, dispatch_count,
+      stock_count, complete_count, promulgate_count,
+      dispatch_province, duty_dep, set_up_count,
+      spot_check_count, fail_count)
+    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL},
+      #{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER},
+      #{urgentDay,jdbcType=INTEGER}, #{ifMaterial,jdbcType=INTEGER}, #{rejectCount,jdbcType=INTEGER},
+      #{acceptCount,jdbcType=INTEGER}, #{endCount,jdbcType=INTEGER}, #{authorizeCount,jdbcType=INTEGER},
+      #{applyCount,jdbcType=INTEGER}, #{highNewRetrial,jdbcType=INTEGER}, #{dispatchCount,jdbcType=INTEGER},
+      #{stockCount,jdbcType=INTEGER}, #{completeCount,jdbcType=INTEGER}, #{promulgateCount,jdbcType=INTEGER},
+      #{dispatchProvince,jdbcType=INTEGER}, #{dutyDep,jdbcType=VARCHAR}, #{setUpCount,jdbcType=INTEGER},
+      #{spotCheckCount,jdbcType=INTEGER}, #{failCount,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TTaskMid">
     insert into t_task_mid
@@ -89,6 +105,33 @@
       <if test="highNewRetrial != null">
         high_new_retrial,
       </if>
+      <if test="dispatchCount != null">
+        dispatch_count,
+      </if>
+      <if test="stockCount != null">
+        stock_count,
+      </if>
+      <if test="completeCount != null">
+        complete_count,
+      </if>
+      <if test="promulgateCount != null">
+        promulgate_count,
+      </if>
+      <if test="dispatchProvince != null">
+        dispatch_province,
+      </if>
+      <if test="dutyDep != null">
+        duty_dep,
+      </if>
+      <if test="setUpCount != null">
+        set_up_count,
+      </if>
+      <if test="spotCheckCount != null">
+        spot_check_count,
+      </if>
+      <if test="failCount != null">
+        fail_count,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -133,6 +176,33 @@
       <if test="highNewRetrial != null">
         #{highNewRetrial,jdbcType=INTEGER},
       </if>
+      <if test="dispatchCount != null">
+        #{dispatchCount,jdbcType=INTEGER},
+      </if>
+      <if test="stockCount != null">
+        #{stockCount,jdbcType=INTEGER},
+      </if>
+      <if test="completeCount != null">
+        #{completeCount,jdbcType=INTEGER},
+      </if>
+      <if test="promulgateCount != null">
+        #{promulgateCount,jdbcType=INTEGER},
+      </if>
+      <if test="dispatchProvince != null">
+        #{dispatchProvince,jdbcType=INTEGER},
+      </if>
+      <if test="dutyDep != null">
+        #{dutyDep,jdbcType=VARCHAR},
+      </if>
+      <if test="setUpCount != null">
+        #{setUpCount,jdbcType=INTEGER},
+      </if>
+      <if test="spotCheckCount != null">
+        #{spotCheckCount,jdbcType=INTEGER},
+      </if>
+      <if test="failCount != null">
+        #{failCount,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TTaskMid">
@@ -177,6 +247,33 @@
       <if test="highNewRetrial != null">
         high_new_retrial = #{highNewRetrial,jdbcType=INTEGER},
       </if>
+      <if test="dispatchCount != null">
+        dispatch_count = #{dispatchCount,jdbcType=INTEGER},
+      </if>
+      <if test="stockCount != null">
+        stock_count = #{stockCount,jdbcType=INTEGER},
+      </if>
+      <if test="completeCount != null">
+        complete_count = #{completeCount,jdbcType=INTEGER},
+      </if>
+      <if test="promulgateCount != null">
+        promulgate_count = #{promulgateCount,jdbcType=INTEGER},
+      </if>
+      <if test="dispatchProvince != null">
+        dispatch_province = #{dispatchProvince,jdbcType=INTEGER},
+      </if>
+      <if test="dutyDep != null">
+        duty_dep = #{dutyDep,jdbcType=VARCHAR},
+      </if>
+      <if test="setUpCount != null">
+        set_up_count = #{setUpCount,jdbcType=INTEGER},
+      </if>
+      <if test="spotCheckCount != null">
+        spot_check_count = #{spotCheckCount,jdbcType=INTEGER},
+      </if>
+      <if test="failCount != null">
+        fail_count = #{failCount,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -194,7 +291,16 @@
       end_count = #{endCount,jdbcType=INTEGER},
       authorize_count = #{authorizeCount,jdbcType=INTEGER},
       apply_count = #{applyCount,jdbcType=INTEGER},
-      high_new_retrial = #{highNewRetrial,jdbcType=INTEGER}
+      high_new_retrial = #{highNewRetrial,jdbcType=INTEGER},
+      dispatch_count = #{dispatchCount,jdbcType=INTEGER},
+      stock_count = #{stockCount,jdbcType=INTEGER},
+      complete_count = #{completeCount,jdbcType=INTEGER},
+      promulgate_count = #{promulgateCount,jdbcType=INTEGER},
+      dispatch_province = #{dispatchProvince,jdbcType=INTEGER},
+      duty_dep = #{dutyDep,jdbcType=VARCHAR},
+      set_up_count = #{setUpCount,jdbcType=INTEGER},
+      spot_check_count = #{spotCheckCount,jdbcType=INTEGER},
+      fail_count = #{failCount,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -231,20 +337,71 @@
   <update id="updateByTid" parameterType="com.goafanti.common.model.TTaskMid">
     update t_task_mid
     <set>
+      <if test="tid != null">
+        tid = #{tid,jdbcType=INTEGER},
+      </if>
+      <if test="costAmount != null">
+        cost_amount = #{costAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="partyAmount != null">
+        party_amount = #{partyAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="certificatesCount != null">
+        certificates_count = #{certificatesCount,jdbcType=INTEGER},
+      </if>
       <if test="urgentDay != null">
-        urgent_Day = #{urgentDay},
+        urgent_day = #{urgentDay,jdbcType=INTEGER},
       </if>
       <if test="ifMaterial != null">
-        if_material = #{ifMaterial},
+        if_material = #{ifMaterial,jdbcType=INTEGER},
       </if>
       <if test="rejectCount != null">
-        reject_count = #{rejectCount},
+        reject_count = #{rejectCount,jdbcType=INTEGER},
       </if>
       <if test="acceptCount != null">
-        accept_count = #{acceptCount},
+        accept_count = #{acceptCount,jdbcType=INTEGER},
+      </if>
+      <if test="endCount != null">
+        end_count = #{endCount,jdbcType=INTEGER},
       </if>
       <if test="authorizeCount != null">
-        authorize_count = #{authorizeCount},
+        authorize_count = #{authorizeCount,jdbcType=INTEGER},
+      </if>
+      <if test="applyCount != null">
+        apply_count = #{applyCount,jdbcType=INTEGER},
+      </if>
+      <if test="highNewRetrial != null">
+        high_new_retrial = #{highNewRetrial,jdbcType=INTEGER},
+      </if>
+      <if test="dispatchCount != null">
+        dispatch_count = #{dispatchCount,jdbcType=INTEGER},
+      </if>
+      <if test="stockCount != null">
+        stock_count = #{stockCount,jdbcType=INTEGER},
+      </if>
+      <if test="completeCount != null">
+        complete_count = #{completeCount,jdbcType=INTEGER},
+      </if>
+      <if test="promulgateCount != null">
+        promulgate_count = #{promulgateCount,jdbcType=INTEGER},
+      </if>
+      <if test="dispatchProvince != null">
+        dispatch_province = #{dispatchProvince,jdbcType=INTEGER},
+      </if>
+      <if test="dutyDep != null">
+        duty_dep = #{dutyDep,jdbcType=VARCHAR},
+      </if>
+      <if test="setUpCount != null">
+        set_up_count = #{setUpCount,jdbcType=INTEGER},
+      </if>
+      <if test="spotCheckCount != null">
+        spot_check_count = #{spotCheckCount,jdbcType=INTEGER},
+      </if>
+      <if test="failCount != null">
+        fail_count = #{failCount,jdbcType=INTEGER},
       </if>
     </set>
     where tid = #{tid,jdbcType=INTEGER}
@@ -280,4 +437,4 @@
     where a.tid= #{tid}
   </select>
 
-</mapper>
+</mapper>

+ 118 - 2
src/main/java/com/goafanti/common/model/TTaskMid.java

@@ -6,7 +6,7 @@ import java.util.Date;
 
 /**
  * t_task_mid
- * @author 
+ * @author
  */
 public class TTaskMid implements Serializable {
     /**
@@ -79,6 +79,51 @@ public class TTaskMid implements Serializable {
      */
     private Integer highNewRetrial;
 
+    /**
+     * 派单数
+     */
+    private Integer dispatchCount;
+
+    /**
+     * 库存数
+     */
+    private Integer stockCount;
+
+    /**
+     * 完成数
+     */
+    private Integer completeCount;
+
+    /**
+     * 公示数
+     */
+    private Integer promulgateCount;
+
+    /**
+     * 派单省份
+     */
+    private Integer dispatchProvince;
+
+    /**
+     * 责任部门
+     */
+    private String dutyDep;
+
+    /**
+     * 立项数
+     */
+    private Integer setUpCount;
+
+    /**
+     * 抽查数
+     */
+    private Integer spotCheckCount;
+
+    /**
+     * 未通过数
+     */
+    private Integer failCount;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -193,6 +238,77 @@ public class TTaskMid implements Serializable {
         this.highNewRetrial = highNewRetrial;
     }
 
+    public Integer getDispatchCount() {
+        return dispatchCount;
+    }
+
+    public void setDispatchCount(Integer dispatchCount) {
+        this.dispatchCount = dispatchCount;
+    }
+
+    public Integer getStockCount() {
+        return stockCount;
+    }
+
+    public void setStockCount(Integer stockCount) {
+        this.stockCount = stockCount;
+    }
+
+    public Integer getCompleteCount() {
+        return completeCount;
+    }
+
+    public void setCompleteCount(Integer completeCount) {
+        this.completeCount = completeCount;
+    }
+
+    public Integer getPromulgateCount() {
+        return promulgateCount;
+    }
+
+    public void setPromulgateCount(Integer promulgateCount) {
+        this.promulgateCount = promulgateCount;
+    }
+
+    public Integer getDispatchProvince() {
+        return dispatchProvince;
+    }
+
+    public void setDispatchProvince(Integer dispatchProvince) {
+        this.dispatchProvince = dispatchProvince;
+    }
+
+    public String getDutyDep() {
+        return dutyDep;
+    }
+
+    public void setDutyDep(String dutyDep) {
+        this.dutyDep = dutyDep;
+    }
+
+    public Integer getSetUpCount() {
+        return setUpCount;
+    }
+
+    public void setSetUpCount(Integer setUpCount) {
+        this.setUpCount = setUpCount;
+    }
+
+    public Integer getSpotCheckCount() {
+        return spotCheckCount;
+    }
+
+    public void setSpotCheckCount(Integer spotCheckCount) {
+        this.spotCheckCount = spotCheckCount;
+    }
+
+    public Integer getFailCount() {
+        return failCount;
+    }
+
+    public void setFailCount(Integer failCount) {
+        this.failCount = failCount;
+    }
     public TTaskMid(Integer tid, BigDecimal costAmount) {
         this.tid = tid;
         this.costAmount = costAmount;
@@ -200,4 +316,4 @@ public class TTaskMid implements Serializable {
     public TTaskMid() {
 
     }
-}
+}

+ 21 - 11
src/main/java/com/goafanti/order/bo/InputProjectStatistics.java

@@ -1,7 +1,7 @@
 package com.goafanti.order.bo;
 
 public class InputProjectStatistics {
-	
+
 	private String startDate;
 	private String endDate;
 	private String depId;
@@ -16,20 +16,30 @@ public class InputProjectStatistics {
 	private Integer projectAmount;
 	private Integer pageNo;
 	private Integer pageSize;
-	
+
 	private Integer status;
 	private String depName;
 	private String thchDepName;
 	private String projectStatusName;
 	private String projectTypeName;
-	
+
 	private Integer province;
+
+	private String provinceName;
 	private String projectId;
-	/** 
+	/**
 	 * 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请
 	 */
 	private Integer screen;
-	
+
+	public String getProvinceName() {
+		return provinceName;
+	}
+
+	public void setProvinceName(String provinceName) {
+		this.provinceName = provinceName;
+	}
+
 	public Integer getStatus() {
 		return status;
 	}
@@ -162,10 +172,10 @@ public class InputProjectStatistics {
 	public void setScreen(Integer screen) {
 		this.screen = screen;
 	}
-	
-	
-	
-	
-	
-	
+
+
+
+
+
+
 }

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

@@ -425,16 +425,22 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			e.printStackTrace();
 		}
 		tOrderTaskMapper.updateByPrimaryKeySelective(task);
-		//订单中间表修改
+		//项目中间表修改
 		if (t.getUrgentDay()!=null||t.getIfMaterial()!=null||t.getRejectCount()!=null||
-				t.getAcceptCount()!=null||t.getAuthorizeCount()!=null) {
+				t.getAcceptCount()!=null||t.getAuthorizeCount()!=null||t.getSpotCheckStatus()!=null) {
 			TTaskMid tm=new TTaskMid();
 			tm.setTid(task.getId());
-			tm.setUrgentDay(t.getUrgentDay());
-			tm.setIfMaterial(t.getIfMaterial());
-			tm.setRejectCount(t.getRejectCount());
-			tm.setAcceptCount(t.getAcceptCount());
-			tm.setAuthorizeCount(t.getAuthorizeCount());
+			if (t.getUrgentDay()!=null)tm.setUrgentDay(t.getUrgentDay());
+			if (t.getIfMaterial()!=null)tm.setIfMaterial(t.getIfMaterial());
+			if (t.getRejectCount()!=null)tm.setRejectCount(t.getRejectCount());
+			if (t.getAcceptCount()!=null)tm.setAcceptCount(t.getAcceptCount());
+			if (t.getAuthorizeCount()!=null)tm.setAuthorizeCount(t.getAuthorizeCount());
+			if (t.getSpotCheckStatus()==1||t.getSpotCheckStatus()==2){
+				tm.setSpotCheckCount(t.getCommodityQuantity());
+				if (t.getSpotCheckStatus()==2){
+					tm.setFailCount(t.getCommodityQuantity());
+				}
+			}
 			tTaskMidMapper.updateByTid(tm);
 		}
 		TaskLog tl=new TaskLog();
@@ -457,8 +463,16 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if (b.getPubicityUrl()!=null)t.setPubicityUrl(b.getPubicityUrl());
 		TOrderTask task2=tOrderTaskMapper.selectByPrimaryKey(b.getTid());//查询出项目信息
 		if(b.getProjectStatus()!=task2.getProjectStatus()){
-			if(b.getProjectStatus()==NewProjectStatus.YLX.getCode()) t.setSetUpStatus(1);
-			if(b.getProjectStatus()==NewProjectStatus.YNGS.getCode()) t.setSetUpStatus(1);
+				TTaskMid taskMid = new TTaskMid();
+				taskMid.setTid(b.getTid());
+			if(b.getProjectStatus()==NewProjectStatus.YLX.getCode()||b.getProjectStatus()==NewProjectStatus.YNGS.getCode()){
+				t.setSetUpStatus(1);
+				taskMid.setSetUpCount(task2.getCommodityQuantity());
+			}
+			if (b.getProjectStatus()>3){
+				taskMid.setCompleteCount(task2.getCommodityQuantity());
+			}
+				tTaskMidMapper.updateByTid(taskMid);
 			tOrderTaskMapper.updateByPrimaryKeySelective(t);
 			projectSplitPush(b.getTid(), b.getProjectStatus(),task2);
 			pushTaskLog(b.getTid(), b.getProjectStatus());

+ 7 - 0
src/main/java/com/goafanti/order/service/impl/ProjectStatisticsServiceImpl.java

@@ -127,6 +127,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
     		XSSFRow row = sheet.createRow(2);
     		//4.创建一个cell
     		XSSFCell cell = row.createCell(0);
+    		//处理搜索条件
     		cell.setCellValue(getInputString(ib));
     		sheet.addMergedRegion(new CellRangeAddress(2, 2, 0, comment.length-1));//合并单元格
     		for (OutProjectStatistics ob : list) {
@@ -206,6 +207,11 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 	}
 
 
+	/**
+	 * 拼接搜索参数
+	 * @param ib
+	 * @return
+	 */
 	private String getInputString(InputProjectStatistics ib) {
 		String str="搜索条件:";
 		int i=1;
@@ -213,6 +219,7 @@ public class ProjectStatisticsServiceImpl extends BaseMybatisDao<TOrderTaskMappe
 			str=StringUtils.join(str,i++,"-开始时间:",ib.getStartDate(),"   ");
 		}
 		if(ib.getEndDate()!=null)str=StringUtils.join(str,i++,"-结束时间:",ib.getEndDate(),"   ");
+		if (ib.getProvinceName()!=null)str=StringUtils.join(str,i++,"-省份:",ib.getProvinceName(),"   ");
 		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.getProjectStatusName(),"   ");