diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/utils/IdUtils.java b/ruoyi-admin/src/main/java/com/ruoyi/web/utils/IdUtils.java index 0015e61..ca4653d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/utils/IdUtils.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/utils/IdUtils.java @@ -18,11 +18,11 @@ public class IdUtils { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); //生成两位大写字母 String keyArr = randomLetter(size); - String fourRandom = random.nextInt(9999) + ""; + String fourRandom = random.nextInt(999) + ""; int randLength = fourRandom.length(); //四位随机数,不足四位的补0 - if(fourRandom.length()<4){//不足四位的随机数补充0 - for(int i=1; i<=4-randLength; i++){ + if(fourRandom.length()<3){//不足四位的随机数补充0 + for(int i=1; i<=3-randLength; i++){ fourRandom = '0' + fourRandom; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/customer/service/impl/CustomerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/customer/service/impl/CustomerServiceImpl.java index ae0f276..1dac82d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/customer/service/impl/CustomerServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/customer/service/impl/CustomerServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.customer.service.impl; import java.util.List; + +import com.ruoyi.common.annotation.DataScope; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -42,6 +44,7 @@ public class CustomerServiceImpl implements ICustomerService * @return 客户管理 */ @Override + @DataScope(deptAlias = "d", userAlias = "u") public List selectCustomerList(Customer customer) { return customerMapper.selectCustomerList(customer); diff --git a/ruoyi-system/src/main/resources/mapper/customer/CustomerMapper.xml b/ruoyi-system/src/main/resources/mapper/customer/CustomerMapper.xml index e212a3b..3676248 100644 --- a/ruoyi-system/src/main/resources/mapper/customer/CustomerMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/customer/CustomerMapper.xml @@ -45,14 +45,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - LEFT JOIN sys_user s on s.user_name=a.create_by + LEFT JOIN sys_user u on u.user_name=a.create_by select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number, a.cus_industry_code, a.cus_group, a.cus_vat_no, a.cus_type, a.cus_country, a.cus_language, a.cus_label, a.cus_classification, a.cus_receiving_email, a.cus_recipient, a.cus_recipient_phone, a.cus_remark, - a.cus_state, a.cus_approval_status,a.create_time,s.nick_name create_name + a.cus_state, a.cus_approval_status,a.create_time,u.nick_name create_name from customer a @@ -65,7 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and cus_sap_code like concat('%', #{cusSapCode}, '%') and cus_state = #{cusState} and cus_approval_status = #{cusApprovalStatus} - + + ${params.dataScope} +