活动
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ public class ActivityUnionApplyUserController {
|
||||
cnd.andEx("tissue.type", "=", type);
|
||||
cnd.andEx("tissue.state", "=", 3);
|
||||
cnd.andEx("tissue.projectTypeCode", "!=", 50004);
|
||||
cnd.andEx("tissue.signUpMethod", "in", List.of(1, 2));
|
||||
cnd.andEx("tissue.signUpMethod", "in", List.of(1, 2, 3));
|
||||
|
||||
if (Strings.isNotBlank(name)) {
|
||||
cnd.where().andLike("tissue.name", name);
|
||||
|
||||
+43
-3
@@ -3,6 +3,7 @@ package io.v.nutz.zhgh.activity.controller.union;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||
@@ -36,6 +37,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -143,6 +145,41 @@ public class ActivityUnionManageController {
|
||||
return sysUserService.listPageMap(1, 30, sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
|
||||
public Object doSave(@Param(value = "tissue") ActivityTissue tissue){
|
||||
tissue.setUserId(StrUtil.isNotBlank(tissue.getUserId()) ? tissue.getUserId() : ShiroUtil.getUserId());
|
||||
tissue.setApplyTime(StrUtil.isNotBlank(tissue.getApplyTime()) ? tissue.getApplyTime() : DateUtil.getDate());
|
||||
tissue.setState(0);
|
||||
|
||||
if (tissue.getType() == 40002) {
|
||||
tissue.setUnionId(Vi.getUnionId());
|
||||
} else if (tissue.getType() == 40003) {
|
||||
tissue.setClubId(vi.getClubId());
|
||||
}
|
||||
// 如果有商品,则设置商品活动编码和活动id
|
||||
if (Lang.isNotEmpty(tissue.getGoods())) {
|
||||
tissue.getGoods().forEach(v -> {
|
||||
v.setActivityCode(tissue.getActivityCode());
|
||||
v.setReid(tissue.getId());
|
||||
});
|
||||
}
|
||||
|
||||
activityTissueService.insertWith(tissue, "tissuePersonList");
|
||||
activitySchoolService.dao().insert(tissue.getGoods());
|
||||
|
||||
if (tissue.getIsEnrollSystem()) {
|
||||
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
|
||||
activitySchoolService.dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校工会添加
|
||||
*
|
||||
@@ -154,12 +191,14 @@ public class ActivityUnionManageController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions(value = {"activity.union.info", "activity.club.info", "activity.school.info2"}, logical = Logical.OR)
|
||||
public Object doAdd(@Param(value = "tissue") ActivityTissue tissue) {
|
||||
tissue.setUserId(ShiroUtil.getUserId());
|
||||
tissue.setApplyTime(DateUtil.getDate());
|
||||
tissue.setUserId(StrUtil.isNotBlank(tissue.getUserId()) ? tissue.getUserId() : ShiroUtil.getUserId());
|
||||
tissue.setApplyTime(StrUtil.isNotBlank(tissue.getApplyTime()) ? tissue.getApplyTime() : DateUtil.getDate());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
tissue.setState(1);
|
||||
} else {
|
||||
tissue.setState(3);
|
||||
tissue.setIsDisabled(true);
|
||||
tissue.setIsEnrollSystem(true);
|
||||
}
|
||||
if (tissue.getType() == 40002) {
|
||||
tissue.setUnionId(Vi.getUnionId());
|
||||
@@ -170,13 +209,14 @@ public class ActivityUnionManageController {
|
||||
v.setActivityCode(tissue.getActivityCode());
|
||||
v.setReid(tissue.getId());
|
||||
});
|
||||
tissue.getCover();
|
||||
// tissue.getCover();
|
||||
|
||||
activityTissueService.insertWith(tissue, "tissuePersonList");
|
||||
activitySchoolService.dao().insert(tissue.getGoods());
|
||||
|
||||
if (tissue.getIsEnrollSystem()) {
|
||||
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
|
||||
sysHomeActivity.setEnable(true);
|
||||
activitySchoolService.dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -67,8 +68,12 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEx("YEAR(tissue.startTime)", "=", year);
|
||||
cnd.andEx("tissue.projectTypeCode", "!=", "50004");
|
||||
cnd.andEx("YEAR(tissue.applyTime)", "=", year);
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("tissue.projectTypeCode", "!=", "50004");
|
||||
seg.or("tissue.projectTypeCode", "is", null);
|
||||
cnd.and(seg);
|
||||
// cnd.andEx("tissue.projectTypeCode", "!=", "50004");
|
||||
cnd.andEx("tissue.unionId", "=", unionId);
|
||||
cnd.andEx("tissue.type", "=", type);
|
||||
|
||||
|
||||
+11
-7
@@ -240,9 +240,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
sysRoleService.clearCache();
|
||||
|
||||
// 如果有单位异动,发送消息提醒分工会
|
||||
// if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
|
||||
// sendUnitChangeTeacher(middleTable, history);
|
||||
// }
|
||||
if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
|
||||
sendUnitChangeTeacher(middleTable, history);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
@Override
|
||||
public void sendUnitChangeTeacher(SourceChangeMiddleTable middleTable, UserHistory history) {
|
||||
// 查询出异动前的工会
|
||||
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
|
||||
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_unit unit left join sys_union un on unit.unionid = un.id where unit.id = @unitId")
|
||||
.setParam("unitId", history.getUnitid());
|
||||
beforeUnionSql.setCallback(Sqls.callback.map());
|
||||
dao().execute(beforeUnionSql);
|
||||
@@ -275,7 +275,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
|
||||
|
||||
// 查询出异动后的工会
|
||||
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
|
||||
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_unit unit left join sys_union un on unit.unionid = un.id where unit.id = @unitId")
|
||||
.setParam("unitId", middleTable.getUnitid());
|
||||
afterUnionSql.setCallback(Sqls.callback.map());
|
||||
dao().execute(afterUnionSql);
|
||||
@@ -301,7 +301,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
for (NutMap map : beforeMapList) {
|
||||
String beforeContent = "尊敬的%s老师,根据学校最新人员信息调整,%s老师的工会关系已从您处调整至%s。特此告知,烦请知悉。祝您生活愉快!"
|
||||
.formatted(map.getString("username"), middleTable.getUsername(), afterUnionMap.getString("unionname"));
|
||||
// msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转出通知", beforeContent, "", "");
|
||||
|
||||
System.out.println(beforeContent);
|
||||
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转出通知", beforeContent, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +327,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
for (NutMap map : afterMapList) {
|
||||
String afterContent = "尊敬的%s老师,根据学校最新人员信息调整,%s老师的工会关系已从%s调整至您处。特此告知,烦请知悉。祝您生活愉快!"
|
||||
.formatted(map.getString("username"), middleTable.getUsername(), beforeUnionMap.getString("unionname"));
|
||||
// msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转入通知", afterContent, "", "");
|
||||
|
||||
System.out.println(afterContent);
|
||||
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "工会关系转入通知", afterContent, "", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user