Compare commits
2 Commits
0c45cf184e
...
02dfdc675f
| Author | SHA1 | Date |
|---|---|---|
|
|
02dfdc675f | |
|
|
d726610bd5 |
|
|
@ -8,6 +8,7 @@ import com.nu.modules.servicetag.service.IServiceTagService;
|
|||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
|
@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -192,10 +194,21 @@ public class ServiceTagController extends JeecgController<ServiceTag, IServiceTa
|
|||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
QueryWrapper<ServiceTag> queryWrapper = QueryGenerator.initQueryWrapper(serviceTag, req.getParameterMap(),customeRuleMap);
|
||||
if(StringUtils.isEmpty(serviceTag.getEmployeesId())){
|
||||
return Result.error("员工id不能为空");
|
||||
}
|
||||
Page<ServiceTag> page = new Page<ServiceTag>(pageNo, pageSize);
|
||||
IPage<ServiceTag> pageList = serviceTagService.getEmployeesList(page, queryWrapper);
|
||||
IPage<ServiceTag> pageList = serviceTagService.getEmployeesList(page, serviceTag);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/getEmployessServiceTags")
|
||||
public Result<List<ServiceTag>> getEmployessServiceTags(ServiceTag serviceTag) {
|
||||
if(StringUtils.isEmpty(serviceTag.getEmployeesId())){
|
||||
return Result.error("员工id不能为空");
|
||||
}
|
||||
List<ServiceTag> pageList = serviceTagService.getEmployessServiceTags(serviceTag);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,5 +26,7 @@ public interface ServiceTagMapper extends BaseMapper<ServiceTag> {
|
|||
|
||||
Long queryTotal(@Param("serviceTag") ServiceTag serviceTag);
|
||||
|
||||
IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, @Param(Constants.WRAPPER) QueryWrapper<ServiceTag> queryWrapper);
|
||||
IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, ServiceTag serviceTag);
|
||||
|
||||
List<ServiceTag> getEmployessServiceTags(ServiceTag serviceTag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,56 +4,57 @@
|
|||
|
||||
<!-- 定义 resultMap -->
|
||||
<resultMap id="ServiceTagResultMap" type="com.nu.modules.servicetag.entity.ServiceTag">
|
||||
<id property="id" column="id"/>
|
||||
<result property="tagName" column="tag_name"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="izEnabled" column="iz_enabled"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<id property="id" column="id" />
|
||||
<result property="tagName" column="tag_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="izEnabled" column="iz_enabled" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<!-- 关联的指令列表 -->
|
||||
<collection property="directives" ofType="com.nu.modules.servicedirective.entity.ConfigServiceDirective">
|
||||
<id property="id" column="directive_id"/>
|
||||
<result property="directiveName" column="directive_name"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="instructionTagId" column="instruction_tag_id"/>
|
||||
<result property="tollPrice" column="toll_price"/>
|
||||
<result property="comPrice" column="com_price"/>
|
||||
<result property="izReimbursement" column="iz_reimbursement"/>
|
||||
<result property="izPreferential" column="iz_preferential"/>
|
||||
<result property="chargingFrequency" column="charging_frequency"/>
|
||||
<result property="cycleType" column="cycle_type"/>
|
||||
<result property="serviceContent" column="service_content"/>
|
||||
<result property="serviceDuration" column="service_duration"/>
|
||||
<result property="izEnabled" column="directive_iz_enabled"/>
|
||||
<result property="delFlag" column="directive_del_flag"/>
|
||||
<result property="createBy" column="directive_create_by"/>
|
||||
<result property="createTime" column="directive_create_time"/>
|
||||
<result property="updateBy" column="directive_update_by"/>
|
||||
<result property="updateTime" column="directive_update_time"/>
|
||||
<result property="sysOrgCode" column="directive_sys_org_code"/>
|
||||
<result property="mp3File" column="mp3_file"/>
|
||||
<result property="mp4File" column="mp4_file"/>
|
||||
<result property="categoryName" column="csc_category_name"/>
|
||||
<result property="typeName" column="cst_type_name"/>
|
||||
<id property="id" column="directive_id" />
|
||||
<result property="directiveName" column="directive_name" />
|
||||
<result property="categoryId" column="category_id" />
|
||||
<result property="typeId" column="type_id" />
|
||||
<result property="instructionTagId" column="instruction_tag_id" />
|
||||
<result property="tollPrice" column="toll_price" />
|
||||
<result property="comPrice" column="com_price" />
|
||||
<result property="izReimbursement" column="iz_reimbursement" />
|
||||
<result property="izPreferential" column="iz_preferential" />
|
||||
<result property="chargingFrequency" column="charging_frequency" />
|
||||
<result property="cycleType" column="cycle_type" />
|
||||
<result property="serviceContent" column="service_content" />
|
||||
<result property="serviceDuration" column="service_duration" />
|
||||
<result property="izEnabled" column="directive_iz_enabled" />
|
||||
<result property="delFlag" column="directive_del_flag" />
|
||||
<result property="createBy" column="directive_create_by" />
|
||||
<result property="createTime" column="directive_create_time" />
|
||||
<result property="updateBy" column="directive_update_by" />
|
||||
<result property="updateTime" column="directive_update_time" />
|
||||
<result property="sysOrgCode" column="directive_sys_org_code" />
|
||||
<result property="mp3File" column="mp3_file" />
|
||||
<result property="mp4File" column="mp4_file" />
|
||||
<result property="tagsName" column="tags_name" />
|
||||
<result property="categoryName" column="csc_category_name" />
|
||||
<result property="typeName" column="cst_type_name" />
|
||||
<result property="previewFile" column="preview_file"/>
|
||||
<result property="immediateFile" column="immediate_file"/>
|
||||
<!-- 关联的标签列表 -->
|
||||
<collection property="tagList" ofType="com.nu.modules.directivetag.entity.DirectiveTag">
|
||||
<id property="id" column="tag_id"/>
|
||||
<result property="tagName" column="cdt_tag_name"/>
|
||||
<result property="sort" column="tag_sort"/>
|
||||
<result property="izEnabled" column="tag_iz_enabled"/>
|
||||
<result property="delFlag" column="tag_del_flag"/>
|
||||
<result property="createBy" column="tag_create_by"/>
|
||||
<result property="createTime" column="tag_create_time"/>
|
||||
<result property="updateBy" column="tag_update_by"/>
|
||||
<result property="updateTime" column="tag_update_time"/>
|
||||
<result property="sysOrgCode" column="tag_sys_org_code"/>
|
||||
<id property="id" column="tag_id" />
|
||||
<result property="tagName" column="tag_name" />
|
||||
<result property="sort" column="tag_sort" />
|
||||
<result property="izEnabled" column="tag_iz_enabled" />
|
||||
<result property="delFlag" column="tag_del_flag" />
|
||||
<result property="createBy" column="tag_create_by" />
|
||||
<result property="createTime" column="tag_create_time" />
|
||||
<result property="updateBy" column="tag_update_by" />
|
||||
<result property="updateTime" column="tag_update_time" />
|
||||
<result property="sysOrgCode" column="tag_sys_org_code" />
|
||||
</collection>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
|
@ -95,16 +96,7 @@
|
|||
csd.mp4_file,
|
||||
csd.preview_file,
|
||||
csd.immediate_file,
|
||||
cdt.id AS tag_id,
|
||||
cdt.tag_name as cdt_tag_name,
|
||||
cdt.sort AS tag_sort,
|
||||
cdt.iz_enabled AS tag_iz_enabled,
|
||||
cdt.del_flag AS tag_del_flag,
|
||||
cdt.create_by AS tag_create_by,
|
||||
cdt.create_time AS tag_create_time,
|
||||
cdt.update_by AS tag_update_by,
|
||||
cdt.update_time AS tag_update_time,
|
||||
cdt.sys_org_code AS tag_sys_org_code,
|
||||
cdt.tag_name as tags_name,
|
||||
csc.category_name AS csc_category_name,
|
||||
cst.type_name AS cst_type_name
|
||||
FROM
|
||||
|
|
@ -114,12 +106,14 @@
|
|||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</where>
|
||||
) dp
|
||||
</where>) dp
|
||||
LEFT JOIN nu_servtag_directive sd ON dp.id = sd.tag_id
|
||||
LEFT JOIN nu_config_service_directive csd ON sd.directive_id = csd.id
|
||||
LEFT JOIN nu_directive_tag dt ON csd.id = dt.directive_id
|
||||
LEFT JOIN nu_config_directive_tag cdt ON dt.tag_id = cdt.id
|
||||
LEFT JOIN (
|
||||
select GROUP_CONCAT(c.tag_name) tag_name,b.directive_id from nu_directive_tag b
|
||||
LEFT JOIN nu_config_directive_tag c on b.tag_id = c.id
|
||||
GROUP BY b.directive_id
|
||||
) cdt on csd.id = cdt.directive_id
|
||||
LEFT JOIN nu_config_service_category csc ON csd.category_id = csc.id
|
||||
LEFT JOIN nu_config_service_type cst ON csd.type_id = cst.id
|
||||
order by dp.create_time desc
|
||||
|
|
@ -141,9 +135,7 @@
|
|||
</select>
|
||||
|
||||
<delete id="deleteDirectives">
|
||||
delete
|
||||
from nu_servtag_directive
|
||||
where tag_id = #{tag.id}
|
||||
delete from nu_servtag_directive where tag_id = #{tag.id}
|
||||
</delete>
|
||||
|
||||
<insert id="saveDirectives">
|
||||
|
|
@ -154,21 +146,25 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<select id="getEmployeesList" resultType="com.nu.modules.servicetag.entity.ServiceTag">
|
||||
select *
|
||||
from (select nst.id,
|
||||
nst.tag_name,
|
||||
nst.description,
|
||||
nst.sort,
|
||||
ifnull(est.id, '0') as employeesTagsId,
|
||||
nst.iz_enabled,
|
||||
nst.del_flag,
|
||||
nst.create_time,
|
||||
est.employees_id
|
||||
from nu_service_tag nst
|
||||
LEFT JOIN nu_biz_employees_servcie_tags est on nst.id = est.tags_id) a
|
||||
${ew.customSqlSegment}
|
||||
select nst.id ,nst.tag_name ,nst.description ,nst.sort,ifnull(est.id,'0') as employeesTagsId,nst.iz_enabled,nst.del_flag,nst.create_time,est.employees_id
|
||||
from nu_service_tag nst
|
||||
LEFT JOIN nu_biz_employees_servcie_tags est on nst.id = est.tags_id and est.employees_id = #{serviceTag.employeesId}
|
||||
where nst.del_flag = '0' and nst.iz_enabled = '0'
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getEmployessServiceTags" resultType="com.nu.modules.servicetag.entity.ServiceTag">
|
||||
select a.id,b.tag_name,b.description,a.create_time,b.id as employeesTagsId
|
||||
from nu_biz_employees_servcie_tags a
|
||||
LEFT JOIN nu_service_tag b on a.tags_id = b.id
|
||||
where a.employees_id = #{employeesId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.servicetag.entity.ServiceTag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 服务标签
|
||||
* @Author: 张明远
|
||||
|
|
@ -24,5 +26,7 @@ public interface IServiceTagService extends IService<ServiceTag> {
|
|||
|
||||
ServiceTag queryById(String id);
|
||||
|
||||
IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, QueryWrapper<ServiceTag> queryWrapper);
|
||||
IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, ServiceTag queryWrapper);
|
||||
|
||||
List<ServiceTag> getEmployessServiceTags(ServiceTag serviceTag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.nu.modules.servicetag.mapper.ServiceTagMapper;
|
|||
import com.nu.modules.servicetag.service.IServiceTagService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -59,9 +60,13 @@ public class ServiceTagServiceImpl extends ServiceImpl<ServiceTagMapper, Service
|
|||
}
|
||||
|
||||
@Override
|
||||
public IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, QueryWrapper<ServiceTag> queryWrapper) {
|
||||
queryWrapper.eq("iz_enabled","0");
|
||||
public IPage<ServiceTag> getEmployeesList(Page<ServiceTag> page, ServiceTag queryWrapper) {
|
||||
return baseMapper.getEmployeesList(page,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServiceTag> getEmployessServiceTags(ServiceTag serviceTag) {
|
||||
return baseMapper.getEmployessServiceTags(serviceTag);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue