|
@@ -160,9 +160,6 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
goods.setGoodsStatus(3); // 上架
|
|
|
goods.setReleaseTime(new Date()); // 上架时间
|
|
|
updateById(goods);
|
|
|
-
|
|
|
- // 发送消息
|
|
|
- sendMessage(goods);
|
|
|
return true;
|
|
|
} catch (Exception e) {
|
|
|
// 记录异常日志
|
|
@@ -188,7 +185,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
goods.setGoodsStatus(2); // 审核失败
|
|
|
goods.setFailedReason("文本审核不通过:" + (textCheckResult.getRiskWords() != null ? textCheckResult.getRiskWords() : "存在高风险内容"));
|
|
|
// 插入审核记录
|
|
|
- createGoodsAudit(goods, textCheckResult.getRiskWords());
|
|
|
+ createGoodsAudit(goods, textCheckResult.getRiskWords(),2);
|
|
|
// 发送审核失败消息
|
|
|
sendFailedMsg(goods);
|
|
|
return false;
|
|
@@ -209,7 +206,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
goods.setGoodsStatus(2); // 审核失败
|
|
|
goods.setFailedReason("图片审核不通过:图片中包含" + (response.getDescriptions() != null ? response.getDescriptions() : "高风险内容"));
|
|
|
// 插入审核记录
|
|
|
- createGoodsAudit(goods, response.getDescriptions());
|
|
|
+ createGoodsAudit(goods, response.getDescriptions(),2);
|
|
|
// 发送审核失败消息
|
|
|
sendFailedMsg(goods);
|
|
|
return false;
|
|
@@ -219,6 +216,10 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
|
|
|
// 所有审核通过
|
|
|
goods.setGoodsStatus(3); // 上架
|
|
|
+ // 插入审核记录
|
|
|
+ createGoodsAudit(goods, "",1);
|
|
|
+ // 发送审核成功消息
|
|
|
+ sendMessage(goods);
|
|
|
goods.setFailedReason("");
|
|
|
return true;
|
|
|
}
|
|
@@ -229,14 +230,16 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
* @param goods 商品
|
|
|
* @param riskWords 文本审核结果
|
|
|
*/
|
|
|
- private void createGoodsAudit(SecondGoods goods, String riskWords) {
|
|
|
+ private void createGoodsAudit(SecondGoods goods, String riskWords,Integer goodsStatus) {
|
|
|
// 保存审核结果
|
|
|
secondGoodsMapper.updateById(goods);
|
|
|
// 插入审核记录
|
|
|
SecondGoodsAudit auditRecord = new SecondGoodsAudit();
|
|
|
auditRecord.setGoodsId(goods.getId());
|
|
|
- auditRecord.setGoodsStatus(2); // 审核失败
|
|
|
- auditRecord.setFailedReason("文本审核不通过:" + (riskWords != null ? riskWords : "存在高风险内容"));
|
|
|
+ auditRecord.setGoodsStatus(goodsStatus); // 审核失败
|
|
|
+ if (goodsStatus == 2) {
|
|
|
+ auditRecord.setFailedReason("文本审核不通过:" + (riskWords != null ? riskWords : "存在高风险内容"));
|
|
|
+ }
|
|
|
auditRecord.setCreatedUserId(goods.getUserId());
|
|
|
auditRecord.setUpdatedUserId(goods.getUserId());
|
|
|
auditRecord.setCreatedTime(new Date());
|
|
@@ -301,7 +304,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
lifeNotice.setTitle("商品发布通知");
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("status", "true");
|
|
|
- jsonObject.put("text", "恭喜您的商品已发成功");
|
|
|
+ jsonObject.put("message", "恭喜您的商品已发成功");
|
|
|
lifeNotice.setContext(jsonObject.toJSONString());
|
|
|
// lifeNotice.setContext("恭喜您的商品已发成功");
|
|
|
lifeNotice.setNoticeType(1); // 系统通知
|
|
@@ -328,7 +331,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("status", "false");
|
|
|
- jsonObject.put("text", "抱歉您的商品发布失败,图片或文字存在违规行为。请您修改后从新发布");
|
|
|
+ jsonObject.put("message", "抱歉您的商品发布失败,图片或文字存在违规行为。请您修改后从新发布");
|
|
|
lifeNotice.setContext(jsonObject.toJSONString());
|
|
|
// lifeNotice.setContext("商品审核失败,原因为:" + goods.getFailedReason());
|
|
|
// lifeNotice.setContext("抱歉您的商品发布失败,图片或文字存在违规行为。请您修改后从新发布");
|