Commit d4ea6ff6 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.9' into MVP1.7.9

parents 4f683551 e36e96bc
...@@ -54,9 +54,8 @@ public class TEmployeeInsurancePreController { ...@@ -54,9 +54,8 @@ public class TEmployeeInsurancePreController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('insurances_temployeeinsurancepre_get')") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" ) @GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_get')" )
public R<TEmployeeInsurancePre> getById(@PathVariable("id" ) String id) { public R<TEmployeeInsurancePre> getById(@PathVariable("id" ) String id) {
return R.ok(tEmployeeInsurancePreService.getById(id)); return R.ok(tEmployeeInsurancePreService.getById(id));
} }
...@@ -66,10 +65,9 @@ public class TEmployeeInsurancePreController { ...@@ -66,10 +65,9 @@ public class TEmployeeInsurancePreController {
* @param tEmployeeInsurancePre 商险待办任务表 * @param tEmployeeInsurancePre 商险待办任务表
* @return R * @return R
*/ */
@Operation(summary = "新增商险待办任务表", description = "新增商险待办任务表:hasPermission('insurances_temployeeinsurancepre_add')") @Operation(summary = "新增商险待办任务表", description = "新增商险待办任务表")
@SysLog("新增商险待办任务表" ) @SysLog("新增商险待办任务表" )
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_add')" )
public R<Boolean> save(@RequestBody TEmployeeInsurancePre tEmployeeInsurancePre) { public R<Boolean> save(@RequestBody TEmployeeInsurancePre tEmployeeInsurancePre) {
return R.ok(tEmployeeInsurancePreService.save(tEmployeeInsurancePre)); return R.ok(tEmployeeInsurancePreService.save(tEmployeeInsurancePre));
} }
...@@ -79,10 +77,9 @@ public class TEmployeeInsurancePreController { ...@@ -79,10 +77,9 @@ public class TEmployeeInsurancePreController {
* @param tEmployeeInsurancePre 商险待办任务表 * @param tEmployeeInsurancePre 商险待办任务表
* @return R * @return R
*/ */
@Operation(summary = "修改商险待办任务表", description = "修改商险待办任务表:hasPermission('insurances_temployeeinsurancepre_edit')") @Operation(summary = "修改商险待办任务表", description = "修改商险待办任务表")
@SysLog("修改商险待办任务表" ) @SysLog("修改商险待办任务表" )
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_edit')" )
public R<Boolean> updateById(@RequestBody TEmployeeInsurancePre tEmployeeInsurancePre) { public R<Boolean> updateById(@RequestBody TEmployeeInsurancePre tEmployeeInsurancePre) {
return R.ok(tEmployeeInsurancePreService.updateById(tEmployeeInsurancePre)); return R.ok(tEmployeeInsurancePreService.updateById(tEmployeeInsurancePre));
} }
...@@ -105,9 +102,8 @@ public class TEmployeeInsurancePreController { ...@@ -105,9 +102,8 @@ public class TEmployeeInsurancePreController {
* @author huych * @author huych
* @date 2025-03-31 12:25:13 * @date 2025-03-31 12:25:13
**/ **/
@Operation(description = "导出商险待办任务表 hasPermission('insurances_temployeeinsurancepre-export')") @Operation(description = "导出商险待办任务表")
@PostMapping("/export") @PostMapping("/export")
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre-export')")
public void export(HttpServletResponse response, @RequestBody TEmployeeInsurancePreSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TEmployeeInsurancePreSearchVo searchVo) {
tEmployeeInsurancePreService.listExport(response,searchVo); tEmployeeInsurancePreService.listExport(response,searchVo);
} }
......
...@@ -4,9 +4,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,9 +4,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 商险待办任务表 * 商险待办任务表
* *
...@@ -21,4 +25,8 @@ public interface TEmployeeInsurancePreMapper extends BaseMapper<TEmployeeInsuran ...@@ -21,4 +25,8 @@ public interface TEmployeeInsurancePreMapper extends BaseMapper<TEmployeeInsuran
* @return * @return
*/ */
IPage<TEmployeeInsurancePre> getTEmployeeInsurancePrePage(Page<TEmployeeInsurancePre> page, @Param("tEmployeeInsurancePre") TEmployeeInsurancePre tEmployeeInsurancePre); IPage<TEmployeeInsurancePre> getTEmployeeInsurancePrePage(Page<TEmployeeInsurancePre> page, @Param("tEmployeeInsurancePre") TEmployeeInsurancePre tEmployeeInsurancePre);
long selectExportCount(@Param("employeeRegistration") TEmployeeInsurancePreSearchVo employeeRegistration);
List<TEmployeeInsurancePreExportVo> selectExportList(@Param("employeeRegistration") TEmployeeInsurancePreSearchVo employeeRegistration);
} }
...@@ -18,6 +18,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; ...@@ -18,6 +18,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -60,28 +61,28 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -60,28 +61,28 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
/** /**
* 商险待办任务表批量导出 * 商险待办任务表批量导出
* *
* @param tEmployeeInsurancePre 商险待办任务表 * @param searchVo 商险待办任务表
* @return * @return
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TEmployeeInsurancePreSearchVo searchVo) { public void listExport(HttpServletResponse response, TEmployeeInsurancePreSearchVo searchVo) {
String fileName = "商险待办任务表批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "商险待办任务表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TEmployeeInsurancePre> list = new ArrayList<>(); List<TEmployeeInsurancePreExportVo> list = new ArrayList<>();
long count = 0; long count = baseMapper.selectExportCount(searchVo);
try (ServletOutputStream out= response.getOutputStream();){ try (ServletOutputStream out= response.getOutputStream();){
response.setContentType(CommonConstants.MULTIPART_FORM_DATA); response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8)); response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmployeeInsurancePre.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, TEmployeeInsurancePreExportVo.class).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) { for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
// list = noPageDiy(searchVo); list = baseMapper.selectExportList(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("商险待办任务表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("商险待办任务表" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
......
...@@ -242,26 +242,40 @@ ...@@ -242,26 +242,40 @@
</where> </where>
</select> </select>
<select id="selectExportList" resultMap="employeeRegistrationExportMap"> <select id="selectExportList" resultMap="tEmployeeInsurancePreExportMap">
SELECT SELECT
a.dept_name,
a.dept_no,
a.employee_name, a.employee_name,
a.emp_idcard, a.emp_idcard,
a.emp_phone,
a.position,
if(a.feedback_type = '1','入职','离职') feedback_type,
a.join_leave_date, a.join_leave_date,
if(a.process_status= '0','已接收',if(a.process_status= '1','待处理',if(a.process_status= '2','已处理','拒绝入职'))) process_status, CASE WHEN a.process_status ='0' THEN "待确认"
a.registor_username, WHEN a.process_status='1' THEN "待派单"
a.emp_deptname, WHEN a.process_status ='2' THEN "派单失败"
a.create_time WHEN a.process_status ='3' THEN "待投保"
FROM employee_registration a WHEN a.process_status ='4' THEN "投保中"
WHEN a.process_status ='5' THEN "投保退回"
WHEN a.process_status ='6' THEN "已完成"
ELSE a.process_status END as process_status,
a.customer_username,
concat(DATE_FORMAT(a.policy_start,'%Y-%m-%d'),'-',DATE_FORMAT(a.policy_end,'%Y-%m-%d')) as policy_start_end,
a.expected_collection_time,
a.insurance_company_name,
a.insurance_type_name,
a.buy_standard,
CASE WHEN a.buy_type ='1' THEN "新增"
WHEN a.buy_type='3' THEN "批增"
WHEN a.buy_type ='4' THEN "替换"
ELSE a.buy_type END as buy_type,
if(a.is_address = '0','是','否') as is_address
FROM t_employee_insurance_pre a
<where> <where>
1=1 1=1
<include refid="employeeRegistration_where"/> <include refid="tEmployeeInsurancePre_where"/>
</where> </where>
order by a.create_time desc order by a.create_time desc
<if test="employeeRegistration.limitStart != null"> <if test="tEmployeeInsurancePre.limitStart != null">
limit #{employeeRegistration.limitStart},#{employeeRegistration.limitEnd} limit #{tEmployeeInsurancePre.limitStart},#{tEmployeeInsurancePre.limitEnd}
</if> </if>
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment