Merge branch 'master' of http://git.xdadan.loc/tanex/emis-service into develop
This commit is contained in:
commit
b38d5fcfa6
@ -11,39 +11,32 @@
|
|||||||
|
|
||||||
package com.xdadan.erp.web.emis;
|
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.Log;
|
||||||
|
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||||
import com.xdadan.erp.common.enums.BusinessType;
|
import com.xdadan.erp.common.enums.BusinessType;
|
||||||
import com.xdadan.erp.common.utils.StringUtils;
|
import com.xdadan.erp.common.utils.StringUtils;
|
||||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||||
|
import com.xdadan.erp.emis.domain.EmisCountry;
|
||||||
import com.xdadan.erp.emis.service.IEmisCustomerUserService;
|
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.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.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 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
|
* 快递客户用户Controller
|
||||||
@ -98,9 +91,10 @@ public class EmisCustomerUserController extends EmisBaseController
|
|||||||
public TableDataInfo listMoneyUser(EmisCustomerUser emisCustomerUser)
|
public TableDataInfo listMoneyUser(EmisCustomerUser emisCustomerUser)
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
if(!(getLoginUser().getUser().isTopSite())){
|
setPrivParams(emisCustomerUser);
|
||||||
emisCustomerUser.setOwnerSite(getLoginUser().getUser().getOwnerSiteCode());
|
// if(!(getLoginUser().getUser().isTopSite())){
|
||||||
}
|
// emisCustomerUser.setOwnerSite(getLoginUser().getUser().getOwnerSiteCode());
|
||||||
|
// }
|
||||||
emisCustomerUser.setCustomerType("1");
|
emisCustomerUser.setCustomerType("1");
|
||||||
List<EmisCustomerUser> list = emisCustomerUserService.selectEmisCustomerUserList(emisCustomerUser);
|
List<EmisCustomerUser> list = emisCustomerUserService.selectEmisCustomerUserList(emisCustomerUser);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.xdadan.erp.emis.mapper.EmisCustomerUserMapper">
|
<mapper namespace="com.xdadan.erp.emis.mapper.EmisCustomerUserMapper">
|
||||||
|
|
||||||
<resultMap type="EmisCustomerUser" id="EmisCustomerUserResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
<resultMap type="EmisCustomerUser" id="EmisCustomerUserResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResultAll">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="customerCode" column="customer_code" />
|
<result property="customerCode" column="customer_code" />
|
||||||
<result property="customerName" column="customer_name" />
|
<result property="customerName" column="customer_name" />
|
||||||
@ -70,18 +70,12 @@
|
|||||||
<result property="payeeName" column="payee" />
|
<result property="payeeName" column="payee" />
|
||||||
<result property="salesmenName" column="salesmen" />
|
<result property="salesmenName" column="salesmen" />
|
||||||
|
|
||||||
<association property="countryName" column="country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
|
<result property="countryName" column="country_name"/>
|
||||||
<association property="provinceName" column="province" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
|
<result property="provinceName" column="province_name"/>
|
||||||
<association property="cityName" column="city" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
|
<result property="cityName" column="city_name"/>
|
||||||
<association property="countyName" column="county" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectRegionNameByCode"/>
|
<result property="countyName" column="county_name"/>
|
||||||
|
<result property="ownerSiteName" column="owner_site_name"/>
|
||||||
<association property="ownerSiteName" column="owner_site" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
<result property="lastOrderTime" column="last_order_time"/>
|
||||||
|
|
||||||
<!-- <association property="payeeName" column="payee" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>-->
|
|
||||||
<!-- <association property="salesmenName" column="salesmen" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>-->
|
|
||||||
<!-- <association property="opEmpName" column="op_emp_code" select="selectEmpNameByCode"/>-->
|
|
||||||
|
|
||||||
<association property="lastOrderTime" column="customer_code" select="selectLastOrderTimeByCustomerCode"/>
|
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
@ -92,16 +86,105 @@
|
|||||||
|
|
||||||
|
|
||||||
<sql id="selectEmisCustomerUserVo">
|
<sql id="selectEmisCustomerUserVo">
|
||||||
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
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- or FIND_IN_SET(#{ownerSite},biz_site)-->
|
<!-- or FIND_IN_SET(#{ownerSite},biz_site)-->
|
||||||
<select id="selectEmisCustomerUserList" parameterType="EmisCustomerUser" resultMap="EmisCustomerUserResult">
|
<select id="selectEmisCustomerUserList" parameterType="EmisCustomerUser" resultMap="EmisCustomerUserResult">
|
||||||
<include refid="selectEmisCustomerUserVo"/>
|
<include refid="selectEmisCustomerUserVo"/>
|
||||||
<where>
|
<where>
|
||||||
del_flag='0'
|
a.del_flag='0'
|
||||||
<if test="ownerSite != null and ownerSite != ''">
|
<if test="ownerSite != null and ownerSite != ''">
|
||||||
and ( owner_site=#{ownerSite} )
|
and owner_site = #{ownerSite}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="bizSite != null and bizSite != ''"> and ( FIND_IN_SET(#{bizSite},biz_site) or #{bizSite}=owner_site) </if>
|
<if test="bizSite != null and bizSite != ''"> and ( FIND_IN_SET(#{bizSite},biz_site) or #{bizSite}=owner_site) </if>
|
||||||
@ -153,10 +236,10 @@
|
|||||||
<if test="blSms != null and blSms != ''"> and bl_sms=#{blSms}</if>
|
<if test="blSms != null and blSms != ''"> and bl_sms=#{blSms}</if>
|
||||||
<if test="opEmpCode != null and opEmpCode != ''"> and op_emp_code like concat('%', #{opEmpCode}, '%')</if>
|
<if test="opEmpCode != null and opEmpCode != ''"> and op_emp_code like concat('%', #{opEmpCode}, '%')</if>
|
||||||
<if test="firstSigningDay != null and firstSigningDay != ''"> and first_signing_day like concat('%', #{firstSigningDay}, '%')</if>
|
<if test="firstSigningDay != null and firstSigningDay != ''"> and first_signing_day like concat('%', #{firstSigningDay}, '%')</if>
|
||||||
<if test="status != null and status != ''"> and status=#{status}</if>
|
<if test="status != null and status != ''"> and a.status=#{status}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num like concat('%', #{orderNum}, '%')</if>
|
<if test="orderNum != null and orderNum != ''"> and order_num like concat('%', #{orderNum}, '%')</if>
|
||||||
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
||||||
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
<if test="delFlag != null and delFlag != ''"> and a.del_flag like concat('%', #{delFlag}, '%')</if>
|
||||||
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
||||||
<if test="createTime != null "> and create_time = #{createTime}</if>
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||||
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
||||||
@ -169,6 +252,14 @@
|
|||||||
<if test="settleDay != null "> and settle_day = #{settleDay}</if>
|
<if test="settleDay != null "> and settle_day = #{settleDay}</if>
|
||||||
<if test="salesSupport != null and salesSupport != ''"> and sales_support = #{salesSupport}</if>
|
<if test="salesSupport != null and salesSupport != ''"> and sales_support = #{salesSupport}</if>
|
||||||
<if test="salesExecutive != null and salesExecutive != ''"> and sales_executive = #{salesExecutive}</if>
|
<if test="salesExecutive != null and salesExecutive != ''"> and sales_executive = #{salesExecutive}</if>
|
||||||
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||||
|
and (
|
||||||
|
a.salesmen=#{params.privEmpName}
|
||||||
|
or a.payee=#{params.privEmpName}
|
||||||
|
or exists (select 1 from emis_salesmen_rel rel where rel.del_flag='0' AND rel.bl_open='1' AND a.salesmen=rel.salesmen AND rel.sales_ass=#{params.privEmpName})
|
||||||
|
)
|
||||||
|
|
||||||
|
</if>
|
||||||
|
|
||||||
<choose>
|
<choose>
|
||||||
<when test="payee != null and payee != '' and salesmen != null and salesmen != ''">
|
<when test="payee != null and payee != '' and salesmen != null and salesmen != ''">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user