diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java
index 24a66f91..adb7f370 100644
--- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java
+++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionInfoController.java
@@ -4,6 +4,8 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.security.core.LoginUser;
+import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.inspection.entity.InspectionInfo;
import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
import cn.iocoder.yudao.module.inspection.service.IInspectionInfoService;
@@ -171,6 +173,7 @@ public class InspectionInfoController extends BaseController {
/**
* 分页查询节点提成
+ *
* @param inspectionWorkNode
* @param pageNum
* @param pageSize
@@ -186,6 +189,7 @@ public class InspectionInfoController extends BaseController {
/**
* 获取提成总金额
+ *
* @param inspectionWorkNode
* @return
*/
@@ -197,16 +201,32 @@ public class InspectionInfoController extends BaseController {
/**
* app分页查询节点提成
+ *
* @param pageNum
* @param pageSize
* @return
*/
- @GetMapping("getRoyaltyList")
- public CommonResult getRoyaltyListApp(@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNum,
- @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
- InspectionWorkNode inspectionWorkNode = new InspectionWorkNode();
- inspectionWorkNode.setDealUserId(getUserId());
+ @GetMapping("getRoyaltyListApp")
+ public CommonResult getRoyaltyListApp(InspectionWorkNode inspectionWorkNode,
+ @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNum,
+ @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+ //获取当前登陆人
+ LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
+ inspectionWorkNode.setDealUserId(loginUser.getId());
IPage page = new Page(pageNum, pageSize);
return success(inspectionWorkNodeService.getRoyaltyList(page, inspectionWorkNode));
}
+
+ /**
+ * 获取提成总金额app
+ *
+ * @return
+ */
+ @GetMapping("getRoyaltySumApp")
+ public CommonResult getRoyaltySumApp(InspectionWorkNode inspectionWorkNode) {
+ //获取当前登陆人
+ LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
+ inspectionWorkNode.setDealUserId(loginUser.getId());
+ return success(inspectionWorkNodeService.getRoyaltySum(inspectionWorkNode));
+ }
}
diff --git a/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml b/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml
index 8de93f84..67fd11ec 100644
--- a/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml
+++ b/dl-module-inspection/src/main/resources/mapper/InspectionWorkNodeMapper.xml
@@ -17,14 +17,11 @@
proj.project_name AS projectName, -- Assuming there's a project name in the inspection project table
node.deal_user_name AS handlerName,
IFNULL(royalty.royalty_amount, 0) / 100 AS royaltyAmount,
- node.create_time AS node_create_time,
- royalty.update_time AS royalty_create_time
+ node.update_time AS node_create_time,
+ node.update_time AS royalty_create_time
FROM
inspection_work_node AS node
LEFT JOIN
- inspection_project_royalty AS royalty
- ON node.project_id = royalty.project_id
- LEFT JOIN
system_users AS users
ON node.deal_user_id = users.id
LEFT JOIN
@@ -33,6 +30,12 @@
LEFT JOIN
inspection_info AS info
ON node.inspection_info_id = info.id
+ LEFT JOIN
+ order_info orders
+ ON info.inspection_order_id = orders.id
+ LEFT JOIN
+ inspection_project_royalty AS royalty
+ ON node.project_id = royalty.project_id and orders.goods_id = royalty.goods_id
node.status = '2' AND info.status = '1'
@@ -50,15 +53,12 @@
AND DATE_FORMAT(info.end_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
-
- AND DATE_FORMAT(info.end_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
-
AND info.end_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
ORDER BY
- node.create_time DESC;
+ info.end_time DESC;