diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCustomerUserController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCustomerUserController.java index 805e9e7b9..6ec5041d4 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCustomerUserController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisCustomerUserController.java @@ -11,39 +11,32 @@ package com.xdadan.erp.web.emis; -import java.math.BigDecimal; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter; -import com.xdadan.erp.emis.domain.*; -import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType; -import com.xdadan.erp.emis.domain.exception.EmisBizError; -import com.xdadan.erp.emis.service.EmisBaseService; -import jodd.util.StringUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DuplicateKeyException; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - import com.xdadan.erp.common.annotation.Log; +import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter; import com.xdadan.erp.common.core.domain.AjaxResult; import com.xdadan.erp.common.core.page.TableDataInfo; import com.xdadan.erp.common.enums.BusinessType; import com.xdadan.erp.common.utils.StringUtils; import com.xdadan.erp.common.utils.poi.ExcelUtil; - -import com.xdadan.erp.emis.service.IEmisCustomerUserService; +import com.xdadan.erp.emis.domain.EmisCountry; +import com.xdadan.erp.emis.domain.EmisCustomerUser; +import com.xdadan.erp.emis.domain.EmisRegion; import com.xdadan.erp.emis.domain.EmisWaybill; +import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType; +import com.xdadan.erp.emis.domain.exception.EmisBizError; import com.xdadan.erp.emis.domain.vo.MonthlyCustomerShipmentStatVO; +import com.xdadan.erp.emis.service.EmisBaseService; +import com.xdadan.erp.emis.service.IEmisCustomerUserService; import com.xdadan.erp.emis.service.excelCellStrategy.MonthlyShipmentStatExcelUtil; +import jodd.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.util.List; /** * 快递客户用户Controller @@ -98,9 +91,10 @@ public class EmisCustomerUserController extends EmisBaseController public TableDataInfo listMoneyUser(EmisCustomerUser emisCustomerUser) { startPage(); - if(!(getLoginUser().getUser().isTopSite())){ - emisCustomerUser.setOwnerSite(getLoginUser().getUser().getOwnerSiteCode()); - } + setPrivParams(emisCustomerUser); +// if(!(getLoginUser().getUser().isTopSite())){ +// emisCustomerUser.setOwnerSite(getLoginUser().getUser().getOwnerSiteCode()); +// } emisCustomerUser.setCustomerType("1"); List list = emisCustomerUserService.selectEmisCustomerUserList(emisCustomerUser); return getDataTable(list); diff --git a/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml b/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml index bcd44c76e..655a34956 100644 --- a/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -70,18 +70,12 @@ - - - - - - - - - - - - + + + + + + @@ -92,16 +86,105 @@ - select id, customer_code, customer_name, customer_name_en, simple_name, contact, phone, mobile, customer_type, settled_type, user_type, company, lic_no, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, biz_site, biz_site_name, country, province, city, county, town, address, email, post_code, real_name, id_no, id_type, id_pic1, id_pic2, id_verify_status, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, first_signing_day, credit_period_type, credit_period, settle_day, status, order_num, sales_support, sales_executive, enterprise_name, enterprise_tax_id, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user + select /*+ INDEX(a idx_emis_customer_user_owner_site) */ + a.id, + a.customer_code, + a.customer_name, + a.customer_name_en, + a.simple_name, + a.contact, + a.phone, + a.mobile, + a.customer_type, + a.settled_type, + a.user_type, + a.company, + a.lic_no, + a.dept_id, + a.avatar, + a.sex, + a.invitation_info, + a.login_ip, + a.login_date, + a.nick_name, + a.union_id, + a.openid, + a.monthly_pay_code, + a.user_name, + a.password, + a.owner_site, + a.biz_site, + a.biz_site_name, + a.country, + a.province, + a.city, + a.county, + a.town, + a.address, + a.email, + a.post_code, + a.real_name, + a.id_no, + a.id_type, + a.id_pic1, + a.id_pic2, + a.id_verify_status, + a.payee, + a.salesmen, + a.data_from, + a.bl_open_oms, + a.bl_sms, + a.op_emp_code, + a.first_signing_day, + a.credit_period_type, + a.credit_period, + a.settle_day, + a.status, + a.order_num, + a.sales_support, + a.sales_executive, + a.enterprise_name, + a.enterprise_tax_id, + a.remark, + a.del_flag, + a.create_by, + a.create_time, + a.update_by, + a.update_time, + a.create_site, + a.update_site, + c.name as country_name, + rp.region_name as province_name, + rc.region_name as city_name, + rco.region_name as county_name, + os.site_name as owner_site_name, + cu.emp_name as create_by_name, + uu.emp_name as update_by_name, + cs.site_name as create_site_name, + us.site_name as update_site_name, + lw.last_order_time + from emis_customer_user a + left join emis_country c on c.code = a.country + left join emis_region rp on rp.region_code = a.province + left join emis_region rc on rc.region_code = a.city + left join emis_region rco on rco.region_code = a.county + left join emis_site os on os.site_code = a.owner_site + left join sys_user cu on cu.user_id = a.create_by + left join sys_user uu on uu.user_id = a.update_by + left join emis_site cs on cs.site_code = a.create_site + left join emis_site us on us.site_code = a.update_site + left join (select customer_code, max(send_date) as last_order_time + from emis_waybill + group by customer_code) lw on lw.customer_code = a.customer_code