diff --git a/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceApp.java b/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceApp.java index 8db768d..170d336 100644 --- a/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceApp.java +++ b/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceApp.java @@ -77,11 +77,15 @@ public class InvoiceApp extends BaseController { if (!redisService.exists(token)) { return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); } - params = roleDateUtils.roleUtiles(token, "", "", ""); - if ("0".equals(params.get("code"))) { - return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); - } Map tokenMap = redisService.hmget(token); + if ("GW1000105".equals(tokenMap.get("jobPostion"))) { + params.put("serviceId", tokenMap.get("archivesId") + ""); + } else { + params = roleDateUtils.roleUtiles(token, "", "", ""); + if ("0".equals(params.get("code"))) { + return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); + } + } params.put("companyId", tokenMap.get("companyId") + ""); params.put("id", id); params.put("status", status); @@ -124,9 +128,14 @@ public class InvoiceApp extends BaseController { if (!redisService.exists(token)) { return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); } - params = roleDateUtils.roleUtiles(token, "", "", ""); - if ("0".equals(params.get("code"))) { - return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); + Map tokenMap = redisService.hmget(token); + if ("GW1000105".equals(tokenMap.get("jobPostion"))) { + params.put("serviceId", tokenMap.get("archivesId") + ""); + } else { + params = roleDateUtils.roleUtiles(token, "", "", ""); + if ("0".equals(params.get("code"))) { + return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); + } } // 0.未作废 1.作废 params.put("status", "0"); diff --git a/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceController.java b/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceController.java index c045bb2..5629122 100644 --- a/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceController.java +++ b/crm-admin/src/main/java/com/yb/lb/webapp/invoice/InvoiceController.java @@ -110,9 +110,14 @@ public class InvoiceController extends BaseController { if (!redisService.isKey(token)) { return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); } - params = roleDateUtils.roleUtiles(token, "", "", ""); - if ("0".equals(params.get("code"))) { - return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); + Map tokenMap = redisService.hmget(token); + if ("GW1000105".equals(tokenMap.get("jobPostion"))) { + params.put("serviceId", tokenMap.get("archivesId") + ""); + } else { + params = roleDateUtils.roleUtiles(token, "", "", ""); + if ("0".equals(params.get("code"))) { + return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看"); + } } params.put("id", id); params.put("status", status); diff --git a/crm-common/src/main/resources/mapper/mapper_oracle/Invoice/InvoiceInfoMapper.xml b/crm-common/src/main/resources/mapper/mapper_oracle/Invoice/InvoiceInfoMapper.xml index 80cbff4..0a0d75c 100644 --- a/crm-common/src/main/resources/mapper/mapper_oracle/Invoice/InvoiceInfoMapper.xml +++ b/crm-common/src/main/resources/mapper/mapper_oracle/Invoice/InvoiceInfoMapper.xml @@ -81,6 +81,7 @@ a.delivery_time, a.receipt_date, a.process_instance_id, a.menu_code, a.company_id, a.cdl_code, a.inv_url, a.wh_code, a.wh_name, 0 totalMoney FROM crm_invoice_info a + LEFT JOIN crm_distributor_user_info b ON a.client_id = b.id and a.id = #{id} @@ -165,6 +166,9 @@ AND a.area_id = #{areaId} + + AND b.service_id = #{serviceId} + AND a.staff_id = #{staffId} @@ -298,6 +302,7 @@ a.client_name "clientName", a.delivery_time "deliveryTime" FROM crm_invoice_view a + LEFT JOIN crm_distributor_user_info b ON a.client_id = b.id and a.client_id = #{clientId} @@ -308,6 +313,9 @@ AND a.company_id = #{companyId} + + AND b.service_id = #{serviceId} + and ( a.client_id LIKE '%' || #{userId} || '%'