更改
This commit is contained in:
@@ -18,6 +18,7 @@ import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -52,7 +53,7 @@ public class MsgApi {
|
||||
* 发送短信(批量用户)
|
||||
*/
|
||||
public void sendSMSMsg(String msgContent, List<Map<String, String>> receivers) {
|
||||
NutMap paramsMap = new NutMap();
|
||||
Map<String, Object> paramsMap = new HashMap<>();
|
||||
paramsMap.put("token", getMsgToken());
|
||||
paramsMap.put("msgContent", msgContent);
|
||||
paramsMap.put("receivers", Json.toJson(receivers));
|
||||
@@ -71,7 +72,7 @@ public class MsgApi {
|
||||
* 发送微信消息给多个用户
|
||||
*/
|
||||
public void sendTextMsg(String msgTitle, String msgContent, List<Map<String, String>> receivers) {
|
||||
NutMap paramsMap = new NutMap();
|
||||
Map<String, Object> paramsMap = new HashMap<>();
|
||||
paramsMap.put("token", getMsgToken());
|
||||
paramsMap.put("msgtitle", msgTitle);
|
||||
paramsMap.put("msgContent", msgContent);
|
||||
@@ -84,7 +85,7 @@ public class MsgApi {
|
||||
sendMessage(MSG_API, paramsMap, "000000", "微信消息");
|
||||
}
|
||||
|
||||
private void sendMessage(String apiUrl, NutMap paramsMap, String successCode, String msgTypeDesc) {
|
||||
private void sendMessage(String apiUrl, Map<String, Object> paramsMap, String successCode, String msgTypeDesc) {
|
||||
try {
|
||||
JSONObject response = sendRequest(apiUrl, paramsMap);
|
||||
String rspCode = response.getString("rspCode");
|
||||
@@ -102,7 +103,7 @@ public class MsgApi {
|
||||
}
|
||||
}
|
||||
|
||||
private JSONObject sendRequest(String apiUrl, NutMap paramsMap) {
|
||||
private JSONObject sendRequest(String apiUrl, Map<String, Object> paramsMap) {
|
||||
if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
log.warn("消息未启用,跳过发送");
|
||||
}
|
||||
@@ -111,8 +112,7 @@ public class MsgApi {
|
||||
}
|
||||
String jsonBody = Json.toJson(paramsMap);
|
||||
log.debug("请求体: {}", jsonBody);
|
||||
HttpRequest request = HttpUtil.createPost(apiUrl).body(jsonBody);
|
||||
String responseBody = request.execute().body();
|
||||
String responseBody = HttpUtil.post(apiUrl, paramsMap);
|
||||
log.debug("响应体: {}", responseBody);
|
||||
return JSON.parseObject(responseBody);
|
||||
}
|
||||
|
||||
+14
-4
@@ -5,7 +5,9 @@ import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.loveSubsidy.constant.LoveSubsidyAuditStateConstant;
|
||||
@@ -44,6 +46,8 @@ import java.util.List;
|
||||
@Slf4j
|
||||
public class TheRapyRecuperationLineSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
@Inject
|
||||
private TheRapyRecuperationLineService lineService;
|
||||
@Inject
|
||||
@@ -96,10 +100,16 @@ public class TheRapyRecuperationLineSchoolAuditController {
|
||||
@RequiresPermissions("theRapyRecuperation.line.schoolAudit")
|
||||
public Result onAudit(Audit audit, String id, Integer auditType) {
|
||||
dao.insert(audit);
|
||||
dao.update(TheRapyRecuperationLine.class,
|
||||
Chain.make("stateId", auditType)
|
||||
.add("schoolAuditId", audit.getId()),
|
||||
Cnd.where("id", "=", id));
|
||||
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, Cnd.where("id", "=", id));
|
||||
line.setStateId(auditType);
|
||||
line.setSchoolAuditId(audit.getId());
|
||||
dao.update(line);
|
||||
if(auditType == 4) {
|
||||
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", line.getOpBy()));
|
||||
String content = "%s老师您好,您创建的%s已经审核通过,请及时在电脑端我的工贸-智慧工会-普惠疗休养-个人选择线路菜单设置出行时间。"
|
||||
.formatted(user.getUsername(), line.getLineName());
|
||||
//msgApi.sendSMSMsg(content, user.getUsername(), user.getMobile());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -361,7 +361,7 @@ public class TheRapyRecuperationLineStatisticsController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("lineu.groupSuccess", "=", true);
|
||||
//cnd.and("lineu.groupSuccess", "=", true);
|
||||
cnd.and("line.stateId", "=", 4);
|
||||
cnd.andEX("YEAR(lineu.selectTime)", ">=", startYear);
|
||||
cnd.andEX("YEAR(lineu.selectTime)", "<=", endYear);
|
||||
|
||||
+2
-3
@@ -57,8 +57,7 @@ public class TheRapyRecuperationConfigController {
|
||||
@RequiresAuthentication
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object operation(TheRapyRecuperationConfig config, String[] lotDeleteList) {
|
||||
msgApi.sendSMSMsg("这是一条测试消息", "LSGH0001", "13296575967");
|
||||
/*if (Strings.isNotBlank(config.getId())) {
|
||||
if (Strings.isNotBlank(config.getId())) {
|
||||
if (Lang.isNotEmpty(lotDeleteList)) {
|
||||
dao.clear(TheRapyRecuperationLot.class, Cnd.where("id", "in", lotDeleteList));
|
||||
}
|
||||
@@ -70,7 +69,7 @@ public class TheRapyRecuperationConfigController {
|
||||
dao.insert(collect);
|
||||
} else {
|
||||
dao.insertWith(config, "lots");
|
||||
}*/
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -249,6 +249,7 @@ layout("/layouts/platform.html"){
|
||||
endYear: moment().format('YYYY'),
|
||||
regionalNature: '',
|
||||
baseManagementId: '',
|
||||
travelAgencyId: '',
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: 60},
|
||||
|
||||
Reference in New Issue
Block a user