| | |
| | | // 不能用 roleid(菜单权限)判断,避免员工被授予角色 1 后被误当成运营商。 |
| | | list = storeService.listAll(page, provinceCode, cityCode, name, phone, shopName, null); |
| | | } |
| | | normalizePhoneFields(list); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 统一将列表 DTO 的底层字段写回非 null 值。 |
| | | * |
| | | * 部分运行环境使用字段序列化而非 JavaBean getter 序列化;仅在 getter 中做兜底时, |
| | | * 此类环境仍可能把原始 null 输出为 JSON null。这里在返回前固化字段值,保证三个 |
| | | * 数据范围的列表接口均稳定返回 phone、userPhone 两个字符串字段。 |
| | | */ |
| | | private void normalizePhoneFields(List<TStoreListVo> stores) { |
| | | for (TStoreListVo store : stores) { |
| | | store.setPhone(store.getPhone()); |
| | | store.setUserPhone(store.getUserPhone()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/listOne") |
| | |
| | | private Integer state; |
| | | |
| | | private String userName; |
| | | private String userPhone; |
| | | |
| | | /** |
| | | * 兼容历史门店:历史数据可能只在店长账号中保存手机号。 |
| | | * 列表对外的 phone 统一返回可用的店长手机号。 |
| | | * 列表手机号仅来自 t_store.phone,避免店长账号关联变化影响门店信息展示。 |
| | | */ |
| | | public String getPhone() { |
| | | return hasText(phone) ? phone : defaultString(userPhone); |
| | | } |
| | | |
| | | /** |
| | | * 兼容历史门店:当店长资料中未维护 phone 时,列表仍返回可用的门店手机号。 |
| | | * 返回空字符串而非 null,避免不同环境的 JSON 忽略 null 配置导致字段消失。 |
| | | */ |
| | | public String getUserPhone() { |
| | | return hasText(userPhone) ? userPhone : defaultString(phone); |
| | | } |
| | | |
| | | private boolean hasText(String value) { |
| | | return value != null && !value.trim().isEmpty(); |
| | | } |
| | | |
| | | private String defaultString(String value) { |
| | | return value == null ? "" : value; |
| | | return phone == null ? "" : phone; |
| | | } |
| | | |
| | | private String account; |
| | |
| | | <select id="listAll" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | coalesce(t2.name, t4.name) as userName, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | coalesce(t1.phone, '') as phone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and coalesce(t2.name, t4.name) like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <select id="listAllStore" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | coalesce(t2.name, t4.name) as userName, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | coalesce(t1.phone, '') as phone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and coalesce(t2.name, t4.name) like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <select id="listAllStoresByIds" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | coalesce(t2.name, t4.name) as userName, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | coalesce(t1.phone, '') as phone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and coalesce(t2.name, t4.name) like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | }, |
| | | {title: '店长姓名', field: 'userName', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '店长手机号', field: 'userPhone', visible: true, align: 'center', valign: 'middle' |
| | | {title: '店长手机号', field: 'phone', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | ,formatter:function (data) { |