员工提成

This commit is contained in:
许允枞 2024-11-08 17:35:17 +08:00
parent c55205c535
commit b623133c22
2 changed files with 40 additions and 17 deletions

View File

@ -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,
@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) {
InspectionWorkNode inspectionWorkNode = new InspectionWorkNode();
inspectionWorkNode.setDealUserId(getUserId());
//获取当前登陆人
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));
}
}

View File

@ -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
<where>
node.status = '2' AND info.status = '1'
<if test="inspectionWorkNode.createTime != null">
@ -50,15 +53,12 @@
<if test="inspectionWorkNode.rescueStartMonth != null">
AND DATE_FORMAT(info.end_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
</if>
<if test="inspectionWorkNode.rescueStartMonth != null">
AND DATE_FORMAT(info.end_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
</if>
<if test="inspectionWorkNode.rescueStart != null and inspectionWorkNode.rescueEnd != null">
AND info.end_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
</if>
</where>
ORDER BY
node.create_time DESC;
info.end_time DESC;
</select>
<select id="getRoyaltySum" resultType="java.util.Map">
SELECT
@ -66,9 +66,6 @@
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
@ -77,6 +74,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
<where>
node.status = '2' AND info.status = '1'
<if test="inspectionWorkNode.createTime != null">