服务考核-列表展示、审核提交
This commit is contained in:
parent
62c37c01fa
commit
ae18951786
|
|
@ -5,13 +5,13 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.HashMap;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
||||||
import com.nu.modules.biz.appraisal.entity.AppraisalSub;
|
import com.nu.modules.biz.appraisal.entity.AppraisalSub;
|
||||||
import com.nu.modules.biz.appraisal.service.IAppraisalService;
|
import com.nu.modules.biz.appraisal.service.IAppraisalService;
|
||||||
import com.nu.modules.biz.appraisal.service.IAppraisalSubService;
|
import com.nu.modules.biz.appraisal.service.IAppraisalSubService;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
|
@ -21,7 +21,6 @@ import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -31,13 +30,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -59,7 +55,7 @@ public class AppraisalController {
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param Appraisal
|
* @param appraisal
|
||||||
* @param pageNo
|
* @param pageNo
|
||||||
* @param pageSize
|
* @param pageSize
|
||||||
* @param req
|
* @param req
|
||||||
|
|
@ -68,37 +64,59 @@ public class AppraisalController {
|
||||||
//@AutoLog(value = "服务指令工单-分页列表查询")
|
//@AutoLog(value = "服务指令工单-分页列表查询")
|
||||||
@ApiOperation(value="服务指令工单-分页列表查询", notes="服务指令工单-分页列表查询")
|
@ApiOperation(value="服务指令工单-分页列表查询", notes="服务指令工单-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<IPage<Appraisal>> queryPageList(Appraisal Appraisal,
|
public Result<IPage<Appraisal>> queryPageList(Appraisal appraisal,
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
// 自定义查询规则
|
// // 自定义查询规则
|
||||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
// Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
// // 自定义多选的查询规则为:LIKE_WITH_OR
|
||||||
customeRuleMap.put("startTime", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("startTime", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("endTime", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("endTime", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("appraisalStatus", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("appraisalStatus", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("orderNo", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("orderNo", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("orderType", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("orderType", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("optType", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("optType", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("nuId", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("nuId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("employeeId", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("employeeId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("elderId", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("elderId", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("izPackage", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("izPackage", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("izFinish", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("izFinish", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
customeRuleMap.put("izTimeout", QueryRuleEnum.LIKE_WITH_OR);
|
// customeRuleMap.put("izTimeout", QueryRuleEnum.LIKE_WITH_OR);
|
||||||
QueryWrapper<Appraisal> queryWrapper = QueryGenerator.initQueryWrapper(Appraisal, req.getParameterMap(),customeRuleMap);
|
// QueryWrapper<Appraisal> queryWrapper = QueryGenerator.initQueryWrapper(appraisal, req.getParameterMap(),customeRuleMap);
|
||||||
|
// Page<Appraisal> page = new Page<Appraisal>(pageNo, pageSize);
|
||||||
|
// if(appraisal.getStartTime()!=null){
|
||||||
|
// queryWrapper.ge("create_time",appraisal.getStartTime());
|
||||||
|
// }
|
||||||
|
// if(appraisal.getEndTime()!=null){
|
||||||
|
// queryWrapper.le("create_time",appraisal.getEndTime());
|
||||||
|
// }
|
||||||
|
// IPage<Appraisal> pageList = service.page(page, queryWrapper);
|
||||||
|
|
||||||
Page<Appraisal> page = new Page<Appraisal>(pageNo, pageSize);
|
Page<Appraisal> page = new Page<Appraisal>(pageNo, pageSize);
|
||||||
if(Appraisal.getStartTime()!=null){
|
IPage<Appraisal> pageList = service.findPage(page, appraisal);
|
||||||
queryWrapper.ge("create_time",Appraisal.getStartTime());
|
|
||||||
}
|
|
||||||
if(Appraisal.getEndTime()!=null){
|
|
||||||
queryWrapper.le("create_time",Appraisal.getEndTime());
|
|
||||||
}
|
|
||||||
IPage<Appraisal> pageList = service.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核
|
||||||
|
*
|
||||||
|
* @param appraisal
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "服务指令工单-审核")
|
||||||
|
@ApiOperation(value="服务指令工单-审核", notes="服务指令工单-审核")
|
||||||
|
// @RequiresPermissions("Appraisal:nu_biz_nu_directive_order:edit")
|
||||||
|
@RequestMapping(value = "/approval", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> approval(@RequestBody Appraisal appraisal) {
|
||||||
|
Appraisal AppraisalEntity = service.getById(appraisal.getId());
|
||||||
|
if(AppraisalEntity==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
service.updateById(appraisal);
|
||||||
|
return Result.OK("审核成功!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
|
|
@ -199,13 +217,13 @@ public class AppraisalController {
|
||||||
* 导出excel
|
* 导出excel
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param Appraisal
|
* @param appraisal
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("Appraisal:nu_biz_nu_directive_order:exportXls")
|
// @RequiresPermissions("Appraisal:nu_biz_nu_directive_order:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, Appraisal Appraisal) {
|
public ModelAndView exportXls(HttpServletRequest request, Appraisal appraisal) {
|
||||||
// Step.1 组装查询条件查询数据
|
// Step.1 组装查询条件查询数据
|
||||||
QueryWrapper<Appraisal> queryWrapper = QueryGenerator.initQueryWrapper(Appraisal, request.getParameterMap());
|
QueryWrapper<Appraisal> queryWrapper = QueryGenerator.initQueryWrapper(appraisal, request.getParameterMap());
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
||||||
//配置选中数据查询条件
|
//配置选中数据查询条件
|
||||||
|
|
@ -222,16 +240,16 @@ public class AppraisalController {
|
||||||
for (Appraisal main : AppraisalList) {
|
for (Appraisal main : AppraisalList) {
|
||||||
Appraisal vo = new Appraisal();
|
Appraisal vo = new Appraisal();
|
||||||
BeanUtils.copyProperties(main, vo);
|
BeanUtils.copyProperties(main, vo);
|
||||||
List<AppraisalSub> nuBizNuAppraisalSubList = subService.selectByMainId(main.getId());
|
List<AppraisalSub> appraisalSubList = subService.selectByMainId(main.getId());
|
||||||
vo.setAppraisalSubList(nuBizNuAppraisalSubList);
|
vo.setAppraisalSubList(appraisalSubList);
|
||||||
pageList.add(vo);
|
pageList.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step.4 AutoPoi 导出Excel
|
// Step.4 AutoPoi 导出Excel
|
||||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||||
mv.addObject(NormalExcelConstants.FILE_NAME, "服务指令工单列表");
|
mv.addObject(NormalExcelConstants.FILE_NAME, "服务考核列表");
|
||||||
mv.addObject(NormalExcelConstants.CLASS, Appraisal.class);
|
mv.addObject(NormalExcelConstants.CLASS, Appraisal.class);
|
||||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("服务指令工单数据", "导出人:"+sysUser.getRealname(), "服务指令工单"));
|
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("服务考核数据", "导出人:"+sysUser.getRealname(), "服务考核"));
|
||||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||||
return mv;
|
return mv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,9 @@ public class Appraisal implements Serializable {
|
||||||
/**考核人*/
|
/**考核人*/
|
||||||
@Excel(name = "考核人", width = 15)
|
@Excel(name = "考核人", width = 15)
|
||||||
private String appraisalName;
|
private String appraisalName;
|
||||||
|
/**考核意见*/
|
||||||
|
@Excel(name = "考核意见", width = 15)
|
||||||
|
private String appraisalComments;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<AppraisalSub> appraisalSubList;
|
private List<AppraisalSub> appraisalSubList;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.nu.modules.biz.appraisal.mapper;
|
package com.nu.modules.biz.appraisal.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
|
@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
*/
|
*/
|
||||||
public interface AppraisalMapper extends BaseMapper<Appraisal> {
|
public interface AppraisalMapper extends BaseMapper<Appraisal> {
|
||||||
|
|
||||||
|
IPage<Appraisal> findPage(Page<Appraisal> page,@Param("params") Appraisal appraisal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public interface AppraisalSubMapper extends BaseMapper<AppraisalSub> {
|
||||||
* @param mainId 主表id
|
* @param mainId 主表id
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean deleteByMainId(@Param("mainId") String mainId);
|
boolean deleteByMainId(@Param("mainId") String mainId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过主表id查询子表数据
|
* 通过主表id查询子表数据
|
||||||
|
|
@ -27,5 +27,5 @@ public interface AppraisalSubMapper extends BaseMapper<AppraisalSub> {
|
||||||
* @param mainId 主表id
|
* @param mainId 主表id
|
||||||
* @return List<NuBizNuDirectiveOrderSub>
|
* @return List<NuBizNuDirectiveOrderSub>
|
||||||
*/
|
*/
|
||||||
public List<AppraisalSub> selectByMainId(@Param("mainId") String mainId);
|
List<AppraisalSub> selectByMainId(@Param("mainId") String mainId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,274 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.nu.modules.biz.appraisal.mapper.AppraisalMapper">
|
<mapper namespace="com.nu.modules.biz.appraisal.mapper.AppraisalMapper">
|
||||||
|
|
||||||
|
<resultMap id="AppraisalMap" type="com.nu.modules.biz.appraisal.entity.Appraisal">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="order_no" property="orderNo"/>
|
||||||
|
<result column="order_type" property="orderType"/>
|
||||||
|
<result column="opt_type" property="optType"/>
|
||||||
|
<result column="pool_id" property="poolId"/>
|
||||||
|
<result column="biz_id" property="bizId"/>
|
||||||
|
<result column="biz_type" property="bizType"/>
|
||||||
|
<result column="nu_id" property="nuId"/>
|
||||||
|
<result column="nu_name" property="nuName"/>
|
||||||
|
<result column="elder_id" property="elderId"/>
|
||||||
|
<result column="elder_name" property="elderName"/>
|
||||||
|
<result column="employee_id" property="employeeId"/>
|
||||||
|
<result column="employee_name" property="employeeName"/>
|
||||||
|
<result column="directive_id" property="directiveId"/>
|
||||||
|
<result column="directive_name" property="directiveName"/>
|
||||||
|
<result column="cycle_type_id" property="cycleTypeId"/>
|
||||||
|
<result column="cycle_type" property="cycleType"/>
|
||||||
|
<result column="cycle_value" property="cycleValue"/>
|
||||||
|
<result column="preview_file" property="previewFile"/>
|
||||||
|
<result column="preview_file_small" property="previewFileSmall"/>
|
||||||
|
<result column="mp3_file" property="mp3File"/>
|
||||||
|
<result column="mp4_file" property="mp4File"/>
|
||||||
|
<result column="service_duration" property="serviceDuration"/>
|
||||||
|
<result column="service_content" property="serviceContent"/>
|
||||||
|
<result column="iz_package" property="izPackage"/>
|
||||||
|
<result column="toll_price" property="tollPrice"/>
|
||||||
|
<result column="com_price" property="comPrice"/>
|
||||||
|
<result column="real_com_price" property="realComPrice"/>
|
||||||
|
<result column="start_time" property="startTime"/>
|
||||||
|
<result column="end_time" property="endTime"/>
|
||||||
|
<result column="begin_emp" property="beginEmp"/>
|
||||||
|
<result column="begin_time" property="beginTime"/>
|
||||||
|
<result column="finish_emp" property="finishEmp"/>
|
||||||
|
<result column="finish_time" property="finishTime"/>
|
||||||
|
<result column="iz_start" property="izStart"/>
|
||||||
|
<result column="iz_finish" property="izFinish"/>
|
||||||
|
<result column="initiator_id" property="initiatorId"/>
|
||||||
|
<result column="initiator_name" property="initiatorName"/>
|
||||||
|
<result column="create_by" property="createBy"/>
|
||||||
|
<result column="create_emp" property="createEmp"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_by" property="updateBy"/>
|
||||||
|
<result column="update_emp" property="updateEmp"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="del_flag" property="delFlag"/>
|
||||||
|
<result column="remarks" property="remarks"/>
|
||||||
|
<result column="timeout_duration" property="timeoutDuration"/>
|
||||||
|
<result column="iz_timeout" property="izTimeout"/>
|
||||||
|
<result column="opt_ids" property="optIds"/>
|
||||||
|
<result column="opt_names" property="optNames"/>
|
||||||
|
<result column="manually_pic_path" property="manuallyPicPath"/>
|
||||||
|
<result column="manually_mp4_path" property="manuallyMp4Path"/>
|
||||||
|
<result column="appraisal_status" property="appraisalStatus"/>
|
||||||
|
<result column="appraisal_time" property="appraisalTime"/>
|
||||||
|
<result column="appraisal_id" property="appraisalId"/>
|
||||||
|
<result column="appraisal_name" property="appraisalName"/>
|
||||||
|
<result column="appraisal_comments" property="appraisalComments"/>
|
||||||
|
<collection property="appraisalSubList" ofType="com.nu.modules.biz.appraisal.entity.AppraisalSub">
|
||||||
|
<id column="sub_id" property="id"/>
|
||||||
|
<result column="sub_order_no" property="orderNo"/>
|
||||||
|
<result column="sub_order_type" property="orderType"/>
|
||||||
|
<result column="sub_opt_type" property="optType"/>
|
||||||
|
<result column="sub_main_id" property="mainId"/>
|
||||||
|
<result column="sub_nu_id" property="nuId"/>
|
||||||
|
<result column="sub_nu_name" property="nuName"/>
|
||||||
|
<result column="sub_elder_id" property="elderId"/>
|
||||||
|
<result column="sub_elder_name" property="elderName"/>
|
||||||
|
<result column="sub_employee_id" property="employeeId"/>
|
||||||
|
<result column="sub_employee_name" property="employeeName"/>
|
||||||
|
<result column="sub_instruction_tag_id" property="instructionTagId"/>
|
||||||
|
<result column="sub_instruction_tag_name" property="instructionTagName"/>
|
||||||
|
<result column="sub_category_id" property="categoryId"/>
|
||||||
|
<result column="sub_category_name" property="categoryName"/>
|
||||||
|
<result column="sub_type_id" property="typeId"/>
|
||||||
|
<result column="sub_type_name" property="typeName"/>
|
||||||
|
<result column="sub_directive_id" property="directiveId"/>
|
||||||
|
<result column="sub_directive_name" property="directiveName"/>
|
||||||
|
<result column="sub_cycle_type_id" property="cycleTypeId"/>
|
||||||
|
<result column="sub_cycle_type" property="cycleType"/>
|
||||||
|
<result column="sub_cycle_value" property="cycleValue"/>
|
||||||
|
<result column="sub_preview_file" property="previewFile"/>
|
||||||
|
<result column="sub_preview_file_small" property="previewFileSmall"/>
|
||||||
|
<result column="sub_mp3_file" property="mp3File"/>
|
||||||
|
<result column="sub_mp4_file" property="mp4File"/>
|
||||||
|
<result column="sub_service_duration" property="serviceDuration"/>
|
||||||
|
<result column="sub_service_content" property="serviceContent"/>
|
||||||
|
<result column="sub_toll_price" property="tollPrice"/>
|
||||||
|
<result column="sub_com_price" property="comPrice"/>
|
||||||
|
<result column="sub_real_com_price" property="realComPrice"/>
|
||||||
|
<result column="sub_package_id" property="packageId"/>
|
||||||
|
<result column="sub_package_name" property="packageName"/>
|
||||||
|
<result column="sub_iz_package" property="izPackage"/>
|
||||||
|
<result column="sub_start_time" property="startTime"/>
|
||||||
|
<result column="sub_end_time" property="endTime"/>
|
||||||
|
<result column="sub_begin_time" property="beginTime"/>
|
||||||
|
<result column="sub_finish_time" property="finishTime"/>
|
||||||
|
<result column="sub_iz_start" property="izStart"/>
|
||||||
|
<result column="sub_iz_finish" property="izFinish"/>
|
||||||
|
<result column="sub_timeout_duration" property="timeoutDuration"/>
|
||||||
|
<result column="sub_create_by" property="createBy"/>
|
||||||
|
<result column="sub_create_time" property="createTime"/>
|
||||||
|
<result column="sub_update_by" property="updateBy"/>
|
||||||
|
<result column="sub_update_time" property="updateTime"/>
|
||||||
|
<result column="sub_del_flag" property="delFlag"/>
|
||||||
|
<result column="sub_tplink_path" property="tplinkPath"/>
|
||||||
|
<result column="sub_manually_pic_path" property="manuallyPicPath"/>
|
||||||
|
<result column="sub_manually_mp4_path" property="manuallyMp4Path"/>
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="baseSelect">
|
||||||
|
SELECT o.id,
|
||||||
|
o.order_no,
|
||||||
|
o.order_type,
|
||||||
|
o.opt_type,
|
||||||
|
o.pool_id,
|
||||||
|
o.biz_id,
|
||||||
|
o.biz_type,
|
||||||
|
o.nu_id,
|
||||||
|
o.nu_name,
|
||||||
|
o.elder_id,
|
||||||
|
o.elder_name,
|
||||||
|
o.employee_id,
|
||||||
|
o.employee_name,
|
||||||
|
o.directive_id,
|
||||||
|
o.directive_name,
|
||||||
|
o.cycle_type_id,
|
||||||
|
o.cycle_type,
|
||||||
|
o.cycle_value,
|
||||||
|
o.preview_file,
|
||||||
|
o.preview_file_small,
|
||||||
|
o.mp3_file,
|
||||||
|
o.mp4_file,
|
||||||
|
o.service_duration,
|
||||||
|
o.service_content,
|
||||||
|
o.iz_package,
|
||||||
|
o.toll_price,
|
||||||
|
o.com_price,
|
||||||
|
o.real_com_price,
|
||||||
|
o.start_time,
|
||||||
|
o.end_time,
|
||||||
|
o.begin_emp,
|
||||||
|
o.begin_time,
|
||||||
|
o.finish_emp,
|
||||||
|
o.finish_time,
|
||||||
|
o.iz_start,
|
||||||
|
o.iz_finish,
|
||||||
|
o.initiator_id,
|
||||||
|
o.initiator_name,
|
||||||
|
o.create_by,
|
||||||
|
o.create_emp,
|
||||||
|
o.create_time,
|
||||||
|
o.update_by,
|
||||||
|
o.update_emp,
|
||||||
|
o.update_time,
|
||||||
|
o.del_flag,
|
||||||
|
o.remarks,
|
||||||
|
o.timeout_duration,
|
||||||
|
o.iz_timeout,
|
||||||
|
o.opt_ids,
|
||||||
|
o.opt_names,
|
||||||
|
o.manually_pic_path,
|
||||||
|
o.manually_mp4_path,
|
||||||
|
ifnull(o.appraisal_status,'0') as appraisal_status,
|
||||||
|
o.appraisal_time,
|
||||||
|
o.appraisal_id,
|
||||||
|
o.appraisal_name,
|
||||||
|
o.appraisal_comments,
|
||||||
|
s.id as sub_id,
|
||||||
|
s.order_no as sub_order_no,
|
||||||
|
s.order_type as sub_order_type,
|
||||||
|
s.opt_type as sub_opt_type,
|
||||||
|
s.main_id as sub_main_id,
|
||||||
|
s.nu_id as sub_nu_id,
|
||||||
|
s.nu_name as sub_nu_name,
|
||||||
|
s.elder_id as sub_elder_id,
|
||||||
|
s.elder_name as sub_elder_name,
|
||||||
|
s.employee_id as sub_employee_id,
|
||||||
|
s.employee_name as sub_employee_name,
|
||||||
|
s.instruction_tag_id as sub_instruction_tag_id,
|
||||||
|
s.instruction_tag_name as sub_instruction_tag_name,
|
||||||
|
s.category_id as sub_category_id,
|
||||||
|
s.category_name as sub_category_name,
|
||||||
|
s.type_id as sub_type_id,
|
||||||
|
s.type_name as sub_type_name,
|
||||||
|
s.directive_id as sub_directive_id,
|
||||||
|
s.directive_name as sub_directive_name,
|
||||||
|
s.cycle_type_id as sub_cycle_type_id,
|
||||||
|
s.cycle_type as sub_cycle_type,
|
||||||
|
s.cycle_value as sub_cycle_value,
|
||||||
|
s.preview_file as sub_preview_file,
|
||||||
|
s.preview_file_small as sub_preview_file_small,
|
||||||
|
s.mp3_file as sub_mp3_file,
|
||||||
|
s.mp4_file as sub_mp4_file,
|
||||||
|
s.service_duration as sub_service_duration,
|
||||||
|
s.service_content as sub_service_content,
|
||||||
|
s.toll_price as sub_toll_price,
|
||||||
|
s.com_price as sub_com_price,
|
||||||
|
s.real_com_price as sub_real_com_price,
|
||||||
|
s.package_id as sub_package_id,
|
||||||
|
s.package_name as sub_package_name,
|
||||||
|
s.iz_package as sub_iz_package,
|
||||||
|
s.start_time as sub_start_time,
|
||||||
|
s.end_time as sub_end_time,
|
||||||
|
s.begin_time as sub_begin_time,
|
||||||
|
s.finish_time as sub_finish_time,
|
||||||
|
s.iz_start as sub_iz_start,
|
||||||
|
s.iz_finish as sub_iz_finish,
|
||||||
|
s.timeout_duration as sub_timeout_duration,
|
||||||
|
s.create_by as sub_create_by,
|
||||||
|
s.create_time as sub_create_time,
|
||||||
|
s.update_by as sub_update_by,
|
||||||
|
s.update_time as sub_update_time,
|
||||||
|
s.del_flag as sub_del_flag,
|
||||||
|
s.tplink_path as sub_tplink_path,
|
||||||
|
s.manually_pic_path as sub_manually_pic_path,
|
||||||
|
s.manually_mp4_path as sub_manually_mp4_path
|
||||||
|
FROM nu_biz_nu_directive_order o
|
||||||
|
LEFT JOIN nu_biz_nu_directive_order_sub s ON o.id = s.main_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="findPage" resultMap="AppraisalMap">
|
||||||
|
<include refid="baseSelect"/>
|
||||||
|
<where>
|
||||||
|
<if test="params.startTime != null">
|
||||||
|
AND o.create_time >= #{params.startTime}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTime != null">
|
||||||
|
AND o.create_time <= #{params.endTime}
|
||||||
|
</if>
|
||||||
|
<if test="params.employeeId != null and params.employeeId != ''">
|
||||||
|
AND (
|
||||||
|
<foreach item="optId" index="index" collection="params.employeeId.split(',')"
|
||||||
|
open="(" separator="or" close=")">
|
||||||
|
FIND_IN_SET(#{optId}, o.opt_ids) > 0
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="params.appraisalStatus != null and params.appraisalStatus != ''">
|
||||||
|
AND ifnull(o.appraisal_status,'0') = #{params.appraisalStatus}
|
||||||
|
</if>
|
||||||
|
<if test="params.orderNo != null and params.orderNo != ''">
|
||||||
|
AND o.order_no LIKE concat('%',#{params.orderNo},'%')
|
||||||
|
</if>
|
||||||
|
<if test="params.orderType != null and params.orderType != ''">
|
||||||
|
AND o.order_type = #{params.orderType}
|
||||||
|
</if>
|
||||||
|
<if test="params.optType != null and params.optType != ''">
|
||||||
|
AND o.opt_type = #{params.optType}
|
||||||
|
</if>
|
||||||
|
<if test="params.nuId != null and params.nuId != ''">
|
||||||
|
AND o.nu_id = #{params.nuId}
|
||||||
|
</if>
|
||||||
|
<if test="params.elderId != null and params.elderId != ''">
|
||||||
|
AND o.elder_id = #{params.elderId}
|
||||||
|
</if>
|
||||||
|
<if test="params.izPackage != null and params.izPackage != ''">
|
||||||
|
AND o.iz_package = #{params.izPackage}
|
||||||
|
</if>
|
||||||
|
<if test="params.izFinish != null and params.izFinish != ''">
|
||||||
|
AND o.iz_finish = #{params.izFinish}
|
||||||
|
</if>
|
||||||
|
<if test="params.izTimeout != null and params.izTimeout != ''">
|
||||||
|
AND o.iz_timeout = #{params.izTimeout}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY o.start_time, s.start_time
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
package com.nu.modules.biz.appraisal.service;
|
package com.nu.modules.biz.appraisal.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
||||||
import com.nu.modules.biz.appraisal.entity.AppraisalSub;
|
import com.nu.modules.biz.appraisal.entity.AppraisalSub;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -16,34 +17,36 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface IAppraisalService extends IService<Appraisal> {
|
public interface IAppraisalService extends IService<Appraisal> {
|
||||||
|
|
||||||
|
IPage<Appraisal> findPage(Page<Appraisal> page, Appraisal appraisal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加一对多
|
* 添加一对多
|
||||||
*
|
*
|
||||||
* @param Appraisal
|
* @param appraisal
|
||||||
* @param appraisalSubList
|
* @param appraisalSubList
|
||||||
*/
|
*/
|
||||||
public void saveMain(Appraisal Appraisal,List<AppraisalSub> appraisalSubList) ;
|
void saveMain(Appraisal appraisal,List<AppraisalSub> appraisalSubList) ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改一对多
|
* 修改一对多
|
||||||
*
|
*
|
||||||
* @param Appraisal
|
* @param appraisal
|
||||||
* @param appraisalSubList
|
* @param appraisalSubList
|
||||||
*/
|
*/
|
||||||
public void updateMain(Appraisal Appraisal,List<AppraisalSub> appraisalSubList);
|
void updateMain(Appraisal appraisal,List<AppraisalSub> appraisalSubList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除一对多
|
* 删除一对多
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
public void delMain (String id);
|
void delMain (String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除一对多
|
* 批量删除一对多
|
||||||
*
|
*
|
||||||
* @param idList
|
* @param idList
|
||||||
*/
|
*/
|
||||||
public void delBatchMain (Collection<? extends Serializable> idList);
|
void delBatchMain (Collection<? extends Serializable> idList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,5 @@ public interface IAppraisalSubService extends IService<AppraisalSub> {
|
||||||
* @param mainId 主表id
|
* @param mainId 主表id
|
||||||
* @return List<NuBizNuDirectiveOrderSub>
|
* @return List<NuBizNuDirectiveOrderSub>
|
||||||
*/
|
*/
|
||||||
public List<AppraisalSub> selectByMainId(String mainId);
|
List<AppraisalSub> selectByMainId(String mainId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
package com.nu.modules.biz.appraisal.service.impl;
|
package com.nu.modules.biz.appraisal.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
import com.nu.modules.biz.appraisal.entity.Appraisal;
|
||||||
import com.nu.modules.biz.appraisal.entity.AppraisalSub;
|
import com.nu.modules.biz.appraisal.entity.AppraisalSub;
|
||||||
import com.nu.modules.biz.appraisal.mapper.AppraisalMapper;
|
import com.nu.modules.biz.appraisal.mapper.AppraisalMapper;
|
||||||
import com.nu.modules.biz.appraisal.mapper.AppraisalSubMapper;
|
import com.nu.modules.biz.appraisal.mapper.AppraisalSubMapper;
|
||||||
import com.nu.modules.biz.appraisal.service.IAppraisalService;
|
import com.nu.modules.biz.appraisal.service.IAppraisalService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -25,14 +28,19 @@ public class AppraisalServiceImpl extends ServiceImpl<AppraisalMapper, Appraisal
|
||||||
@Autowired
|
@Autowired
|
||||||
private AppraisalSubMapper subMapper;
|
private AppraisalSubMapper subMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<Appraisal> findPage(Page<Appraisal> page, Appraisal appraisal){
|
||||||
|
return baseMapper.findPage(page,appraisal);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveMain(Appraisal Appraisal, List<AppraisalSub> AppraisalSubList) {
|
public void saveMain(Appraisal appraisal, List<AppraisalSub> appraisalSubList) {
|
||||||
baseMapper.insert(Appraisal);
|
baseMapper.insert(appraisal);
|
||||||
if(AppraisalSubList!=null && AppraisalSubList.size()>0) {
|
if(appraisalSubList!=null && appraisalSubList.size()>0) {
|
||||||
for(AppraisalSub entity:AppraisalSubList) {
|
for(AppraisalSub entity:appraisalSubList) {
|
||||||
//外键设置
|
//外键设置
|
||||||
entity.setMainId(Appraisal.getId());
|
entity.setMainId(appraisal.getId());
|
||||||
subMapper.insert(entity);
|
subMapper.insert(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -40,17 +48,17 @@ public class AppraisalServiceImpl extends ServiceImpl<AppraisalMapper, Appraisal
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateMain(Appraisal Appraisal,List<AppraisalSub> AppraisalSubList) {
|
public void updateMain(Appraisal appraisal,List<AppraisalSub> appraisalSubList) {
|
||||||
baseMapper.updateById(Appraisal);
|
baseMapper.updateById(appraisal);
|
||||||
|
|
||||||
//1.先删除子表数据
|
//1.先删除子表数据
|
||||||
subMapper.deleteByMainId(Appraisal.getId());
|
subMapper.deleteByMainId(appraisal.getId());
|
||||||
|
|
||||||
//2.子表数据重新插入
|
//2.子表数据重新插入
|
||||||
if(AppraisalSubList!=null && AppraisalSubList.size()>0) {
|
if(appraisalSubList!=null && appraisalSubList.size()>0) {
|
||||||
for(AppraisalSub entity:AppraisalSubList) {
|
for(AppraisalSub entity:appraisalSubList) {
|
||||||
//外键设置
|
//外键设置
|
||||||
entity.setMainId(Appraisal.getId());
|
entity.setMainId(appraisal.getId());
|
||||||
subMapper.insert(entity);
|
subMapper.insert(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue