2 コミット 804f57f0aa ... d2158b04f2

作者 SHA1 メッセージ 日付
  hanwenjie d2158b04f2 Merge remote-tracking branch 'origin/master' 3 年 前
  hanwenjie 3418c719f1 汇总导出bug fix 3 年 前

+ 1 - 1
code/sapparent/sapcms/src/main/java/org/fouram/controller/ApiController.java

@@ -345,7 +345,7 @@ public class ApiController extends BaseController {
 		// 汇总
 		String hzFilePath = "/public/excel/userReport" + DateUtil.getTimeStamp() + ".xlsx";
 		List<Map<String, Object>> hzList = sapCheckReportService.selectReportDayList(dto.getStartDate(),
-				dto.getEndDate(), dto.getDepartId(), dto.getName());
+				dto.getEndDate(), dto.getDepartId(), dto.getDepartIds(), dto.getName());
 		ExcelExportUtil.exportExcelFile(getRootPath() + ysFilePath, hzList, getRootPath() + hzFilePath, 0, 0);
 		ysFilePath = hzFilePath;
 		// 明细

+ 6 - 0
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckReportMapper.xml

@@ -13,6 +13,12 @@
 			<if test="departId != null and departId != ''">
 				and (c.firstDepartId=#{departId} or c.secondDepartId=#{departId})
 			</if>
+			<if test="departIds != null and departIds.size() > 0">
+				and c.firstDepartId in
+				<foreach collection="departIds" item="depId" separator="," open="(" close=")">
+					#{depId}
+				</foreach>
+			</if>
 			group by c.firstDepartName,c.secondDepartName, c.userId, c.name
 			union all
 			SELECT c.firstDepartName,c.secondDepartName, c.userId, c.name, '备注信息' as type, ${reportDayRemarkSql}

+ 6 - 5
code/sapparent/sapservice/src/main/java/org/fouram/service/SapCheckReportService.java

@@ -55,15 +55,16 @@ public class SapCheckReportService extends BaseService {
 		return (List<Map<String, Object>>) findList("SapCheckReportMapper.findUserReports", pd);
 	}
 
-	public List<Map<String, Object>> selectReportDayList(String startDate, String endDate, String departId, String name)
+	public List<Map<String, Object>> selectReportDayList(String startDate, String endDate, String departId,List<Long> departIds, String name)
 			throws Exception {
 		if (StringUtils.isNotBlank(departId) && departId.endsWith(",")) {
 			departId = departId.substring(0, departId.length() - 1);
 		}
-		Map<String, String> pd = Maps.newHashMap();
+		Map<String, Object> pd = Maps.newHashMap();
 		pd.put("startDate", startDate);
 		pd.put("endDate", endDate);
-		pd.put("departId", departId);
+//		pd.put("departId", departId);
+		pd.put("departIds",departIds);
 		pd.put("name", name);
 
 		List<String> days = DateUtil.getSubDateList(startDate, endDate);
@@ -99,7 +100,7 @@ public class SapCheckReportService extends BaseService {
 	}
 
 	@SuppressWarnings("unchecked")
-	private List<Map<String, Object>> getReportDayResult(Map<String, String> param, List<String> subDays)
+	private List<Map<String, Object>> getReportDayResult(Map<String, Object> param, List<String> subDays)
 			throws Exception {
 		param.put("reportDaySql", getReportDaySql(subDays));
 		param.put("reportDayRemarkSql", getReportRemarkDaySql(subDays));
@@ -152,4 +153,4 @@ public class SapCheckReportService extends BaseService {
 		pd.put("state", state);
 		return (Long) findObject("SapCheckReportMapper.findUserReportTotal", pd);
 	}
-}
+}