This commit is contained in:
2025-10-31 11:14:34 +08:00
parent 568617910e
commit cdd58734fd
2 changed files with 37 additions and 25 deletions
@@ -103,15 +103,28 @@ public class ActivityStatisticsController {
if (Lang.isNotEmpty(asList)) {
for (NutMap map : asList) {
map.setv("activityTypeName", nutMap.getString("activityTypeName"));
List<String> hostUnitIds = map.getAsList("hostUnitIds", String.class);
List<String> undertakeUnitIds = map.getAsList("undertakeUnitIds", String.class);
if (Lang.isNotEmpty(hostUnitIds)) {
String hostUnitNames = getUnitNames(hostUnitIds, unitList);
map.setv("hostUnitNames", hostUnitNames);
}
if (Lang.isNotEmpty(undertakeUnitIds)) {
String undertakeUnitNames = getUnitNames(undertakeUnitIds, unitList);
map.setv("undertakeUnitNames", undertakeUnitNames);
if (nutMap.getString("activityType").equals("trainSignUp")){
List<String> hostUnitIds = map.getAsList("hostUnits", String.class);
List<String> undertakeUnitIds = map.getAsList("helpUnits", String.class);
if (Lang.isNotEmpty(hostUnitIds)) {
String hostUnitNames = getUnitNames(hostUnitIds, unitList);
map.setv("hostUnitNames", hostUnitNames);
}
if (Lang.isNotEmpty(undertakeUnitIds)) {
String undertakeUnitNames = getUnitNames(undertakeUnitIds, unitList);
map.setv("undertakeUnitNames", undertakeUnitNames);
}
}else{
List<String> hostUnitIds = map.getAsList("hostUnitIds", String.class);
List<String> undertakeUnitIds = map.getAsList("undertakeUnitIds", String.class);
if (Lang.isNotEmpty(hostUnitIds)) {
String hostUnitNames = getUnitNames(hostUnitIds, unitList);
map.setv("hostUnitNames", hostUnitNames);
}
if (Lang.isNotEmpty(undertakeUnitIds)) {
String undertakeUnitNames = getUnitNames(undertakeUnitIds, unitList);
map.setv("undertakeUnitNames", undertakeUnitNames);
}
}
if (nutMap.getString("activityType").equals("culture")) {
@@ -184,19 +197,28 @@ public class ActivityStatisticsController {
map.setv("count", activityList.size());
map.setv("activityList", activityList);
} else {
if (StrUtil.isNotBlank(undertakeUnitId)) {
cnd.and(new Static("JSON_CONTAINS(undertakeUnitIds, JSON_ARRAY('%s'))".formatted(undertakeUnitId)));
}
if (StrUtil.isNotBlank(hostUnitId)) {
cnd.and(new Static("JSON_CONTAINS(hostUnitIds, JSON_ARRAY('%s'))".formatted(hostUnitId)));
if (map.getString("activityType").equals("trainSignUp")){
if (StrUtil.isNotBlank(undertakeUnitId)) {
cnd.and(new Static("JSON_CONTAINS(helpUnits, JSON_ARRAY('%s'))".formatted(undertakeUnitId)));
}
if (StrUtil.isNotBlank(hostUnitId)) {
cnd.and(new Static("JSON_CONTAINS(hostUnits, JSON_ARRAY('%s'))".formatted(hostUnitId)));
}
}else{
if (StrUtil.isNotBlank(undertakeUnitId)) {
cnd.and(new Static("JSON_CONTAINS(undertakeUnitIds, JSON_ARRAY('%s'))".formatted(undertakeUnitId)));
}
if (StrUtil.isNotBlank(hostUnitId)) {
cnd.and(new Static("JSON_CONTAINS(hostUnitIds, JSON_ARRAY('%s'))".formatted(hostUnitId)));
}
}
if (map.getString("activityType").equals("culture")) {
cnd.andEX("YEAR(startTime)", "=", year);
cnd.asc("startTime");
List<ActivityTissue> activityList = dao.query(ActivityTissue.class, cnd);
map.setv("count", activityList.size());
map.setv("activityList", activityList);
} else if (map.getString("activityType").equals("trainSignUp")) {
cnd.andEX("year", "=", year);
cnd.asc("activitySignUpStartTime");
@@ -100,16 +100,6 @@ public class TrainSignUpActivity extends BaseModel implements Serializable, SysH
@ColDefine(type = ColType.VARCHAR, width = 40)
private String activityGroupName;
@Column
@Comment("主办单位")
@ColDefine(type = ColType.MYSQL_JSON)
private List<String> hostUnitIds;
@Column
@Comment("承办单位")
@ColDefine(type = ColType.MYSQL_JSON)
private List<String> undertakeUnitIds;
/**
* 所有的培训班
*/