jiangping
2024-01-26 8ebca068bb00e530ce44e10e7d009bcaa46c6579
开发业务接口
已修改9个文件
205 ■■■■ 文件已修改
company/src/api/business/insuranceApply.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OperaInsuranceApplyWindow.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/business/insuranceApply.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/dto/InsuranceApplyQueryDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/api/business/insuranceApply.js
@@ -11,3 +11,6 @@
export function updateById (data) {
    return request.post('/business/insuranceApply/updateById', data)
}
export function getDetail (id) {
    return request.get(`business/insuranceApply/${id}`)
}
company/src/components/business/OperaInsuranceApplyWindow.vue
@@ -10,9 +10,9 @@
            <div class="desc_item">
                <div class="desc_item_label">
                    <div class="desc_item_label_left">
                        <span>投保企业:安徽平安人力资源有限公司</span>
                        <span>保单状态:待出单</span>
                        <span>提交时间:2023-09-11 00:00:00</span>
                        <span>投保企业:{{ model.companyName }}</span>
                        <span>保单状态:{{ model.statusInfo }}</span>
                        <span>提交时间:{{ model.createDate }}</span>
                    </div>
                    <div class="desc_item_label_right">
                        <el-button type="primary" @click="$refs.InsuranceDetails.open('投保详情单')">导出详单</el-button>
@@ -30,37 +30,37 @@
                        border
                        style="width: 100%">
                        <el-table-column
                            prop="date"
                            prop="code"
                            label="保单号">
                        </el-table-column>
                        <el-table-column
                            prop="name"
                            prop="solutionsName"
                            label="保险方案"
                            width="180">
                        </el-table-column>
                        <el-table-column
                            prop="address"
                            prop="startTime"
                            label="保险生效起期">
                        </el-table-column>
                        <el-table-column
                            prop="address"
                            prop="endTime"
                            label="保险生效止期">
                        </el-table-column>
                        <el-table-column
                            prop="address"
                            prop="insureNum"
                            label="投保人数">
                        </el-table-column>
                        <el-table-column
                            prop="address"
                            prop="serviceDays"
                            label="在保时长(天)">
                        </el-table-column>
                        <el-table-column
                            prop="address"
                            label="当前费用">
                            prop="currentFee"
                            label="当前费用(元)">
                        </el-table-column>
                        <el-table-column
                            prop="address"
                            label="总费用">
                            prop="fee"
                            label="总费用(元)">
                        </el-table-column>
                    </el-table>
                </div>
@@ -392,6 +392,8 @@
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import InsuranceDetails from '@/components/business/InsuranceDetails'
import {getDetail} from "@/api/business/insuranceApply";
import {all as solutionAll} from "@/api/business/solutions";
    export default {
        name: 'OperaInsuranceApplyWindow',
        extends: BaseOpera,
@@ -399,6 +401,8 @@
        data () {
            return {
                // 表单数据
      dataId:null,
      model: {},
                form: {
                    id: null,
                    editDate: ''
@@ -442,6 +446,19 @@
            })
        },
        methods: {
     open(title,target){
       this.visible=true;
       this.dataId=target.id
      this.getDetail();
     },
    getDetail(){
      getDetail(this.dataId).then(res => {
        this.model = res
        this.tableData = new Array();
        this.tableData.push(res);
      }).catch(err => {
      })
    },
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
company/src/views/business/insuranceApply.vue
@@ -17,19 +17,19 @@
                <el-select v-model="searchForm.companyId" placeholder="请选择" @change="search">
                    <el-option
                        v-for="item in companyList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="保险方案" prop="solutionId">
                <el-select v-model="searchForm.solutionId" placeholder="请选择" @change="search">
                <el-select v-model="searchForm.baseSolutionId" placeholder="请选择" @change="search">
                    <el-option
                        v-for="item in solutionList"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -43,12 +43,10 @@
                    start-placeholder="开始日期"
                    end-placeholder="结束日期">
                </el-date-picker>
<!--                <el-date-picker v-model="searchForm.createDate" value-format="yyyy-MM-dd" placeholder="请输入创建时间"/>-->
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button @click="reset">重置</el-button>
                <el-button @click="$refs.operaInsuranceApplyWindow.open('投保详情')">投保详情</el-button>
            </section>
        </el-form>
        <!-- 表格和分页 -->
@@ -63,17 +61,7 @@
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="status" label="投保状态" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.statusCollect === 0">待审核</span>
                        <span v-if="row.statusCollect === 1">待出单</span>
                        <span v-if="row.statusCollect === 2">保障中</span>
                        <span v-if="row.statusCollect === 3">已过期</span>
                        <span v-if="row.statusCollect === 4">已退回</span>
                        <span v-if="row.statusCollect === 5">退回申请中</span>
                        <span v-if="row.statusCollect === 6">已关闭</span>
                    </template>
                </el-table-column>
                <el-table-column prop="statusInfo" label="投保状态" min-width="100px"></el-table-column>
                <el-table-column prop="companyName" label="投保企业" min-width="100px"></el-table-column>
                <el-table-column prop="solutionsName" label="保险方案" min-width="100px"></el-table-column>
                <el-table-column prop="insureNum" label="投保人数" min-width="100px"></el-table-column>
@@ -106,6 +94,8 @@
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import { all as solutionAll} from '@/api/business/solutions'
import { pageAll as companyAll} from '@/api/business/company'
import OperaInsuranceApplyWindow from '@/components/business/OperaInsuranceApplyWindow'
export default {
    name: 'InsuranceApply',
@@ -115,7 +105,8 @@
        return {
            // 搜索
            searchForm: {
                createDate: '',
                createTimeS: '',
                createTimeE: '',
                solutionId: '',
                companyId: '',
              statusCollect: ''
@@ -134,10 +125,18 @@
        this.search()
        this.loadSelectList()
    },
  methods (){
    methods:{
    loadSelectList(){
          solutionAll({dataType:0}).then(res => {
              this.solutionList = res
            }).catch(err => {
            })
        companyAll({}).then(res => {
            this.companyList = res
          }).catch(err => {
          })
    }
  }
}
</script>
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -659,6 +659,54 @@
    }
    public  enum ApplyCollectStatus {
        DSP(0, "待审批"),
        DCD(1, "待出单"),
        BZZ(2, "保障中"),
        YGQ(3, "已过期"),
        YTH(4, "已退回"),
        THSQZ(5, "退回申请中"),
        YGB(6, "已关闭"),
        ;
        // 成员变量
        private String name;
        private int key;
        // 构造方法
        ApplyCollectStatus(int key, String name) {
            this.name = name;
            this.key = key;
        }
        // 普通方法
        public static String getName(int index) {
            for (ApplyCollectStatus c : ApplyCollectStatus.values()) {
                if (c.getKey() == index) {
                    return c.name;
                }
            }
            return null;
        }
        // get set 方法
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public int getKey() {
            return key;
        }
        public void setKey(int key) {
            this.key = key;
        }
    }
    public  enum ApplyLogType {
        UPLOAD(0, "提交投保","提交意见:${param}"),
server/service/src/main/java/com/doumee/dao/business/dto/InsuranceApplyQueryDTO.java
@@ -22,6 +22,10 @@
    @ApiModelProperty(value = "方案编码(关联solutions)", example = "1")
    private Integer solutionId;
    @ApiModelProperty(value = "企业编码 ", example = "1")
    private Integer companyId;
    @ApiModelProperty(value = "基表方案编码 ", example = "1")
    private Integer baseSolutionId;
    @ApiModelProperty(value = "实际保险生效止期开始")
    private Date endTimeS;
server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java
@@ -173,6 +173,9 @@
    @ApiModelProperty(value = "状态 0待审批 1待出单 2保障中  3已过期 4已撤回 5退回申请中 6已关闭", example = "1")
    @TableField(exist = false)
    private Integer statusCollect;
    @ApiModelProperty(value = "集合状态" , example = "1")
    @TableField(exist = false)
    private String statusInfo;
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -259,13 +259,11 @@
        List<Multifile> multifileList = new ArrayList<>();
        List<Integer> objList = new ArrayList<>();
        if(company.getBusinessImg()!=null && StringUtils.isNotBlank(company.getBusinessImg().getFileurl())){
        if(company.getBusinessImg()!=null && company.getBusinessImg().getId() ==null && StringUtils.isNotBlank(company.getBusinessImg().getFileurl())){
            multifileList.add(initMultiFileByCompay(company,company.getBusinessImg(),Constants.MultiFile.COM_BUSINESS_LICENSE.getKey()));
            objList.add(Constants.MultiFile.COM_BUSINESS_LICENSE.getKey());
        }else  {
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请上传营业执照!");
        }
        if(company.getSignImg()!=null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){
        if(company.getSignImg()!=null&& company.getSignImg().getId() ==null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){
            multifileList.add(initMultiFileByCompay(company,company.getSignImg(),Constants.MultiFile.COM_SING_IMG.getKey()));
            objList.add(Constants.MultiFile.COM_SING_IMG.getKey());
            company.setSignIdStatus(Constants.ZERO);//标记电子签章未上传
@@ -277,6 +275,9 @@
        }
        if(company.getIdcardImgList()!=null && company.getIdcardImgList()!=null){
            for(Multifile f : company.getIdcardImgList()){
                if(f.getId() !=null){
                    continue;
                }
                multifileList.add(initMultiFileByCompay(company,f,Constants.MultiFile.COM_IDCARD_IMG.getKey()));
            }
            objList.add(Constants.MultiFile.COM_IDCARD_IMG.getKey());
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -770,6 +770,7 @@
        queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId);
        queryWrapper.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId);
        queryWrapper.eq(InsuranceApply::getIsdeleted,Constants.ZERO);
        queryWrapper.eq(pageWrap.getModel().getBaseSolutionId()!=null,Solutions::getBaseId,pageWrap.getModel().getBaseSolutionId());
        queryWrapper.in(statusList.size()>0,InsuranceApply::getStatus,statusList);
        if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.THREE) ){
            queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
@@ -819,6 +820,13 @@
        PageData<InsuranceApply> pageData = PageData.from(insuranceApplyJoinMapper.selectJoinPage(page,InsuranceApply.class, queryWrapper));
        if(pageData.getRecords()!=null){
            for (InsuranceApply apply : pageData.getRecords()){
                initApplyStatus(apply) ;
             }
        }
        return pageData;
    }
    public void    initApplyStatus(InsuranceApply apply){
                apply.setStatusCollect(Constants.InsuranceApplyStatus.getCollectStatus(apply.getStatus()));
                if(Constants.equalsInteger(apply.getStatusCollect(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
                    //如果已完成
@@ -826,11 +834,10 @@
                        apply.setStatusCollect(Constants.THREE);//已过期
                    }
                }
            }
        }
        return pageData;
    }
        setServiceDays(apply);
        apply.setStatusInfo(Constants.ApplyCollectStatus.getName(apply.getStatusCollect()));
    }
    @Override
    public List<InsuranceApply> findListByDTO(InsuranceApplyQueryDTO model) {
@@ -901,6 +908,7 @@
                .selectAll(InsuranceApply.class)
                .selectAs(Solutions::getName,InsuranceApply::getSolutionsName)
                .selectAs(Company::getName,ApplyLog::getCompanyName)
                .select(" ( select count(1) from apply_detail ad  where ad.apply_id = t.id ) as insureNum")
                .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
                .eq(InsuranceApply::getId,id)
@@ -910,21 +918,10 @@
        if(Objects.isNull(insuranceApply)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        insuranceApply.setInsureNum(applyDetailMapper.selectCount(new QueryWrapper<ApplyDetail>().lambda().eq(ApplyDetail::getApplyId,insuranceApply.getId())
                .eq(ApplyDetail::getIsdeleted,Constants.ZERO)));
        //设置在保时长(天数)
        if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
            //如果当前时间大于结束日期 则使用结束日期对比开始日期
            if(DateUtil.compareDate(new Date(),insuranceApply.getEndTime())>=Constants.ZERO){
                insuranceApply.setServiceDays(DateUtil.daysBetweenDates(insuranceApply.getEndTime(),insuranceApply.getStartTime()));
            }else if(DateUtil.compareDate(insuranceApply.getStartTime(),new Date())>=Constants.ZERO){
                //未开始
                insuranceApply.setServiceDays(Constants.ZERO);
            }else{
                insuranceApply.setServiceDays(DateUtil.daysBetweenDates(new Date(),insuranceApply.getStartTime()));
            }
        }
        initApplyStatus(insuranceApply);
        //查询附件数据
        initImgData(insuranceApply);
@@ -943,6 +940,23 @@
        insuranceApply.setApplyLogList(applyLogList);
        return insuranceApply;
    }
    private void setServiceDays(InsuranceApply insuranceApply) {
        //设置在保时长(天数)
        insuranceApply.setServiceDays(Constants.ZERO);
        if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
            //如果当前时间大于结束日期 则使用结束日期对比开始日期
            if(DateUtil.compareDate(new Date(),insuranceApply.getEndTime())>=Constants.ZERO){
                insuranceApply.setServiceDays(DateUtil.daysBetweenDates(insuranceApply.getEndTime(),insuranceApply.getStartTime()));
            }else if(DateUtil.compareDate(insuranceApply.getStartTime(),new Date())>=Constants.ZERO){
                //未开始
                insuranceApply.setServiceDays(Constants.ZERO);
            }else{
                insuranceApply.setServiceDays(DateUtil.daysBetweenDates(new Date(),insuranceApply.getStartTime()));
            }
        }
    }
    private void initImgData(InsuranceApply model) {
        List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda()
                .eq(Multifile::getObjId,model.getId())
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -260,7 +260,9 @@
    @Override
    public List<Solutions> findList(Solutions solutions) {
        solutions.setIsdeleted(Constants.ZERO);
        if(solutions.getDataType() == null){
        solutions.setDataType(Constants.TWO);
        }
        QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
        return solutionsMapper.selectList(wrapper);
    }