Parcourir la source

我的项目、外包项目列表新增筛选与统计

anderx il y a 1 an
Parent
commit
9579140520

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

@@ -597,7 +597,7 @@
     <include refid="selectExpenseAccountSql"/>
     <include refid="selectExpenseAccountSql"/>
   </select>
   </select>
 
 
-  <select id="selectExpenseAccountTotalAmount" resultType="java.math.BigDecimal">
+  <select id="selectExpenseAccountTotalAmount" resultType="java.util.Map">
     select sum(a.amount) totalAmount
     select sum(a.amount) totalAmount
     from expense_account a
     from expense_account a
     <if test="type !=null">
     <if test="type !=null">
@@ -996,7 +996,7 @@
     where 1=1
     where 1=1
     <include refid="ExpenseDetailsSql"/>
     <include refid="ExpenseDetailsSql"/>
   </select>
   </select>
-  <select id="ExpenseDetailsTotalAmount" resultType="java.math.BigDecimal">
+  <select id="ExpenseDetailsTotalAmount" resultType="java.util.Map">
     select sum(ead.amount) totalAmount
     select sum(ead.amount) totalAmount
     from expense_account_details  ead left join expense_account a on ead.eaid =a.id
     from expense_account_details  ead left join expense_account a on ead.eaid =a.id
     left join expense_relationship er on a.id=er.ea_id  left join expense_account mea on  er.id=mea.id
     left join expense_relationship er on a.id=er.ea_id  left join expense_account mea on  er.id=mea.id

+ 26 - 57
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1087,6 +1087,13 @@
     on a.id=l.tid  left join t_task_mid ttm  on a.id=ttm.tid left join t_task_member tmer on a.id=tmer.tid
     on a.id=l.tid  left join t_task_mid ttm  on a.id=ttm.tid left join t_task_member tmer on a.id=tmer.tid
     where  e.delete_sign in (0,2,3)  and e.order_status in (2,4)
     where  e.delete_sign in (0,2,3)  and e.order_status in (2,4)
     and a.outsource= #{outsource,jdbcType=INTEGER}
     and a.outsource= #{outsource,jdbcType=INTEGER}
+    <include refid="selectOrderTaskListSql"/>
+    order by a.task_distribution_time desc
+    <if test="page_sql!=null">
+      ${page_sql}
+    </if>
+  </select>
+  <sql id="selectOrderTaskListSql">
     <if test="role == 0 ">
     <if test="role == 0 ">
       and a.task_receiver= #{aid,jdbcType=VARCHAR}
       and a.task_receiver= #{aid,jdbcType=VARCHAR}
     </if>
     </if>
@@ -1132,6 +1139,9 @@
     <if test="name != null">
     <if test="name != null">
       and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
       and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
     </if>
     </if>
+    <if test="projectName != null">
+      and a.commodity_name like CONCAT('%',#{projectName,jdbcType=VARCHAR},'%')
+    </if>
     <if test="taskId != null">
     <if test="taskId != null">
       and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
       and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
     </if>
     </if>
@@ -1144,11 +1154,7 @@
     <if test="startTime != null and endTime != null">
     <if test="startTime != null and endTime != null">
       and e.sign_time between #{startTime} and #{endTime}
       and e.sign_time between #{startTime} and #{endTime}
     </if>
     </if>
-    order by a.task_distribution_time desc
-    <if test="page_sql!=null">
-      ${page_sql}
-    </if>
-  </select>
+  </sql>
 
 
   <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
   <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
     select  count(*) from t_order_task a
     select  count(*) from t_order_task a
@@ -1165,63 +1171,26 @@
     </if>
     </if>
     where e.delete_sign in (0,2,3)  and e.order_status in (2,4)
     where e.delete_sign in (0,2,3)  and e.order_status in (2,4)
     and a.outsource= #{outsource,jdbcType=INTEGER}
     and a.outsource= #{outsource,jdbcType=INTEGER}
-    <if test="role == 0 ">
-      and a.task_receiver= #{aid,jdbcType=VARCHAR}
-    </if>
-    <if test="role ==1 and fids != null and fids.size() &gt; 0">
-      and e.finance_id in
-      <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
-        #{item}
-      </foreach>
-    </if>
-    <if test="specially == 0 ">
-      and a.split_status in (0,2)
-    </if>
-    <if test="orderNo != null">
-      and a.order_no= #{orderNo,jdbcType=VARCHAR}
-    </if>
-    <if test="approval ==0">
-      and e.approval = 0
-    </if>
-    <if test="approval ==1">
-      and e.approval in(1,2)
-    </if>
-    <if test="approval ==2">
-      and e.approval in (4,5)
-    </if>
+    <include refid="selectOrderTaskListSql"/>
+  </select>
+
+  <select id="selectOrderTaskListSum"  resultType="java.util.Map">
+    select  sum(a.commodity_price) totalAmount,sum(a.commodity_quantity)totalNumber
+    from t_order_task a
+    left join t_order_new e on a.order_no=e.order_no
     <if test="cid != null">
     <if test="cid != null">
-      and c.id = #{cid}
-    </if>
-    <if test="outsourceStatus !=null">
-      and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
-    </if>
-    <if test="contractNo != null">
-      and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
-    </if>
-    <if test="projectStatus != null">
-      and a.project_status = #{projectStatus,jdbcType=INTEGER}
-    </if>
-    <if test="deps != null">
-      and e.order_dep in
-      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
-        #{depId}
-      </foreach>
+      left join business_project b on a.commodity_id=b.id
+      left join business_category c on b.cid=c.id
     </if>
     </if>
     <if test="name != null">
     <if test="name != null">
-      and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-    </if>
-    <if test="taskId != null">
-      and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
-    </if>
-    <if test="taskStatus != null">
-      and a.task_status= #{taskStatus,jdbcType=INTEGER}
-    </if>
-    <if test="adminName != null">
-      and a.receiver_name  like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
+      left join user f on e.buyer_id=f.id
     </if>
     </if>
-    <if test="startTime != null and endTime != null">
-      and e.sign_time between #{startTime} and #{endTime}
+    <if test="outsourceStatus !=null">
+      left join t_order_outsource l on a.id=l.tid
     </if>
     </if>
+    where e.delete_sign in (0,2,3)  and e.order_status in (2,4)
+    and a.outsource= #{outsource,jdbcType=INTEGER}
+    <include refid="selectOrderTaskListSql"/>
   </select>
   </select>
   <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
   <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
     select
     select

+ 14 - 4
src/main/java/com/goafanti/core/mybatis/BaseMybatisDao.java

@@ -224,12 +224,22 @@ public class BaseMybatisDao<T> extends SqlSessionDaoSupport {
 		} catch (InvocationTargetException e) {
 		} catch (InvocationTargetException e) {
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}
-		Object o = this.getSqlSession().selectOne(coutnAoumt, params);
-		if (o==null){
+		Map<String,Object> map= this.getSqlSession().selectOne(coutnAoumt, params);
+		if (map==null){
 			res.setTotalAmount(new BigDecimal(0));
 			res.setTotalAmount(new BigDecimal(0));
 		}else {
 		}else {
-			BigDecimal totalAmount = new BigDecimal(o.toString());
-			res.setTotalAmount(totalAmount);
+			Object totalAmount = map.get("totalAmount");
+			if (totalAmount==null){
+				res.setTotalAmount(new BigDecimal(0));
+			}else {
+				res.setTotalAmount(new BigDecimal(totalAmount.toString()));
+			}
+			Object totalNumber = map.get("totalNumber");
+			if (totalNumber==null){
+				res.setTotalNumber(null);
+			}else {
+				res.setTotalNumber(Integer.valueOf(totalNumber.toString()));
+			}
 		}
 		}
 		return res;
 		return res;
 	}
 	}

+ 9 - 0
src/main/java/com/goafanti/core/mybatis/page/PagintionPlus.java

@@ -5,6 +5,15 @@ import java.math.BigDecimal;
 public class PagintionPlus<T> extends Pagination{
 public class PagintionPlus<T> extends Pagination{
 
 
     private BigDecimal totalAmount;
     private BigDecimal totalAmount;
+    private Integer totalNumber;
+
+    public Integer getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setTotalNumber(Integer totalNumber) {
+        this.totalNumber = totalNumber;
+    }
 
 
     public BigDecimal getTotalAmount() {
     public BigDecimal getTotalAmount() {
         return totalAmount;
         return totalAmount;

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

@@ -2,6 +2,7 @@ package com.goafanti.order.bo;
 
 
 public class inuptTaskListBo {
 public class inuptTaskListBo {
 	private String name;
 	private String name;
+	private String projectName;
 	private String orderNo;
 	private String orderNo;
 	private String taskId;
 	private String taskId;
 	private Integer taskStatus;
 	private Integer taskStatus;
@@ -19,6 +20,14 @@ public class inuptTaskListBo {
 	private Integer pageNo;
 	private Integer pageNo;
 	private Integer pageSize;
 	private Integer pageSize;
 
 
+	public String getProjectName() {
+		return projectName;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+
 	public String getCid() {
 	public String getCid() {
 		return cid;
 		return cid;
 	}
 	}

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

@@ -386,6 +386,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		params.put("outsource", ib.getOutsource()==null?0:ib.getOutsource());
 		params.put("outsource", ib.getOutsource()==null?0:ib.getOutsource());
 		if (null!=ib.getSpecially()) params.put("specially", ib.getSpecially());
 		if (null!=ib.getSpecially()) params.put("specially", ib.getSpecially());
 		if (StringUtils.isNotBlank(ib.getName())) params.put("name", ib.getName());
 		if (StringUtils.isNotBlank(ib.getName())) params.put("name", ib.getName());
+		if (StringUtils.isNotBlank(ib.getProjectName())) params.put("projectName", ib.getProjectName());
 		if (StringUtils.isNotBlank(ib.getDeps())) params.put("deps", departmentService.parseArray(ib.getDeps()));
 		if (StringUtils.isNotBlank(ib.getDeps())) params.put("deps", departmentService.parseArray(ib.getDeps()));
 		if (StringUtils.isNotBlank(ib.getOrderNo())) params.put("orderNo", ib.getOrderNo());
 		if (StringUtils.isNotBlank(ib.getOrderNo())) params.put("orderNo", ib.getOrderNo());
 		if (StringUtils.isNotBlank(ib.getContractNo())) params.put("contractNo", ib.getContractNo());
 		if (StringUtils.isNotBlank(ib.getContractNo())) params.put("contractNo", ib.getContractNo());
@@ -415,7 +416,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			 fids.add(TokenManager.getAdminId());
 			 fids.add(TokenManager.getAdminId());
 			 params.put("fids",fids);
 			 params.put("fids",fids);
 		}
 		}
-		Pagination<TOrderTaskListBo> p = (Pagination<TOrderTaskListBo>)findPage("selectOrderTaskListByPage", "selectOrderTaskListCount", params, ib.getPageNo(), ib.getPageSize());
+		Pagination<TOrderTaskListBo> p = (Pagination<TOrderTaskListBo>)findPagePlus("selectOrderTaskListByPage", "selectOrderTaskListCount",
+				"selectOrderTaskListSum",
+				params, ib.getPageNo(), ib.getPageSize());
 		List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) p.getList();
 		List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) p.getList();
 		for (TOrderTaskListBo t : list) {
 		for (TOrderTaskListBo t : list) {
 			if(t.getSplitStatus()==1) {
 			if(t.getSplitStatus()==1) {