jiangping
2024-01-26 38e2bdb95c2593b883369911868fe8b671b5d119
开发业务接口
已修改7个文件
211 ■■■■ 文件已修改
company/src/api/business/insuranceApply.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/InsuranceDetails.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaInsuranceApplyWindow.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/platform/src/main/java/com/doumee/api/business/ApplyDetailController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/ApplyDetail.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/ApplyDetailServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/api/business/insuranceApply.js
@@ -11,6 +11,18 @@
export function updateById (data) {
    return request.post('/business/insuranceApply/updateById', data)
}
export function exportDetailExcel (data) {
    return request.post('/business/insuranceApply/exportDetailExcel', data, {
        trim: true,
        download: true
    })
}
export function getDetail (id) {
    return request.get(`business/insuranceApply/${id}`)
}
export function getDetailList (data) {
    return request.post('/business/applyDetail/list', data, {
        trim: true
    })
}
company/src/components/business/InsuranceDetails.vue
@@ -1,36 +1,40 @@
<template>
    <GlobalWindow
        :title="title"
        width="50%"
        width="100%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <div class="box">
          <div class="top">
            {{title}}
          </div>
            <div class="box_header">
                <div class="box_header_item">
                    <div class="box_header_item_label">投保企业</div>
                    <div class="box_header_item_val">安徽格力机械制造厂</div>
                    <div class="box_header_item_val">{{ model.companyName }}</div>
                </div>
                <div class="box_header_item">
                    <div class="box_header_item_label">保险方案</div>
                    <div class="box_header_item_val">平安保险雇主责任险A版</div>
                    <div class="box_header_item_val">{{ model.solutionsName }}</div>
                </div>
                <div class="box_header_item">
                    <div class="box_header_item_label">保险生效起期</div>
                    <div class="box_header_item_val">2023-09-11 00:00:00</div>
                    <div class="box_header_item_val">{{ model.startTime }}</div>
                </div>
                <div class="box_header_item">
                    <div class="box_header_item_label">保险生效止期</div>
                    <div class="box_header_item_val">2023-10-11 23:59:59</div>
                    <div class="box_header_item_val">{{model.endTime}}</div>
                </div>
                <div class="box_header_item">
                    <div class="box_header_item_label">投保人数</div>
                    <div class="box_header_item_val">50</div>
                    <div class="box_header_item_val">{{ model.insureNum }}</div>
                </div>
                <div class="box_header_item">
                    <div class="box_header_item_label">总费用</div>
                    <div class="box_header_item_val">15000</div>
                    <div class="box_header_item_label">总费用(元)</div>
                    <div class="box_header_item_val">{{model.fee}}</div>
                </div>
            </div>
            <div class="box_table">
@@ -41,18 +45,18 @@
                    <div class="box_table_head_item">派遣单位</div>
                    <div class="box_table_head_item">所属工种</div>
                </div>
                <div class="box_table_content" v-for="(item, index) in 6" :key="index">
                <div class="box_table_content" v-for="(item, index) in detailList" :key="index">
                    <div class="box_table_content_item">{{index + 1}}</div>
                    <div class="box_table_content_item">王某某</div>
                    <div class="box_table_content_item">340411190001010011</div>
                    <div class="box_table_content_item">安徽格力机械制造厂</div>
                    <div class="box_table_content_item">4类 机械加工/制造</div>
                    <div class="box_table_content_item">{{ item.memberName }}</div>
                    <div class="box_table_content_item">{{ item.idcardNo }}</div>
                    <div class="box_table_content_item">{{ item.duName }}</div>
                    <div class="box_table_content_item">{{item.workTypeName}}</div>
                </div>
            </div>
        </div>
        <template v-slot:footer>
            <el-button type="primary">企业证件</el-button>
            <el-button type="primary">导出详单</el-button>
            <el-button type="primary"  :loading="isWorking.export" @click="exportDetail">导出详单</el-button>
            <el-button>取消</el-button>
        </template>
    </GlobalWindow>
@@ -61,12 +65,16 @@
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import {exportDetailExcel, getDetailList} from "@/api/business/insuranceApply";
    import {all as solutionAll} from "@/api/business/solutions";
    export default {
        name: 'InsuranceDetails',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                model:{},
               detailList:[],
                // 表单数据
                form: {
                    id: null,
@@ -75,24 +83,8 @@
                // 验证规则
                rules: {
                },
                formInline: {
                    user: '',
                    region: ''
                },
                reverse: true,
                activities: [{
                    content: '活动按期开始',
                    timestamp: '2018-04-15'
                }, {
                    content: '通过审核',
                    timestamp: '2018-04-13'
                }, {
                    content: '创建成功',
                    timestamp: '2018-04-11'
                }],
                tableData: [],
                activeName: 'first',
                currentPage: 1
                tableData: []
            }
        },
        created () {
@@ -102,6 +94,39 @@
            })
        },
        methods: {
            open(title,target){
              this.title=title
              this.visible=true
              this.model = target
              this.getDetailListDo()
            },
           getDetailListDo(){
              getDetailList({applyId: this.model.id}).then(res => {
                this.detailList = res
              }).catch(err => {
              })
            },
          exportDetail(){
            this.$dialog.exportConfirm('确认导出吗?')
                .then(() => {
                  this.isWorking = true
                  exportDetailExcel({ id: this.model.id })
                      .then(response => {
                        this.download(response)
                      })
                      .catch(e => {
                        console.log(e)
                        this.$message.error('数据下载失败!')
                      })
                      .finally(() => {
                        this.isWorking = false
                      })
                })
                .catch(() => {
                })
          },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
@@ -121,6 +146,17 @@
<style lang="scss" scoped>
    .box {
        width: 100%;
       .top{
           width: 100%;
           align-items: center;
           flex-wrap: wrap;
           border-top: 1px solid #b4bbc5;
           border-left: 1px solid #b4bbc5;
            font-size: 24px;
            font-weight: bold;
            text-align: center;
          padding: 15px;
         }
        .box_header {
            width: 100%;
            display: flex;
company/src/components/business/OperaInsuranceApplyWindow.vue
@@ -1,7 +1,7 @@
<template>
    <GlobalWindow
        :title="title"
        width="80%"
        width="100%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
@@ -15,7 +15,7 @@
                        <span>提交时间:{{ model.createDate }}</span>
                    </div>
                    <div class="desc_item_label_right">
                        <el-button type="primary" @click="$refs.InsuranceDetails.open('投保详情单')">导出详单</el-button>
                        <el-button type="primary" @click="$refs.InsuranceDetails.open('投保详情单',model)">导出详单</el-button>
                        <el-button v-if="model.status == 0 " type="primary" @click="visible2 = true">上传投保单</el-button>
                        <el-button v-if="model.status == 3 "  type="primary" @click="visible3 = true">上传保险单</el-button>
                        <el-button  v-if="model.status == 6 || model.status == 7|| model.status == 8" type="primary" @click="visible5 = true">处理退回申请</el-button>
server/platform/src/main/java/com/doumee/api/business/ApplyDetailController.java
@@ -73,6 +73,12 @@
    public ApiResponse<PageData<ApplyDetail>> findPage (@RequestBody PageWrap<ApplyDetailPageDTO> pageWrap) {
        return ApiResponse.success(applyDetailService.findPageForCompany(pageWrap));
    }
    @ApiOperation("查询全部")
    @PostMapping("/list")
    @RequiresPermissions("business:applydetail:query")
    public ApiResponse<List<ApplyDetail>> findList (@RequestBody  ApplyDetail pageWrap) {
        return ApiResponse.success(applyDetailService.findList(pageWrap));
    }
    @ApiOperation("导出在保人员详单Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:applydetail:exportExcel")
server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java
@@ -17,6 +17,7 @@
import org.springframework.core.annotation.AnnotationConfigurationException;
import javax.servlet.http.HttpServletResponse;
import javax.swing.*;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -251,7 +252,24 @@
        }
        return new ArrayList<>(sortedFields.values());
    }
    /**
     * 配置数据单元格
     */
    private void configDataCell (SXSSFWorkbook workbook, Cell cell ) {
        CellStyle style = workbook.createCellStyle();
        style.setAlignment(HorizontalAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.CENTER);
        // 设置背景
        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//        style.setFillForegroundColor(columnConfig.dataBackgroundColor().getIndex());
        // 字体
        Font font = workbook.createFont();
        style.setFont(font);
        // 边框
        configCellBorder(style);
        style.setWrapText(true);
        cell.setCellStyle(style);
    }
    /**
     * 配置数据单元格
     */
@@ -309,7 +327,22 @@
        style.setVerticalAlignment(VerticalAlignment.CENTER);
        // 设置背景
        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//        style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        // 字体
        Font font = workbook.createFont();
        font.setFontHeightInPoints((short)12);
        font.setBold(true);
        style.setFont(font);
        // 设置边框
        configCellBorder(style);
        cell.setCellStyle(style);
    }
    private void configTitleCell (SXSSFWorkbook workbook, Cell cell ) {
        CellStyle style = workbook.createCellStyle();
        style.setAlignment(HorizontalAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.CENTER);
        // 设置背景
        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        // 字体
        Font font = workbook.createFont();
        font.setFontHeightInPoints((short)12);
@@ -444,14 +477,18 @@
        try {
            sxssfWorkbook = new SXSSFWorkbook();
            Sheet sheet = sxssfWorkbook.createSheet(sheetName);
            for (int i = 0; i < 6; i++) {
                sheet.setColumnWidth(i, 20 * 2 * 256);
            }
            sheet.createFreezePane(0, 1);
            sheet.addMergedRegion(new CellRangeAddress(0   ,0,0,6));
            sheet.addMergedRegion(new CellRangeAddress(0   ,0,0,5));
            Row title = sheet.createRow(0);
            title.setHeight((short) 1000);
            title.setHeight((short) 800);
            Cell c = title.createCell(0);
            c.setCellValue(sheetName);
            configFirstCell(sxssfWorkbook,c);
            configTitleCell(sxssfWorkbook,c);
            Row header1 = sheet.createRow(1);
            header1.setHeight((short) 400);
            header1.createCell(0).setCellValue("投保企业");
            header1.createCell(1).setCellValue("保险方案");
            header1.createCell(2).setCellValue("保险生效起期");
@@ -468,17 +505,17 @@
            header2.createCell(3).setCellValue(com.doumee.core.utils.DateUtil.getPlusTime2(data.getEndTime()));
            header2.createCell(4).setCellValue(data.getInsureNum());
            header2.createCell(5).setCellValue(Constants.formatBigdecimal2Float(data.getFee()).toString());
            //空白行
            Row header3 = sheet.createRow(3);
            sheet.addMergedRegion(new CellRangeAddress(3  ,3,0,6));
            Row header4 = sheet.createRow(4);
            for (int i = 0; i < 6; i++) {
                configDataCell(sxssfWorkbook,   header2.getCell(i));
            }
            Row header4 = sheet.createRow(3);
            header4.createCell(0).setCellValue("序号");
            header4.createCell(1).setCellValue("员工姓名");
            header4.createCell(2).setCellValue("性别");
            header4.createCell(3).setCellValue("身份证号");
            header4.createCell(4).setCellValue("派遣单位");
            header4.createCell(5).setCellValue("所属工种");
            header4.setHeight((short) 400);
            for (int i = 0; i < 6; i++) {
                configFirstCell(sxssfWorkbook,header4.getCell(i));
            }
@@ -487,12 +524,17 @@
                for (int rowIndex = 0; rowIndex < data.getApplyDetailList().size(); rowIndex++) {
                    ApplyDetail d = data.getApplyDetailList().get(rowIndex);
                    Row header5 = sheet.createRow(rowIndex + 4);
                    header5.setHeight((short) 300);
                    header5.createCell(0).setCellValue(rowIndex+1);
                    header5.createCell(1).setCellValue(StringUtils.defaultString(d.getMemberName(),""));
                    header5.createCell(2).setCellValue(Constants.equalsInteger(d.getSex(),0)?"男":(Constants.equalsInteger(d.getSex(),1)?"女":"-"));
                    header5.createCell(3).setCellValue(StringUtils.defaultString(d.getIdcardNo(),""));
                    header5.createCell(4).setCellValue(StringUtils.defaultString(d.getDuName(),""));
                    header5.createCell(5).setCellValue(StringUtils.defaultString(d.getWorkTypeName(),""));
                    // 设置数据单元格
                    for (int i = 0; i < 6; i++) {
                        configDataCell(sxssfWorkbook,   header5.getCell(i));
                    }
                }
            }
            sxssfWorkbook.write(os);
server/service/src/main/java/com/doumee/dao/business/model/ApplyDetail.java
@@ -120,7 +120,6 @@
    private String duName;
    @ApiModelProperty(value = "员工名称")
    @TableField(exist = false)
    @ExcelColumn(name="员工姓名",index =3)
    private String memberName;
server/service/src/main/java/com/doumee/service/business/impl/ApplyDetailServiceImpl.java
@@ -22,6 +22,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -92,9 +93,29 @@
    }
    @Override
    public List<ApplyDetail> findList(ApplyDetail applyDetail) {
        QueryWrapper<ApplyDetail> wrapper = new QueryWrapper<>(applyDetail);
        return applyDetailMapper.selectList(wrapper);
    public List<ApplyDetail> findList(ApplyDetail applyDetailPageDTO) {
        if(applyDetailPageDTO.getApplyId() == null){
            return  new ArrayList<>();
        }
        MPJLambdaWrapper<ApplyDetail> queryWrapper = new MPJLambdaWrapper<>();
        Utils.MP.blankToNull(applyDetailPageDTO);
        queryWrapper.selectAll(ApplyDetail.class);
        queryWrapper.selectAs(DispatchUnit::getName,ApplyDetail::getDuName);
        queryWrapper.selectAs(Worktype::getName,ApplyDetail::getWorkTypeName);
        queryWrapper.selectAs(Member::getIdcardNo,ApplyDetail::getIdcardNo);
        queryWrapper.selectAs(Member::getName,ApplyDetail::getMemberName);
        queryWrapper.leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId);
        queryWrapper.leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId);
        queryWrapper.leftJoin(Member.class,Member::getId,ApplyDetail::getMemberId);
        queryWrapper.eq( ApplyDetail::getApplyId,applyDetailPageDTO.getApplyId());
        List<ApplyDetail> pageData=  applyDetailJoinMapper.selectJoinList( ApplyDetail.class, queryWrapper);
        if(pageData!=null){
            int num = 1;
            for (ApplyDetail d : pageData){
                d.setSortnum(num++);
            }
        }
        return pageData;
    }
@@ -177,6 +198,7 @@
        queryWrapper.selectAll(ApplyDetail.class);
        queryWrapper.selectAs(DispatchUnit::getName,ApplyDetail::getDuName);
        queryWrapper.selectAs(Worktype::getName,ApplyDetail::getWorkTypeName);
        queryWrapper.selectAs(Member::getIdcardNo,ApplyDetail::getIdcardNo);
        queryWrapper.selectAs(Member::getName,ApplyDetail::getMemberName);
        queryWrapper.leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId);
        queryWrapper.leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId);