Sfoglia il codice sorgente

feat: 手动触发结算回调机制,用于修改三方平台不予修改相关的结算中的信息;
该功能仅能修改settleNoteStatus = 3的结算信息;

QuTong 1 anno fa
parent
commit
ade6e173bc

+ 53 - 8
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmPayOffController.java

@@ -63,14 +63,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -705,4 +698,56 @@ public class WmPayOffController {
 		return R.ok(msgList);
 	}
 
+    /**
+     * 手动回调
+     *
+     * @param input 修改的对象信息
+     * @return 结算操作结果
+     */
+    @SysLog("手动回调")
+    @PostMapping("notify-by-oneself")
+	public R<Boolean> notifyByOneself (@RequestBody WmScorePackageSettleNote input){
+		// 开始输出
+		log.info("===== 手工回调开始 =====");
+
+		// 初始化变量命名
+		Integer settleNoteId = input.getId();
+		LocalDateTime notifyTime = input.getNotifyTime();
+		Integer settleNoteStatus = input.getSettleNoteStatus();
+
+		// 初始化内部参数
+		Integer userid = SecurityUtils.getUser().getId();
+		String remark = ("手动回调,操作人" + userid);
+
+		// 主键id校验,防止异常
+        if (null == settleNoteId) {
+            R.failed("积分包ID不能为空");
+        }
+
+        // 信息校验,防止异常
+        if (null == notifyTime ||
+                null == settleNoteStatus
+        ) {
+            R.failed("结算修改信息不能为空");
+        }
+
+        // 校验数据有效性
+        // 查询结算中的数据
+		List<WmScorePackageSettleNote> settleNoteByidList = wmScorePackageSettleNoteService.getSettleNoteById(input.getId(), 3);
+		log.info("结算信息查询:{}",settleNoteByidList.toString());
+		int checkSettleNoteById = settleNoteByidList.size();
+        if (0 == checkSettleNoteById) {
+            R.failed("修改的目标数据状态异常,不能修改");
+        }
+
+		// 更新结算数据
+		boolean updateSettleResult = wmScorePackageSettleNoteService.updateSettleNoteById(settleNoteId, settleNoteStatus, remark);
+
+		// 结束输出
+		log.info("===== 手工回调开始 =====");
+
+		// 返回更新结果
+        return R.ok(updateSettleResult);
+	}
+
 }

+ 17 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/WmScorePackageSettleNoteService.java

@@ -113,4 +113,21 @@ public interface WmScorePackageSettleNoteService extends IService<WmScorePackage
 	 * @return
 	 */
 	R<?> settleNotify(String streamId, Integer settleStatus, Boolean izSingle);
+
+	/**
+	 * 根据settleNoteId、结算状态查询信息有效性
+	 *
+	 * @param id 结算id
+	 * @param settleNoteStatus 结算状态
+	 */
+	List<WmScorePackageSettleNote> getSettleNoteById(Integer id,Integer settleNoteStatus);
+
+	/**
+	 * 根据settleNoteId修改结算状态
+	 *
+	 * @param id 结算id
+	 * @param settleNoteStatus 结算状态
+	 * @param remark 备注
+	 */
+	boolean updateSettleNoteById(Integer id, Integer settleNoteStatus, String remark);
 }

+ 22 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageSettleNoteServiceImpl.java

@@ -4211,4 +4211,26 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 		return R.ok(noteList);
 
 	}
+
+	/**
+	 * 根据settleNoteId、结算状态查询结算信息
+	 */
+	@Override
+	public List<WmScorePackageSettleNote> getSettleNoteById (Integer id,Integer settleNoteStatus){
+        return this.list(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
+				.eq(WmScorePackageSettleNote::getId, id)
+				.eq(WmScorePackageSettleNote::getSettleNoteStatus, settleNoteStatus));
+	}
+
+	/**
+	 * 根据settleNoteId修改结算状态
+	 */
+	@Override
+	public boolean updateSettleNoteById(Integer id, Integer settleNoteStatus, String remark) {
+		WmScorePackageSettleNote query = new WmScorePackageSettleNote();
+		query.setId(id);
+		query.setSettleNoteStatus(settleNoteStatus);
+		query.setRemark(remark);
+		return this.updateById(query);
+	}
 }