Browse Source

统计订单列表开发

anderx 3 years ago
parent
commit
135931080b

+ 34 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -873,6 +873,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     where order_no = #{_parameter,jdbcType=VARCHAR}
   </select>
 
+
   <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
   	select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.delete_sign deleteSign,
   	a.contract_no as contractNo, b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
@@ -1639,4 +1640,37 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     order by y.counts
     </if>
   </select>
+
+  <select id="selectstatisticsOrderListPage" resultType="com.goafanti.order.bo.TOrderNewBo">
+    select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.delete_sign deleteSign,
+           a.contract_no as contractNo, b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
+           a.order_status as orderStatus, a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,c.project_type projectType,
+           dep.name as depName,c.finance_name as financeName,c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount,
+           a.sales_type salesType, a.channel_id channelId ,a.other
+    from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
+                        left join department dep on a.order_dep=dep.id
+    where a.delete_sign in(0,2) and a.process_status >4
+      <if test="province !=null ">
+      and dep.province = #{province}
+      </if>
+    <if test="salesType !=null ">
+      and a.sales_type = #{salesType}
+    </if>
+    order by a.create_time desc
+    <if test="page_sql!=null">
+      ${page_sql}
+    </if>
+  </select>
+  <select id="selectstatisticsOrderListCount" resultType="integer">
+    select count(*)
+    from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
+    left join department dep on a.order_dep=dep.id
+    where a.delete_sign in(0,2) and a.process_status >4
+    <if test="province !=null ">
+      and dep.province = #{province}
+    </if>
+    <if test="salesType !=null ">
+      and a.sales_type = #{salesType}
+    </if>
+  </select>
 </mapper>

+ 40 - 0
src/main/java/com/goafanti/order/bo/InputStatisticsOrderList.java

@@ -0,0 +1,40 @@
+package com.goafanti.order.bo;
+
+public class InputStatisticsOrderList {
+    private Integer province;
+    private Integer salesType;
+    private Integer pageNo;
+    private Integer pageSize;
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public Integer getSalesType() {
+        return salesType;
+    }
+
+    public void setSalesType(Integer salesType) {
+        this.salesType = salesType;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+}

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

@@ -294,6 +294,13 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 
+	@RequestMapping(value="/statistics/orderList", method = RequestMethod.GET)
+	public Result orderNewList(InputStatisticsOrderList in ){
+		Result res=new Result();
+		res.data(orderNewService.statisticsOrderList(in));
+		return res;
+	}
+
 
 	/**
 	 * 订单审核

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

@@ -207,4 +207,6 @@ public interface OrderNewService {
 	 * @param projectType 项目类型 判断是否是会员
 	 */
 	void addNotic(Integer type, AdminListBo a, TOrderNewBo b);
+
+	Pagination<TOrderNewBo> statisticsOrderList(InputStatisticsOrderList in);
 }

+ 13 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -592,6 +592,17 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		return p;
 	}
 
+
+	@Override
+	public Pagination<TOrderNewBo> statisticsOrderList(InputStatisticsOrderList in) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if (in.getProvince()!=null)params.put("province",in.getProvince());
+		if (in.getSalesType()!=null)params.put("salesType",in.getSalesType());
+		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectstatisticsOrderListPage",
+				"selectstatisticsOrderListCount", params, in.getPageNo(), in.getPageSize());
+		return p;
+	}
+
 	@Override
 	public int updateOrderNew(String orderNo, Integer orderStatus,String reason,Integer outsource, TOrderOutsource o) {
 		TOrderNew t= new TOrderNew();
@@ -1170,6 +1181,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		asyncUtils.addNotice(n);
 	}
 
+
+
 	public void  sendEmail(String dunId,AdminListBo a,TOrderNewBo b){
 		LoggerUtils.debug(logger, "======================邮件信息发送===================");
 		String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + b.getOrderNo() + "</div><div>合同编号: " + b.getContractNo() + "</div>";

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

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20