commit
This commit is contained in:
+216
@@ -0,0 +1,216 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.model.ExcelImportRes;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.EasyExcelUtil;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.dayofficework.healthCheckup.template.HealthCheckupImportTemp;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsBatchService;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.template.RetireSouvenirsImportTemp;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsBatchController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 9:51
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@ApiOperation("批次管理")
|
||||
@At("/platform/retireSouvenirs/batch")
|
||||
public class RetireSouvenirsBatchController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private RetireSouvenirsBatchService batchService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/retiresouvenirs/batch/index.html")
|
||||
@SaCheckPermission("retireSouvenirs.batch")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("retireSouvenirs.batch")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
b.*,
|
||||
u.username as userName,
|
||||
(select count(1) from retire_souvenirs_ledger where batchId = b.id) as count
|
||||
from
|
||||
retire_souvenirs_batch b
|
||||
left join vw_user u on u.id = b .createdBy
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("b.year", "=", year);
|
||||
cnd.and(Cnd.likeEX("b.name", pageForm.getSearchKeyword()));
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = batchService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改批次")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs.batch")
|
||||
@SLog(tag = "退休人员纪念品-批次管理", msg = "新增/修改批次")
|
||||
public Result submit(RetireSouvenirsBatch batch) {
|
||||
batchService.insertOrUpdate(batch);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除批次")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs.batch")
|
||||
@SLog(tag = "退休人员纪念品-批次管理", msg = "删除批次")
|
||||
public Result delete(String id) {
|
||||
batchService.delete(id);
|
||||
batchService.dao().clear(RetireSouvenirsLedger.class, Cnd.where(RetireSouvenirsLedger::getBatchId, "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询批次")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs")
|
||||
public Result selectList() {
|
||||
List<RetireSouvenirsBatch> list = batchService.query(Cnd.NEW().desc(RetireSouvenirsBatch::getCreatedAt));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("下载人员名单导入模版")
|
||||
@SaCheckPermission("retireSouvenirs.batch")
|
||||
public void downloadTem(HttpServletResponse response) {
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("退休时间", "retireTime", 20));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList());
|
||||
CommonDownloadUtil.download("退休人员名单导入模版.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("退休人员名单导入")
|
||||
@SLog(tag = "退休人员纪念品-批次管理", msg = "人员名单导入")
|
||||
@SaCheckPermission("retireSouvenirs.batch")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result temImport(TempFile file, String batchId, String type) {
|
||||
|
||||
if(StrUtil.isBlank(batchId)) {
|
||||
return Result.error("批次信息为空");
|
||||
}
|
||||
if("clear".equals(type)) {
|
||||
dao.clear(RetireSouvenirsLedger.class, Cnd.where(RetireSouvenirsLedger::getBatchId, "=", batchId));
|
||||
}
|
||||
|
||||
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), RetireSouvenirsImportTemp.class, 0, 1);
|
||||
List<RetireSouvenirsImportTemp> importTemps = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(RetireSouvenirsImportTemp.class);
|
||||
|
||||
List<String> loginNames = importTemps.stream().map(RetireSouvenirsImportTemp::getLoginName).filter(Strings::isNotBlank).toList();
|
||||
List<View_user> userList = dao.query(View_user.class, Cnd.where(View_user::getLoginname, "in", loginNames));
|
||||
Map<String, View_user> userMap = userList.stream().collect(Collectors.toMap(View_user::getLoginname, o -> o));
|
||||
|
||||
String[] patterns = {
|
||||
"yyyy-MM-dd",
|
||||
"yyyy/MM/dd",
|
||||
"yyyy-MM",
|
||||
"yyyy/MM",
|
||||
"yyyyMM",
|
||||
"yyyyMMdd",
|
||||
"yyyy年MM月dd日",
|
||||
"yyyy年M月d日"
|
||||
};
|
||||
|
||||
List<RetireSouvenirsLedger> result = new ArrayList<>();
|
||||
for (int i = 0; i < importTemps.size(); i++) {
|
||||
RetireSouvenirsImportTemp temp = importTemps.get(i);
|
||||
|
||||
if (StrUtil.isBlank(temp.getLoginName())) {
|
||||
temp.setErrInfo("工号为空", i + 1);
|
||||
continue;
|
||||
}
|
||||
if (importTemps.stream().filter(s -> s.getLoginName().equals(temp.getLoginName())).count() > 1) {
|
||||
temp.setErrInfo("重复数据", i + 1);
|
||||
}
|
||||
View_user user = userMap.get(temp.getLoginName());
|
||||
if (user == null) {
|
||||
temp.setErrInfo("无此用户", i + 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
DateTime retireTime = DateUtil.parse(temp.getRetireTime(), patterns);
|
||||
String format = DateUtil.format(retireTime, DatePattern.NORM_DATE_PATTERN);
|
||||
|
||||
RetireSouvenirsLedger ledger = new RetireSouvenirsLedger();
|
||||
ledger.setBatchId(batchId);
|
||||
ledger.setUserId(user.getId());
|
||||
ledger.setReceive(false);
|
||||
ledger.setRetireTime(format);
|
||||
result.add(ledger);
|
||||
}
|
||||
|
||||
dao.insert(result);
|
||||
// 创建结果集
|
||||
ExcelImportRes<RetireSouvenirsImportTemp> excelImportRes = new ExcelImportRes<>();
|
||||
excelImportRes.setTotalRecords(importTemps.size());
|
||||
excelImportRes.setSuccessCount(Math.max(result.size() - excelImportRes.getFailedCount(), 0));
|
||||
// 添加错误记录
|
||||
excelImportRes.setErrorDetails(importTemps.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).toList());
|
||||
excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size());
|
||||
|
||||
return Result.success(excelImportRes);
|
||||
}
|
||||
}
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsMsg;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsLedgerService;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.vo.RetireSouvenirsLedgerPageForm;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.annotation.SQL;
|
||||
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;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsLedgerController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 9:52
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@ApiOperation("人员台账")
|
||||
@At("/platform/retireSouvenirs/ledger")
|
||||
public class RetireSouvenirsLedgerController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private RetireSouvenirsLedgerService ledgerService;
|
||||
@Inject
|
||||
private GlobalMessageSendService sendService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/retiresouvenirs/ledger/index.html")
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
public Result pageData(RetireSouvenirsLedgerPageForm pageForm) {
|
||||
Sql sql = this.generateSql(pageForm);
|
||||
Pagination pagination = ledgerService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除人员")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
@SLog(tag = "退休人员纪念品-人员台账", msg = "删除人员")
|
||||
public Result delete(String id) {
|
||||
ledgerService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("设置领取状态")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
@SLog(tag = "退休人员纪念品-人员台账", msg = "设置领取状态")
|
||||
public Result receive(String id) {
|
||||
RetireSouvenirsLedger ledger = ledgerService.fetch(id);
|
||||
ledger.setReceive(!ledger.getReceive());
|
||||
ledgerService.update(ledger);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("短信提醒")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
@SLog(tag = "退休人员纪念品-人员台账", msg = "短信提醒")
|
||||
public Result msg(@Param(value = "pageForm") RetireSouvenirsLedgerPageForm pageForm,
|
||||
@Param(value = "message") String message) {
|
||||
Sql sql = this.generateSql(pageForm);
|
||||
List<NutMap> listMap = ledgerService.listMap(sql);
|
||||
|
||||
List<RetireSouvenirsMsg> msgList = listMap.stream().map(o -> {
|
||||
RetireSouvenirsMsg msg = new RetireSouvenirsMsg();
|
||||
msg.setBatchId(pageForm.getBatchId());
|
||||
msg.setUserId(o.getString("userId"));
|
||||
msg.setSendUserId(SecurityUtil.getUserId());
|
||||
msg.setSendUserName(SecurityUtil.getUserUsername());
|
||||
msg.setMessage(message);
|
||||
msg.setSendTime(DateUtil.now());
|
||||
return msg;
|
||||
}).toList();
|
||||
List<String> list = listMap.stream().map(o -> o.getString("loginName")).toList();
|
||||
|
||||
sendService.sendMessage("智慧工会", message, list);
|
||||
dao.insert(msgList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询短信发送记录")
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
public Result selectMsgList(String batchId, String userId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(RetireSouvenirsMsg::getBatchId, "=", batchId);
|
||||
cnd.and(RetireSouvenirsMsg::getUserId, "=", userId);
|
||||
cnd.desc(RetireSouvenirsMsg::getSendTime);
|
||||
List<RetireSouvenirsMsg> list = dao.query(RetireSouvenirsMsg.class, cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除短信发送记录")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
@SLog(tag = "退休人员纪念品-人员台账", msg = "删除短信发送记录")
|
||||
public Result deleteMsg(String id) {
|
||||
dao.delete(RetireSouvenirsMsg.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("retireSouvenirs.ledger")
|
||||
@ApiOperation("导出退休人员名单")
|
||||
public void download(RetireSouvenirsLedgerPageForm pageForm,
|
||||
HttpServletResponse response) {
|
||||
Sql sql = this.generateSql(pageForm);
|
||||
List<NutMap> listMap = ledgerService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 16));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 16));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 10));
|
||||
exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 30));
|
||||
exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 30));
|
||||
exportEntities.add(new ExcelExportEntity("退休时间", "retireTimeFormat", 20));
|
||||
exportEntities.add(new ExcelExportEntity("是否领取", "receiveStatus", 10));
|
||||
exportEntities.add(new ExcelExportEntity("签字", "sign", 20));
|
||||
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, listMap);
|
||||
CommonDownloadUtil.download("退休人员名单台账.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Sql generateSql(RetireSouvenirsLedgerPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
l.*,
|
||||
u.userName,
|
||||
u.loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
if(l.receive = true, '已领取', '未领取') as receiveStatus,
|
||||
DATE_FORMAT(l.retireTime, '%Y-%m') as retireTimeFormat,
|
||||
(select count(1) from retire_souvenirs_msg where batchId = l.batchId and userId = l.userId) as msgCount
|
||||
FROM
|
||||
retire_souvenirs_ledger l
|
||||
LEFT JOIN vw_user u ON u.id = l.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("l.batchId", "=", pageForm.getBatchId());
|
||||
cnd.andEX("year(l.retireTime)", "=", pageForm.getYear());
|
||||
if("prev".equals(pageForm.getSelectTime())) {
|
||||
String time = DateUtil.thisYear() + "-" + String.format("%02d", pageForm.getMonth()) + "-01";
|
||||
cnd.andEX("l.retireTime", "<", time);
|
||||
} else {
|
||||
cnd.andEX("month(l.retireTime)", "=", pageForm.getMonth());
|
||||
}
|
||||
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
|
||||
cnd.andEX("u.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("l.receive", "=", pageForm.getReceive());
|
||||
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("u.userName", pageForm.getSearchKeyword());
|
||||
group.orLike("u.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("l.receive").asc("l.retireTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsBatch
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 9:52
|
||||
* @Version 1.0
|
||||
* @Description 退休人员纪念品批次管理
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@Comment("退休人员纪念品-批次管理")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RetireSouvenirsBatch extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Column
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("年度")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@Comment("批次名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 600)
|
||||
private String remark;
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsLedger
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 9:52
|
||||
* @Version 1.0
|
||||
* @Description 退休人员纪念品人员台账管理
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@Comment("退休人员纪念品-人员台账")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RetireSouvenirsLedger extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Column
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("批次id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String batchId;
|
||||
|
||||
@Column
|
||||
@Comment("人员Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("退休时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String retireTime;
|
||||
|
||||
@Column
|
||||
@Comment("是否领取")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean receive;
|
||||
|
||||
@Column
|
||||
@Comment("领取时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String receiveTime;
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsMsg
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/15 10:03
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@Comment("退休人员纪念品-短信发送记录")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RetireSouvenirsMsg extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Column
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("批次id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String batchId;
|
||||
|
||||
@Column
|
||||
@Comment("人员Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("发送人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sendUserId;
|
||||
|
||||
@Column
|
||||
@Comment("发送人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sendUserName;
|
||||
|
||||
@Column
|
||||
@Comment("发送内容")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 600)
|
||||
private String message;
|
||||
|
||||
@Column
|
||||
@Comment("发送时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String sendTime;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsBatchService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 14:22
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface RetireSouvenirsBatchService extends BaseService<RetireSouvenirsBatch> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsLedgerService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 14:22
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface RetireSouvenirsLedgerService extends BaseService<RetireSouvenirsLedger> {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsBatchService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsBatchServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 14:22
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class RetireSouvenirsBatchServiceImpl extends BaseServiceImpl<RetireSouvenirsBatch> implements RetireSouvenirsBatchService {
|
||||
|
||||
public RetireSouvenirsBatchServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsLedgerService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsLedgerServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 14:23
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class RetireSouvenirsLedgerServiceImpl extends BaseServiceImpl<RetireSouvenirsLedger> implements RetireSouvenirsLedgerService {
|
||||
|
||||
public RetireSouvenirsLedgerServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.template;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import com.budwk.app.base.model.ExcelImportError;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsImportTemp
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/14 15:21
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ContentRowHeight(20)
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(25)
|
||||
public class RetireSouvenirsImportTemp extends ExcelImportError {
|
||||
|
||||
@ExcelProperty("工号" )
|
||||
private String loginName;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty("退休时间")
|
||||
private String retireTime;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.budwk.app.zhgh.dayofficework.retiresouvenirs.vo;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName RetireSouvenirsLedgerPageForm
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/15 9:52
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
public class RetireSouvenirsLedgerPageForm extends PageForm {
|
||||
|
||||
private String batchId;
|
||||
private Integer year;
|
||||
private Integer month;
|
||||
private String unitId;
|
||||
private String unionId;
|
||||
private String selectTime;
|
||||
private Boolean receive;
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
const basicForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-dialog :title="formData.id ? '编辑':'新增'" :visible.sync="visible" width="40%" :close-on-click-modal="false">
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="110px" label-position="left">
|
||||
<el-form-item label="年度" prop="year">
|
||||
<el-date-picker
|
||||
v-model="formData.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择年度"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次名称" prop="name">
|
||||
<el-input type="text" v-model="formData.name" maxlength="50"
|
||||
placeholder="请输入批次名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="formData.remark" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="$emit('refresh'); visible = false">取消</el-button>
|
||||
<el-button @click="onSubmit" type="primary">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
},
|
||||
formRules: {
|
||||
year: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
name: [{required: true, message: '必填', trigger: ['blur']}],
|
||||
},
|
||||
visible: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
if(row && row.id) {
|
||||
this.$set(row, 'year', row.year.toString())
|
||||
this.formData = clone(row)
|
||||
} else {
|
||||
this.formData = {
|
||||
year: new Date().getFullYear().toString()
|
||||
}
|
||||
}
|
||||
this.visible = true
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/retireSouvenirs/batch/submit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.$emit('refresh')
|
||||
this.visible = false
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
|
||||
`
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度:">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择年度"
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="批次名称:">
|
||||
<el-input placeholder="请输入批次名称查询" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
</el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="批次列表">
|
||||
<el-button type="primary" size="small" @click="onAdd">
|
||||
<i class="ti-plus"></i>
|
||||
新增批次
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{ row }" v-if="column.prop === 'createdAt'">
|
||||
{{ $moment(row.createdAt).format('YYYY-MM-DD') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template v-slot="{ row }">
|
||||
<el-dropdown style="margin-right: 10px">
|
||||
<el-button type="primary" size="mini">
|
||||
导入人员
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="onImport(row, 'clear')">清空</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="onImport(row, 'append')">追加</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="onDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<basic-form ref="basicFormRef" @refresh="refresh"></basic-form>
|
||||
|
||||
<excel-import
|
||||
ref="excelImportRef"
|
||||
url="/platform/retireSouvenirs/batch/temImport"
|
||||
template_url="/platform/retireSouvenirs/batch/downloadTem"
|
||||
:visible.sync="importVisible"
|
||||
title="导入人员名单"
|
||||
width="700px"
|
||||
:extra_params="importParams"
|
||||
@import-success="doSearch"
|
||||
></excel-import>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include('basicForm.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"basic-form": basicForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'name', label: '批次名称'},
|
||||
{prop: 'remark', label: '备注'},
|
||||
{prop: 'userName', label: '创建人'},
|
||||
{prop: 'createdAt', label: '创建时间'},
|
||||
{prop: 'count', label: '关联人员数'},
|
||||
],
|
||||
importVisible: false,
|
||||
importParams: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onImport(row, type) {
|
||||
this.importParams = {
|
||||
batchId: row.id,
|
||||
type: type
|
||||
}
|
||||
this.importVisible = true
|
||||
},
|
||||
refresh() {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
onAdd() {
|
||||
this.$refs.basicFormRef.onOpen()
|
||||
},
|
||||
onEdit(row) {
|
||||
this.$refs.basicFormRef.onOpen(row)
|
||||
},
|
||||
onDelete(row) {
|
||||
let msg = row.count > 0 ? '该批次下有' + row.count + '条数据,' : ''
|
||||
this.$confirm(msg + "您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/retireSouvenirs/batch/delete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+383
@@ -0,0 +1,383 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.search-other {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.search-other-label {
|
||||
width: 90px;
|
||||
min-width: 90px;
|
||||
color: rgb(100, 100, 100);
|
||||
margin-right: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.search-other > div {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
.search-other .el-tag {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.search-other .el-link {
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="批次名称:">
|
||||
<el-select v-model="pageForm.batchId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择批次名称" filterable>
|
||||
<el-option v-for="item in batchOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="退休年份:">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择退休年份"
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="退休月份:">
|
||||
<el-date-picker
|
||||
v-model="pageForm.month"
|
||||
type="month"
|
||||
value-format="MM"
|
||||
placeholder="请选择退休月份"
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="领取状态:">
|
||||
<el-select v-model="pageForm.receive" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择领取状态" filterable clearable>
|
||||
<el-option :value="null" label="全部"></el-option>
|
||||
<el-option :value="false" label="未领取"></el-option>
|
||||
<el-option :value="true" label="已领取"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="工号/姓名:">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入工号或者姓名查询" clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属单位:">
|
||||
<el-select @change="doSearch"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择单位"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属工会:">
|
||||
<el-select v-model="pageForm.unionId"
|
||||
placeholder="请选择所属工会"
|
||||
filterable
|
||||
clearable
|
||||
@change="doSearch"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search-other">
|
||||
<div class="search-other-label">快捷查询:</div>
|
||||
<div>
|
||||
<el-tag style="margin-right: 10px;cursor: pointer"
|
||||
:effect="pageForm.selectTime === 'current' ? 'dark' : 'plain'"
|
||||
@click="tagClick('current')">
|
||||
当月未领取(退休时间在当前月份,并且未领取)
|
||||
</el-tag>
|
||||
<el-tag style="margin-right: 10px;cursor: pointer"
|
||||
:effect="pageForm.selectTime === 'prev' ? 'dark' : 'plain'"
|
||||
@click="tagClick('prev')">
|
||||
逾期未领取(退休时间在当前月份之前,并且未领取)
|
||||
</el-tag>
|
||||
<el-link type="danger"
|
||||
v-if="pageForm.selectTime !== ''"
|
||||
:underline="false"
|
||||
@click="tagClear">清空
|
||||
</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="人员列表">
|
||||
<el-button type="primary" size="small" @click="onMsg" icon="el-icon-mobile-phone">短信提醒</el-button>
|
||||
<el-button type="primary" size="small" @click="onExport" icon="el-icon-download">导出名单</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" :size="tableSize">
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{ row }" v-if="column.prop === 'receive'">
|
||||
<span v-if="row.receive === true" style="color: #15db81;">已领取</span>
|
||||
<span v-else>未领取</span>
|
||||
</template>
|
||||
<template v-slot="{ row }" v-else-if="column.prop === 'msgCount'">
|
||||
<el-link type="primary" @click="onMsgView(row)">{{ row.msgCount }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="{ row }">
|
||||
<el-button v-if="row.receive === false" @click="onReceive(row)" size="mini" type="primary">设置领取</el-button>
|
||||
<el-button v-if="row.receive === true" @click="onReceive(row)" size="mini" type="info">设置未领取</el-button>
|
||||
<el-button @click="onDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="短信提醒" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false">
|
||||
|
||||
<el-alert
|
||||
:title="'当前查询条件筛选人数为:' + pageForm.totalCount + '人'"
|
||||
type="info"
|
||||
class="mb5"
|
||||
effect="dark">
|
||||
</el-alert>
|
||||
|
||||
<el-alert
|
||||
title="发送内容示例:老师您好,您有退休纪念品还未领取,请于xx及时到xx领取。"
|
||||
type="info"
|
||||
class="mb20"
|
||||
effect="dark">
|
||||
</el-alert>
|
||||
|
||||
<el-input type="textarea" v-model="message" placeholder="请输入发送内容" :rows="4"></el-input>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doMsg">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="短信发送记录" :visible.sync="msgDialogVisible" :close-on-click-modal="false">
|
||||
|
||||
<el-table :data="msgTableData" max-height="500" size="small">
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="发送时间" prop="sendTime"></el-table-column>
|
||||
<el-table-column label="发送内容" prop="message" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="发送人" prop="sendUserName"></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button @click="onDeleteMsg(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="msgDialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
receive: null,
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitName', label: '所属单位'},
|
||||
{prop: 'unionName', label: '所属工会'},
|
||||
{prop: 'retireTimeFormat', label: '退休时间'},
|
||||
{prop: 'msgCount', label: '短信提醒次数'},
|
||||
{prop: 'receive', label: '是否领取'},
|
||||
],
|
||||
batchOptions: [],
|
||||
unitOptions: [],
|
||||
unionOptions: [],
|
||||
message: '',
|
||||
dialogVisible: false,
|
||||
|
||||
msgRow: {},
|
||||
msgTableData: {},
|
||||
msgDialogVisible: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDeleteMsg(row) {
|
||||
this.$confirm("您确定要删除短信记录吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/retireSouvenirs/ledger/deleteMsg", {
|
||||
id: row.id,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.onMsgView(this.msgRow)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
onMsgView(row) {
|
||||
this.msgRow = row
|
||||
this.$axios.post("/platform/retireSouvenirs/ledger/selectMsgList", {
|
||||
'batchId': row.batchId,
|
||||
'userId': row.userId,
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.msgTableData = resp.data
|
||||
this.msgDialogVisible = true
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
onMsg() {
|
||||
this.message = ''
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doMsg() {
|
||||
if(!this.message) {
|
||||
this.$message.warning('请输入发送内容')
|
||||
return
|
||||
}
|
||||
this.$confirm("您确定要发送短信吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/retireSouvenirs/ledger/msg", {
|
||||
'pageForm': JSON.stringify(this.pageForm),
|
||||
'message': this.message,
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
tagClick(type) {
|
||||
this.$set(this.pageForm, 'month', (new Date().getMonth() + 1).toString())
|
||||
this.$set(this.pageForm, 'receive', false)
|
||||
this.$set(this.pageForm, 'selectTime', type)
|
||||
this.doSearch()
|
||||
},
|
||||
tagClear() {
|
||||
this.$set(this.pageForm, 'month', '')
|
||||
this.$set(this.pageForm, 'receive', null)
|
||||
this.$set(this.pageForm, 'selectTime', '')
|
||||
this.doSearch()
|
||||
},
|
||||
onExport() {
|
||||
this.$downLoad(loc() + "/download", this.pageForm)
|
||||
},
|
||||
onReceive(row) {
|
||||
this.$confirm("您确定要设置吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/retireSouvenirs/ledger/receive", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
onDelete(row) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/retireSouvenirs/ledger/delete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post(loc() + "/pageData", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
selectList() {
|
||||
this.$axios.post("/platform/retireSouvenirs/batch/selectList").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.batchOptions = res.data
|
||||
if(this.batchOptions.length > 0) {
|
||||
this.$set(this.pageForm, 'batchId', this.batchOptions[0].id)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.selectList()
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user