Browse Source

统计BUG修复

anderx 3 years ago
parent
commit
737c4ec78a

+ 2 - 2
src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java

@@ -2,7 +2,7 @@ package com.goafanti.weChat.bo;
 
 import com.goafanti.common.utils.excel.Excel;
 
-public class OutPublicDtails {
+public class OutPublicDtails  {
 
 	private Integer id;
 	@Excel(name = "客户名称")
@@ -31,7 +31,7 @@ public class OutPublicDtails {
 	private String clockInTimes;
 	@Excel(name = "创建时间" )
 	private String createTimes;
-	@Excel(name = "公出类型",readConverterExp = "0=业务,1=技术,2=行政",width = 8)
+	@Excel(name = "公出类型",readConverterExp = "0=业务公出,1=技术公出,2=行政公出,3=技术协单",width = 8)
 	private Integer type;
 	@Excel(name = "公出目标" )
 	private String remarks;

+ 129 - 0
src/main/java/com/goafanti/weChat/bo/OutPublicDtailsFinance.java

@@ -0,0 +1,129 @@
+package com.goafanti.weChat.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+/**
+ * 财务导出公出列表
+ */
+public class OutPublicDtailsFinance {
+
+	private Integer id;
+	@Excel(name = "公出类型",readConverterExp = "0=业务公出,1=技术公出,2=行政公出,3=技术协单",width = 8)
+	private Integer type;
+	@Excel(name = "客户名称")
+	private String nickname;
+	@Excel(name = "公出地点")
+	private String userName;
+	@Excel(name = "跟单人")
+	private String sname;
+	@Excel(name = "公出人")
+	private String aname;
+	@Excel(name = "公出开始时间")
+	private String releaseStarts;
+	@Excel(name = "公出结束时间")
+	private String releaseEnds;
+	@Excel(name = "公出时长",width = 8)
+	private String duration;
+	@Excel(name = "打卡状态",readConverterExp = "0=未打卡,1=已打卡",width = 8)
+	private Integer clockIn;
+	@Excel(name = "审核状态" ,readConverterExp = "0=驳回,1=待审核,2=同意,3=撤销",width = 8)
+	private Integer status;
+	@Excel(name = "审核信息" )
+	private String auditInfo;
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public String getNickname() {
+		return nickname;
+	}
+
+	public void setNickname(String nickname) {
+		this.nickname = nickname;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public String getSname() {
+		return sname;
+	}
+
+	public void setSname(String sname) {
+		this.sname = sname;
+	}
+
+	public String getAname() {
+		return aname;
+	}
+
+	public void setAname(String aname) {
+		this.aname = aname;
+	}
+
+	public String getReleaseStarts() {
+		return releaseStarts;
+	}
+
+	public void setReleaseStarts(String releaseStarts) {
+		this.releaseStarts = releaseStarts;
+	}
+
+	public String getReleaseEnds() {
+		return releaseEnds;
+	}
+
+	public void setReleaseEnds(String releaseEnds) {
+		this.releaseEnds = releaseEnds;
+	}
+
+	public String getDuration() {
+		return duration;
+	}
+
+	public void setDuration(String duration) {
+		this.duration = duration;
+	}
+
+	public Integer getClockIn() {
+		return clockIn;
+	}
+
+	public void setClockIn(Integer clockIn) {
+		this.clockIn = clockIn;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getAuditInfo() {
+		return auditInfo;
+	}
+
+	public void setAuditInfo(String auditInfo) {
+		this.auditInfo = auditInfo;
+	}
+}

+ 29 - 10
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -1,12 +1,17 @@
 package com.goafanti.weChat.controller;
 
 
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.goafanti.common.error.BusinessException;
+import com.goafanti.weChat.bo.*;
+import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -17,12 +22,6 @@ import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
-import com.goafanti.weChat.bo.InputPublicDtails;
-import com.goafanti.weChat.bo.InputPublicRelease;
-import com.goafanti.weChat.bo.InputPublicReleaseList;
-import com.goafanti.weChat.bo.InputPublicStatistics;
-import com.goafanti.weChat.bo.OutPublicDtails;
-import com.goafanti.weChat.bo.OutPublicStatistics;
 import com.goafanti.weChat.service.PublicReleaseService;
 
 @RestController
@@ -202,10 +201,30 @@ public class AdminReleaseApiController extends CertifyApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/publicReleaseDtails/export", method = RequestMethod.GET)
-	public Result publicReleaseListDtailsExport(InputPublicDtails in ){
-		List<OutPublicDtails> list=publicReleaseService.publicReleaseListDtailsList(in);
-		NewExcelUtil<OutPublicDtails>excel=new NewExcelUtil<>(OutPublicDtails.class);
- 		 return  excel.exportExcel(list,"公出详细列表",uploadPath);
+	public Result publicReleaseListDtailsExport(InputPublicDtails in ,Integer exportType){
+		if (exportType==null)exportType=0;
+		List<OutPublicDtails> outList=publicReleaseService.publicReleaseListDtailsList(in);
+		if (exportType==0){
+			List<OutPublicDtails> list=outList;
+			NewExcelUtil<OutPublicDtails>excel=new NewExcelUtil<>(OutPublicDtails.class);
+			return  excel.exportExcel(list,"公出详细列表",uploadPath);
+		}else if (exportType==1){
+			List<OutPublicDtailsFinance> list = new ArrayList<>();
+			for (OutPublicDtails outPublicDtails : outList) {
+				OutPublicDtailsFinance of= new OutPublicDtailsFinance();
+				try {
+					BeanUtils.copyProperties( of,outPublicDtails);
+				} catch (Exception e) {
+					throw new BusinessException("数据转换异常");
+				}
+				list.add(of);
+			}
+			NewExcelUtil<OutPublicDtailsFinance>excel=new NewExcelUtil<>(OutPublicDtailsFinance.class);
+			return  excel.exportExcel(list,"公出详细列表",uploadPath);
+		}
+
+
+		return null;
 	}
 
 	/** 上传图片 **/

+ 1 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -304,6 +304,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					use.setMainId(null);
 					use.setClockIn(null);
 					use.setClockInTime(null);
+					use.setType(null);
 					use.setAssist(2);
 					use.setStatus(status);
 					publicReleaseMapper.updateByPrimaryKeySelective(use);