Преглед на файлове

财务订单特批相关修改

anderx преди 1 година
родител
ревизия
b733493f40

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

@@ -1908,12 +1908,28 @@
     select a.id,a.task_distribution_time taskDistributionTime ,tm.province_name  provinceName,tm.dep_name depName,
     tm.salesman_name salesmanName, b.contract_no contractNo ,b.order_no orderNo,tm.buyer_name UserName,a.cname ,
     a.commodity_name commodityName,a.commodity_quantity commodityQuantity,dep.name techDepName,a.receiver_name techName,
-    a.project_status projectStatus ,a.commodity_price commodityPrice ,a.special_comment specialComment
+    a.project_status projectStatus ,a.commodity_price commodityPrice ,a.special_comment specialComment,
+    b.approval,toa.type,toa.type_explain typeExplain
     from  (select task_id from t_task_log a where task_receiver=#{aid}
     UNION select task_id from t_task_log a where task_allocator=#{aid}) x
     left join t_order_task a  on x.task_id=a.id left join t_order_new b on a.order_no =b.order_no
     left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
     left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
+    <if test="type !=null">
+      inner join
+    </if>
+    <if test="type ==null">
+      left join
+    </if>
+    (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
+    from t_order_approval
+    <if test="type !=null">
+      where `type` in
+      <foreach collection="type" item="item" separator="," open="(" close=")">
+        #{item}
+      </foreach>
+    </if>
+    group by order_no) toa on b.order_no=toa.order_no
     where 1=1
     <if test="orderNo !=null">
       and a.order_no = #{orderNo}
@@ -1960,6 +1976,16 @@
     left join t_order_task a  on x.task_id=a.id left join t_order_new b on a.order_no =b.order_no
     left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
     left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
+    <if test="type !=null">
+      inner join
+      (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
+      from t_order_approval
+      where `type` in
+      <foreach collection="type" item="item" separator="," open="(" close=")">
+        #{item}
+      </foreach>
+      group by order_no) toa on o.order_no=toa.order_no
+    </if>
     where 1=1
     <if test="orderNo !=null">
       and a.order_no = #{orderNo}

+ 6 - 4
src/main/java/com/goafanti/order/bo/TOrderTaskListBo.java

@@ -48,7 +48,11 @@ public class TOrderTaskListBo {
 	@Excel(name = "派单日期")
 	private String creteTime;
 	private Integer alreadyNumber;
+	@Excel(name = "特批",readConverterExp = "0=非特批,1=特批待审核,2=特批通过,3=特批驳回,4=董事长特批待审核,5=董事长特批通过,6董事长特批驳回")
 	private Integer approval;
+	@Excel(name="特批类型")
+	private String type;
+	private String typeExplain;
 	/** 外包部门 */
 	private String outsourceName;
 	private Integer outsourceStatus;
@@ -100,14 +104,12 @@ public class TOrderTaskListBo {
 
 	private String receiverMobile;
 
-	private Integer type;
-	private String typeExplain;
 
-	public Integer getType() {
+	public String getType() {
 		return type;
 	}
 
-	public void setType(Integer type) {
+	public void setType(String type) {
 		this.type = type;
 	}
 

+ 29 - 0
src/main/java/com/goafanti/order/bo/managerListBo.java

@@ -37,6 +37,35 @@ public class managerListBo {
 	private String commodityPrice;
 	@Excel(name = "特批说明")
 	private String specialComment;
+	@Excel(name = "特批",readConverterExp = "0=非特批,1=特批待审核,2=特批通过,3=特批驳回,4=董事长特批待审核,5=董事长特批通过,6董事长特批驳回")
+	private Integer approval;
+	@Excel(name = "特批类型")
+	private String type;
+	private String typeExplain;
+
+	public Integer getApproval() {
+		return approval;
+	}
+
+	public void setApproval(Integer approval) {
+		this.approval = approval;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getTypeExplain() {
+		return typeExplain;
+	}
+
+	public void setTypeExplain(String typeExplain) {
+		this.typeExplain = typeExplain;
+	}
 
 	public String getProjectStatusName() {
 		return projectStatusName;

+ 28 - 0
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -13,6 +13,7 @@ import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.*;
+import com.goafanti.order.enums.ApprovalTypeEnums;
 import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OrderProjectService;
 import org.springframework.beans.BeanUtils;
@@ -31,6 +32,7 @@ import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 @RestController
@@ -121,6 +123,18 @@ public class OrderProjectApiController extends CertifyApiController {
 		@SuppressWarnings("unchecked")
 		List<managerListBo> list=(List<managerListBo>) orderProjectService.managerSelect( name, orderNo, contractNo,
 				cid, projectType,thchId,depId, techDepId  , declarationBatch  ,commodityPrice,startTime, endTime ,type, pageNo, pageSize).getList();
+		list.forEach(e->{
+			if (e.getType()!=null){
+				String[] split = e.getType().split(",");
+				StringBuilder stringBuilder = new StringBuilder();
+				Arrays.stream(split).forEach(
+						s->{
+							stringBuilder.append(ApprovalTypeEnums.getDesc(s)).append(",");
+						}
+				);
+				e.setType(stringBuilder.substring(0,stringBuilder.length()-1));
+			}
+		});
 		NewExcelUtil<managerListBo> excel=new NewExcelUtil<>(managerListBo.class);
 		return excel.exportExcel(list, "企业项目查询列表", uploadPath);
 	}
@@ -366,6 +380,20 @@ public class OrderProjectApiController extends CertifyApiController {
 		String str="项目任务列表";
 		@SuppressWarnings("unchecked")
 		List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.orderTaskList(ib).getList();
+		list.forEach(e->{
+				if(e.getType()!=null) {
+					String[] split = e.getType().split(",");
+					StringBuilder stringBuilder = new StringBuilder();
+					Arrays.stream(split).forEach(
+							s->{
+								stringBuilder.append(ApprovalTypeEnums.getDesc(s)).append(",");
+							}
+					);
+					e.setType(stringBuilder.substring(0,stringBuilder.length()-1));
+				}
+			}
+
+		);
 		NewExcelUtil<TOrderTaskListBo>excel=new NewExcelUtil<>(TOrderTaskListBo.class);
 		return excel.exportExcel(list, str, response);
 		}

+ 4 - 0
src/main/java/com/goafanti/order/enums/ApprovalTypeEnums.java

@@ -44,6 +44,10 @@ public enum ApprovalTypeEnums {
         return QT.getDesc();
     }
 
+    public static String getDesc(String code) {
+        return getDesc(Integer.valueOf(code));
+    }
+
     public static boolean containsType(Integer code) {
         return status.containsKey(code);
     }