TASK:mixi;

This commit is contained in:
shahaibo
2025-05-08 21:51:35 +08:00
parent 7cf077ec2f
commit 5fea73356e
2 changed files with 25 additions and 16 deletions

View File

@@ -211,9 +211,8 @@ public class PythonService {
throw new BusinessException("Generate Collocation exception!"); throw new BusinessException("Generate Collocation exception!");
} }
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(response)); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(response));
Boolean result = jsonObject.getBoolean("successful"); Integer code = jsonObject.getInteger("code");
if (code != null && code == 200) {
if (result) {
System.out.println(bodyStr.trim()); System.out.println(bodyStr.trim());
// JSONObject jsonObject1 = JSONObject.parseObject(bodyStr.trim()); // JSONObject jsonObject1 = JSONObject.parseObject(bodyStr.trim());
List<GenerateCollocationOutVO> collocationOutList = processJson(bodyStr.trim()); List<GenerateCollocationOutVO> collocationOutList = processJson(bodyStr.trim());

View File

@@ -1690,6 +1690,15 @@ public class TProductService extends ServiceImpl<TProductMapper, TProduct> {
data.forEach((k,v) -> { data.forEach((k,v) -> {
JSONObject attributes = data.getJSONObject(k); JSONObject attributes = data.getJSONObject(k);
String item = attributes.getString("Item"); String item = attributes.getString("Item");
if (StringUtils.isEmpty(item)) {
TProductAttribute tProductAttribute = new TProductAttribute();
tProductAttribute.setProductId(Long.valueOf(k));
tProductAttribute.setAttributeType("Type");
tProductAttribute.setAttributeValue("Pants");
tProductAttribute.setAttributeItem("bottom");
tProductAttribute.setCreateDate(DateUtil.getByTimeZone(timeZone));
result.add(tProductAttribute);
}else {
attributes.forEach((k1,v1) -> { attributes.forEach((k1,v1) -> {
if (!k1.equals("Item")) { if (!k1.equals("Item")) {
TProductAttribute tProductAttribute = new TProductAttribute(); TProductAttribute tProductAttribute = new TProductAttribute();
@@ -1704,6 +1713,7 @@ public class TProductService extends ServiceImpl<TProductMapper, TProduct> {
} }
} }
}); });
}
}); });
return result; return result;
// productIdToMap.getJSONObject("data").forEach((k, v) -> { // productIdToMap.getJSONObject("data").forEach((k, v) -> {