Просмотр исходного кода

新增订单项目数据统计导出

anderx 1 год назад
Родитель
Сommit
62c4c3679d

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

@@ -2520,8 +2520,10 @@
            e2.service_life as serviceLife,e2.year_sum as yearSum,e.task_distribution_time as taskDistributionTime ,e.commodity_quantity as commodityQuantity,
            e3.cost_amount as costAmount,e.project_status as  projectStatus,e.task_start_time as taskStartTime,e.task_end_time as taskEndTime,
            e.receiver_name as receiverName ,'技术组',t1.cb,a.order_status orderStatus,e.satisfaction_degree satisfactionDegree,
-      e.task_comment taskComment,'核算比例',a.order_status orderStatus,t1.counts,t1.tdtk
+      e.task_comment taskComment,'核算比例',a.order_status orderStatus,t1.counts,t1.tdtk,a3.name depName,a4.name province
     from t_order_new a left join t_order_mid b on a.order_no =b.order_no
+        left join admin a2 on a.salesman_id=a2.id left join department a3 on a2.department_id=a3.id
+        left join district_glossory a4 on a3.province=a4.id
                        left join t_order_task c on a.order_no =c.order_no and c.main =1
                        left join business_project d on c.commodity_id =d.id left join business_category d2 on d.cid =d2.id
                        left join t_order_task e on a.order_no =e.order_no and e.split_status in (0,2)

+ 14 - 15
src/main/java/com/goafanti/order/bo/OutOrderProject.java

@@ -3,7 +3,6 @@ package com.goafanti.order.bo;
 import com.goafanti.common.utils.excel.Excel;
 
 import java.math.BigDecimal;
-import java.util.Date;
 
 public class OutOrderProject {
 
@@ -41,7 +40,7 @@ public class OutOrderProject {
     /**
      * 大客户
      */
-    @Excel(name = "大客户")
+    @Excel(name = "大客户",readConverterExp = "0=否,1=是")
     private Integer bigUser;
     /**
      * 是否特批 0-非特批 ,1-负责人审核,2-负责人通过,3-负责人驳回 4董事长待审核 5董事长通过 6董事长驳回
@@ -52,12 +51,12 @@ public class OutOrderProject {
      * 签单时间
      */
     @Excel(name = "签单时间")
-    private Date signTime;
+    private String signTime;
     /**
      * 派单时间
      */
-    @Excel(name = "营销负责人")
-    private String 派单时间;
+    @Excel(name = "派单时间")
+    private String createTime;
     /**
      * 公司名称
      */
@@ -158,7 +157,7 @@ public class OutOrderProject {
      * 订单类型 0认证项目 1科技项目 2 两化融化管理体系认证项目
      */
     @Excel(name = "是否科技项目")
-    private Integer orderType;
+    private String orderType;
     @Excel(name = "项目数")
     private String commodityQuantity;
     @Excel(name = "项目成本")
@@ -179,7 +178,7 @@ public class OutOrderProject {
     private String taskComment;
     @Excel(name = "核算比例")
     private String hsbl;
-    @Excel(name = "订单情况")
+    @Excel(name = "订单情况",readConverterExp = "0=待签单,1=签单待审,2=签单审核通过,3=签单审核拒绝,4=已结项,5=已驳回,6=已退单")
     private String orderStatus;
     @Excel(name = "变更情况")
     private String counts;
@@ -250,20 +249,20 @@ public class OutOrderProject {
         this.approval = approval;
     }
 
-    public Date getSignTime() {
+    public String getSignTime() {
         return signTime;
     }
 
-    public void setSignTime(Date signTime) {
+    public void setSignTime(String signTime) {
         this.signTime = signTime;
     }
 
-    public String get派单时间() {
-        return 派单时间;
+    public String getCreateTime() {
+        return createTime;
     }
 
-    public void set派单时间(String 派单时间) {
-        this.派单时间 = 派单时间;
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
     }
 
     public String getBuyerName() {
@@ -474,11 +473,11 @@ public class OutOrderProject {
         this.cb = cb;
     }
 
-    public Integer getOrderType() {
+    public String getOrderType() {
         return orderType;
     }
 
-    public void setOrderType(Integer orderType) {
+    public void setOrderType(String orderType) {
         this.orderType = orderType;
     }
 

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

@@ -7,6 +7,7 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.order.bo.*;
+import com.goafanti.order.enums.NewProjectStatus;
 import com.goafanti.order.service.UserStaticticsService;
 import groovy.util.logging.Log4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -102,6 +103,8 @@ public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> imp
 			//是否是大客户
 			if (e.getTotalAmount().compareTo(new BigDecimal(10)) >= 0){
 				e.setBigUser(1);
+			}else {
+				e.setBigUser(0);
 			}
 			//计算比例
 			BigDecimal orderReceivables=BigDecimal.ZERO;
@@ -113,7 +116,25 @@ public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> imp
 				BigDecimal multiply = divide.multiply(new BigDecimal(100));
 				e.setContractAmountProportion(multiply+"%");
 			}
-			System.out.println(e.getOrderReceivables()+" / "+e.getSettlementAmount()+"="+e.getContractAmountProportion());
+			if (e.getTdtk()!=null&&e.getTdtk().equals("1")){
+				e.setTdtk("有");
+			}else {
+				e.setTdtk("无");
+			}
+			if (e.getCb()!=null&&e.getCb().equals("1")){
+				e.setCb("有");
+			}else {
+				e.setCb("无");
+			}
+			if (e.getOrderType()!=null&&e.getOrderType().equals("1")){
+				e.setOrderType("有");
+			}else {
+				e.setOrderType("无");
+			}
+			if (e.getProjectStatus()!=null){
+				String valueByCode = NewProjectStatus.getValueByCode(Integer.valueOf(e.getProjectStatus()));
+				e.setProjectStatus(valueByCode);
+			}
 		}
 		return outOrderProject;
 	}