建言献策,慰问报销凭证
This commit is contained in:
+12
@@ -9,6 +9,7 @@ import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.service.SuggestionBoxService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -111,5 +112,16 @@ public class SuggestionBoxMineController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"suggestionBox.mine", "h5.suggestionBox.mine"}, mode = SaMode.OR)
|
||||
@ApiOperation("保存评价")
|
||||
@SLog(tag = "建言献策-", msg = "保存评价")
|
||||
public Result evaluate(String id ,String evaluate) {
|
||||
SuggestionBox box = dao.fetch(SuggestionBox.class, id);
|
||||
box.setEvaluate(evaluate);
|
||||
dao.update(box);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+15
@@ -4,9 +4,11 @@ import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.service.SuggestionBoxService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -23,6 +25,8 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/suggestionBox/query")
|
||||
@Ok("json:full")
|
||||
@@ -117,5 +121,16 @@ public class SuggestionBoxQueryController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"suggestionBox.query", "h5.suggestionBox.query"}, mode = SaMode.OR)
|
||||
@ApiOperation("保存答复")
|
||||
@SLog(tag = "建言献策-", msg = "保存答复")
|
||||
public Result reply(String id ,String reply) {
|
||||
SuggestionBox box = dao.fetch(SuggestionBox.class, id);
|
||||
box.setReply(reply);
|
||||
dao.update(box);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,16 @@ public class SuggestionBox extends BaseModel {
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String content;
|
||||
|
||||
@Column
|
||||
@Comment("答复")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String reply;
|
||||
|
||||
@Column
|
||||
@Comment("评价")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String evaluate;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
|
||||
+120
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.staffbenefit.condolence.controller;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -51,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -270,5 +272,123 @@ public class CondolenceMineController {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@At
|
||||
@ApiOperation("导出单个慰问报销凭证")
|
||||
@SaCheckPermission("condolence")
|
||||
public void doExport(@Valid String id, HttpServletResponse response) throws ParseException {
|
||||
HashMap<String, Object> docData = new HashMap<>();
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ct.name AS typeName
|
||||
FROM
|
||||
`condolence` info
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN condolence_type ct ON ct.id = info.type
|
||||
WHERE
|
||||
info.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
NutMap info = (NutMap) sql.getResult();
|
||||
|
||||
// 根据慰问类型选择不同的模板和文件名
|
||||
String type = info.getString("type");
|
||||
String templateName;
|
||||
String fileName;
|
||||
|
||||
templateName = "condolence_reimbursement";
|
||||
fileName = "河北地质大学慰问报销凭证" + ".docx";
|
||||
|
||||
|
||||
|
||||
// 添加日期格式化处理
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
if (info.get("createTime") != null) {
|
||||
if (info.get("createTime") instanceof String) {
|
||||
String createTimeStr = (String) info.get("createTime");
|
||||
Date date = inputFormat.parse(createTimeStr);
|
||||
info.put("createTime", sdf.format(date));
|
||||
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(info.getString("signature"))) {
|
||||
info.put("signature", sysOfficeTemplateUtil.createPictureRenderData(info.getString("signature")));
|
||||
}
|
||||
|
||||
info.put("money_big", Convert.digitToChinese(info.getDouble("money")));
|
||||
info.put("typeName", info.getString("typeName"));
|
||||
double price = info.getDouble("money");
|
||||
int money_int = (int) price;
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(price));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(money_int));
|
||||
double moneyAngle = b1.subtract(b2).doubleValue();
|
||||
BigDecimal b3 = new BigDecimal(moneyAngle);
|
||||
|
||||
info.put("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null);
|
||||
info.put("two", money_int >= 100000 ? (money_int / 100000) % 10 : null);
|
||||
info.put("three", money_int >= 10000 ? (money_int / 10000) % 10 : null);
|
||||
info.put("four", money_int >= 1000 ? (money_int / 1000) % 10 : null);
|
||||
info.put("five", money_int >= 100 ? (money_int / 100) % 10 : null);
|
||||
info.put("six", money_int >= 10 ? (money_int / 10) % 10 : null);
|
||||
info.put("seven", money_int >= 10 ? money_int % 10 : null);
|
||||
info.put("eight", (int) (moneyAngle * 10));
|
||||
info.put("nine", (int) (moneyAngle * 100 % 10));
|
||||
|
||||
docData.put("schoolName", Globals.AppName);
|
||||
docData.put("info", info);
|
||||
|
||||
|
||||
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
|
||||
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(info.getLong("instanceId"), null);
|
||||
for (ProcessTask doneTask : doneTaskList) {
|
||||
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
|
||||
doneTaskVos.add(taskVO);
|
||||
}
|
||||
|
||||
// 各审批节点处理
|
||||
doneTaskVos.stream().filter(task -> "分工会审核".equals(task.getDisplayName()))
|
||||
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||
.ifPresent(v -> {
|
||||
Dict taskFormData = v.getTaskFormData();
|
||||
HashMap<String, Object> approval = new HashMap<>();
|
||||
|
||||
approval.put("date", DateUtil.format(v.getFinishTime(), "yyyy年MM月dd日"));
|
||||
approval.put("user", taskFormData.getStr("tf_userName"));
|
||||
if (StrUtil.isNotBlank(taskFormData.getStr("tf_userSign"))) {
|
||||
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_userSign")));
|
||||
}
|
||||
approval.put("opinion", taskFormData.getStr("tf_opinion"));
|
||||
docData.put("fgh", approval);
|
||||
});
|
||||
|
||||
doneTaskVos.stream().filter(task -> "校工会审核".equals(task.getDisplayName()))
|
||||
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||
.ifPresent(v -> {
|
||||
Dict taskFormData = v.getTaskFormData();
|
||||
HashMap<String, Object> approval = new HashMap<>();
|
||||
|
||||
approval.put("date", DateUtil.format(v.getFinishTime(), "yyyy年MM月dd日"));
|
||||
approval.put("user", taskFormData.getStr("tf_userName"));
|
||||
if (StrUtil.isNotBlank(taskFormData.getStr("tf_userSign"))) {
|
||||
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_userSign")));
|
||||
}
|
||||
approval.put("opinion", taskFormData.getStr("tf_opinion"));
|
||||
docData.put("xgh", approval);
|
||||
});
|
||||
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName)).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
log.error("河北地质大学慰问报销凭证导出失败,id:{},错误信息:{}", id, e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ const SUGGESTION_INFO = {
|
||||
<el-descriptions-item label="工会">{{viewData.unionName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="标题" :span="2">{{viewData.title}}</el-descriptions-item>
|
||||
<el-descriptions-item label="填写意见建议内容" :span="2">{{viewData.content}}</el-descriptions-item>
|
||||
<el-descriptions-item label="答复" :span="2">{{viewData.reply}}</el-descriptions-item>
|
||||
<el-descriptions-item label="评价" :span="2">{{viewData.evaluate}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<template v-for="task in doneTasks">
|
||||
|
||||
@@ -38,6 +38,9 @@ layout("/layouts/platform.html"){
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>
|
||||
<el-button v-if="row.instanceState == 20" @click="evaluate(row)" size="mini" type="primary">
|
||||
评价
|
||||
</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -65,6 +68,30 @@ layout("/layouts/platform.html"){
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
evaluate(row) {
|
||||
this.$prompt('请输入评价内容', '评价', {
|
||||
confirmButtonText: '保存',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPlaceholder: '请输入评价内容',
|
||||
inputValidator: (value) => {
|
||||
if (!value || value.trim() === '') {
|
||||
return '评价内容不能为空';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
this.$axios.post('/platform/suggestionBox/mine/evaluate', {id: row.id, evaluate: value
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('评价保存成功');
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户取消操作
|
||||
});
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.$refs.suggestionInfoRef.onOpen(row)
|
||||
|
||||
@@ -54,6 +54,9 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="reply(row)" size="mini" type="primary">
|
||||
答复
|
||||
</el-button>
|
||||
<el-button v-if="$auth.hasRole('SYSADMIN')" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -84,14 +87,35 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reply(row) {
|
||||
this.$prompt('请输入答复内容', '答复', {
|
||||
confirmButtonText: '保存',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPlaceholder: '请输入答复内容',
|
||||
inputValidator: (value) => {
|
||||
if (!value || value.trim() === '') {
|
||||
return '答复内容不能为空';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}).then(({ value }) => {
|
||||
this.$axios.post('/platform/suggestionBox/query/reply', {id: row.id, reply: value
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('答复保存成功');
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户取消操作
|
||||
});
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.$refs.suggestionInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
commonUtil.pjaxPush('/platform/suggestionBox/write?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
|
||||
@@ -71,7 +71,10 @@ layout("/layouts/platform.html"){
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-if="row.instanceState === 20" @click="onExport(row.id)" size="mini" type="primary">
|
||||
导出
|
||||
导出申请表
|
||||
</el-button>
|
||||
<el-button v-if="row.instanceState === 20" @click="doExport(row.id)" size="mini" type="primary">
|
||||
报销凭证
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -111,10 +114,10 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
onExport(id) {
|
||||
this.$downLoad('/platform/condolence/mine/onExport', {
|
||||
id: id
|
||||
})
|
||||
|
||||
this.$downLoad('/platform/condolence/mine/onExport', {id: id})
|
||||
},
|
||||
doExport(id) {
|
||||
this.$downLoad('/platform/condolence/mine/doExport', {id: id})
|
||||
},
|
||||
onAdd() {
|
||||
commonUtil.pjaxPush('/platform/condolence/apply')
|
||||
|
||||
Reference in New Issue
Block a user