|
|
|
@ -20,7 +20,9 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.EnumUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.google.gson.Gson; |
|
|
|
|
import com.logpm.factory.comfac.service.IAsyncDataService; |
|
|
|
|
import com.logpm.factory.comfac.service.IOrderStatusLogService; |
|
|
|
|
import com.logpm.factory.mt.dto.MtFactoryDataDTO; |
|
|
|
@ -55,6 +57,8 @@ import java.util.List;
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
import static com.alibaba.druid.util.FnvHash.Constants.GSON; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 梦天数据 控制器 |
|
|
|
|
* |
|
|
|
@ -113,16 +117,20 @@ public class MtFactoryDataController extends BladeController {
|
|
|
|
|
log.info("############data:{} ", mtFactoryDataDTO); |
|
|
|
|
String corpId = request.getHeader("corpId"); |
|
|
|
|
|
|
|
|
|
String json = JSONObject.toJSONString(mtFactoryDataDTO); |
|
|
|
|
//先保存原始请求数据
|
|
|
|
|
OrderStatusLog orderStatusLog = new OrderStatusLog(); |
|
|
|
|
orderStatusLog.setArgs(JSONObject.toJSONString(mtFactoryDataDTO)); |
|
|
|
|
orderStatusLog.setArgs(json); |
|
|
|
|
orderStatusLog.setStatus(1); |
|
|
|
|
orderStatusLog.setType(3); |
|
|
|
|
orderStatusLog.setBrand("梦天"); |
|
|
|
|
orderStatusLogService.save(orderStatusLog); |
|
|
|
|
try { |
|
|
|
|
// 解析 map 为 MtFactoryDataDTO 对象
|
|
|
|
|
MtFactoryDataDTO dto = JSONObject.parseObject(JSONObject.toJSONString(mtFactoryDataDTO), MtFactoryDataDTO.class); |
|
|
|
|
// MtFactoryDataDTO dto = JSONObject.parseObject(json, MtFactoryDataDTO.class);
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
|
MtFactoryDataDTO dto = objectMapper.readValue(json, MtFactoryDataDTO.class); |
|
|
|
|
|
|
|
|
|
//数据存入数据库
|
|
|
|
|
R r = mtFactoryDataService.dealWithData(dto); |
|
|
|
|
|
|
|
|
|