Commit fd276d2b by HlQ

[add] Controller 返回类型为 String 时,类型设置为 JSON

1 parent aa428362
......@@ -23,6 +23,7 @@
<wx-mp.version>4.6.2.B</wx-mp.version>
<sa-token.verion>1.38.0</sa-token.verion>
<myexcel.version>4.5.2</myexcel.version>
<maxmind.version>4.2.0</maxmind.version>
</properties>
<dependencies>
......@@ -96,7 +97,7 @@
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>4.2.0</version>
<version>${maxmind.version}</version>
</dependency>
</dependencies>
......
......@@ -44,8 +44,10 @@ public class ResBodyAdvice implements ResponseBodyAdvice<Object> {
if (returnType.getParameterType().isAssignableFrom(String.class)) {
// 字符串类型特殊处理
try {
response.getHeaders().setContentType(MediaType.APPLICATION_JSON);
return new ObjectMapper().writeValueAsString(resultVO);
} catch (JsonProcessingException e) {
log.error("Json 序列化失败");
}
}
return resultVO;
......
......@@ -35,7 +35,6 @@ public class TaskRunner {
void pushUndoneTask() {
log.info("开始推送未完成工单");
var taskList = taskService.list(Wrappers.<Task>lambdaQuery().notIn(Task::getStatus, 3, 5));
// todo 需要异步发送吗?
Opt.ofEmptyAble(taskList)
.map(l -> l.stream().map(Task::getActiveUser).collect(Collectors.toSet()))
.ifPresent(userIds -> {
......
......@@ -871,6 +871,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
* */
@Scheduled(cron = "0 0 8 * * ?")
public void verifyNum() {
log.info("合同比对开始");
var contractNoList = this.listObjs(Wrappers.<Contract>lambdaQuery().select(Contract::getContractNo),
Object::toString);
......@@ -931,6 +932,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
var sameList = CollUtil.intersectionDistinct(dataIdSet, contractNoList);
// 只比对合同编号SC开头的合同
contractDiff(sameList.stream().filter(no -> StrUtil.startWith(no, "SC")).collect(Collectors.toSet()));
log.info("合同比对结束");
}
/**
......@@ -988,7 +990,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
Contract::getReceivableAmount, Contract::getOutstandingAmount, Contract::getSubject,
Contract::getRemark, Contract::getCreateUser, Contract::getModifyUser, Contract::getCreateTime,
Contract::getModifyTime, Contract::getFinalDate, Contract::getInvoiceAmount,
Contract::getFinancialStatus, Contract::getOriginalModTime)
Contract::getFinancialStatus, Contract::getOriginalModTime, Contract::getBackInfo)
.ignoreNullValue();
var platMap = BeanUtil.beanToMap(platContract, new HashMap<>(), copyOptions);
......@@ -1008,6 +1010,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
.header("sign", SecureUtil.sha256(json.toString() + token))
.body(json.toString())
.retrieve()
// fixme GOAWAY received
.body(JSONObject.class);
if (jobO.getInt("code") != 1) {
log.error("获取合同列表失败,错误原因:{}", jobO);
......@@ -1118,6 +1121,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
V value = entry.getValue();
if (!map2.containsKey(key) || ObjUtil.notEquals(value, map2.get(key))) {
log.info("不一致内容项:{}", key);
return false;
}
}
......
server:
port: 8011
shutdown: graceful
spring:
profiles:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!