nidapeng
2024-04-01 18b05b40f7b62962e05250e6a07abca27b5adf67
提交一把
已修改8个文件
236 ■■■■ 文件已修改
company/src/api/business/unionApply.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/assets/style/style.scss 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/business/OpearaUnionApply.vue 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/views/business/unionApply.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/UnionApply.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/api/business/unionApply.js
@@ -11,6 +11,9 @@
export function create (data) {
    return request.post('/business/unionApply/create', data)
}
export function merge (data) {
    return request.post('/business/unionApply/merge', data)
}
// 修改
export function updateById (data) {
company/src/assets/style/style.scss
@@ -77,22 +77,24 @@
::v-deep .el-table__cell {
  height: 100% !important;
}
.apply-status0, .apply-status28,.apply-status20,.apply-status21,.apply-status22,
.apply-status25,.apply-status2 , .apply-status3, .apply-status10,
.apply-status0, .apply-status26,.apply-status20,.apply-status21,.apply-status22,
.apply-status23,.apply-status2 , .apply-status3, .apply-status10,
.change-status0,.change-status1,.change-status2,
.settle-status0,.settle-status2,.settle-status3,
.tax-status0,
.union-apply-status0,.union-apply-status1,.union-apply-status2
.du-status0 {
  color: #216EEE  !important;
}
.apply-status1 ,.apply-status24,.apply-status23, .apply-status4, .apply-status6,
.apply-status1 ,.apply-status24,.apply-status25, .apply-status4, .apply-status6,
.apply-status7, .apply-status8, .apply-status11,
.change-status3,.change-status4,.change-status5,.change-status8,
.settle-status1,
.tax-status2,
.tax-status2,union-apply-status4
.du-status2 {
  color: #F95601 !important;
}
  .apply-status5,.apply-status26,.change-status7,.settle-status7,.tax-status1,.du-status1,.settle-status4  {
  .apply-status5,.apply-status27,.change-status7,.settle-status7,
  .tax-status1,.du-status1,.settle-status4 .union-apply-status3 {
  color: #00BA92  !important;
}
company/src/components/business/OpearaUnionApply.vue
@@ -9,8 +9,8 @@
    >
        <div class="list">
            <el-form :inline="true" ref="form" :model="form" :rules="rules" class="demo-form-inline">
                <el-form-item label="保险方案" prop="solutionsId">
                    <el-select v-model="form.solutionsId" @change="selectSolutions" placeholder="请选择">
                <el-form-item label="保险方案" prop="baseSolutionId">
                    <el-select v-model="form.baseSolutionId" @change="selectSolutions" placeholder="请选择">
                        <el-option
                            v-for="item in solutions"
                            :key="item.baseId"
@@ -19,14 +19,14 @@
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="保险生效起止期" prop="applyStartTime">
                <el-form-item label="保险生效起止期" prop="startDate">
                    <div style="display: flex; flex-direction: column;">
                        <el-date-picker
                            @change="changeTime"
                            v-model="time"
                            type="daterange"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            format="yyyy-MM-dd HH:mm:ss"
                            format="yyyy 年 MM 月 dd 日"
                            value-format="yyyy-MM-dd"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期" />
@@ -56,6 +56,7 @@
            :data="list"
            border
            ref="multipleTable"
            @selection-change="handleSelectionChange"
            style="width: 100%;margin-bottom: 15px;">
            <el-table-column
                type="selection"
@@ -67,23 +68,23 @@
                </template>
            </el-table-column>
            <el-table-column
                prop="memberName"
                prop="companyName"
                label="被保险人">
            </el-table-column>
            <el-table-column
                prop="idCard"
                prop="applyStartTime"
                label="期望保险生效起期">
            </el-table-column>
            <el-table-column
                prop="oldDuName"
                prop="applyEndTime"
                label="期望保险生效止期">
            </el-table-column>
            <el-table-column
                prop="oldWorkTypeName"
                prop="insureNum"
                label="投保人数">
            </el-table-column>
            <el-table-column
                prop="duName"
                prop="fee"
                label="总费用">
            </el-table-column>
            <el-table-column
@@ -112,6 +113,8 @@
    import selectApplicationForm from '@/components/business/selectApplicationForm'
    import employeeList from '@/components/business/employeeList'
    import { all } from '@/api/business/solutions'
import { closeWtbForShop, fetchList } from '@/api/business/insuranceApply'
import { merge } from '@/api/business/unionApply'
    export default {
        name: 'factoryChange',
        extends: BaseOpera,
@@ -119,10 +122,10 @@
        data () {
            return {
                form: {
                    id: null,
                    solutionsId: '',
                    applyStartTime: '',
                    applyEndTime: ''
        baseSolutionId: null,
        applyIds: [],
        startDate: null,
        endDate: null
                },
                solutions: [],
                list: [],
@@ -131,11 +134,11 @@
                time: [],
                // 验证规则
                rules: {
                    applyStartTime: [
                        { required: true, message: '请选择保险生效起期' }
                    ],
                    solutionsName: [
        baseSolutionId: [
                        { required: true, message: '请选择保险方案' }
        ],
        startDate: [
          { required: true, message: '请选择保险生效起期' }
                    ]
                }
            }
@@ -147,23 +150,54 @@
            })
        },
        methods: {
    handleSelectionChange (val) {
      // this.multipleSelection = val;
      this.form.applyIds = []
      // 假设取出 id 字段
      val.forEach(item => {
        const id = item.id
        if ( this.form.applyIds.indexOf(id) === -1) {
          this.form.applyIds.push(id)
        }
      })
    },
            confirm() {
      this.$refs.form.validate((valid) => {
        // debugger
        if (!valid) {
          return
        }
        if(this.form.applyIds == null || this.form.applyIds.length ===0){
          this.$tip.apiFailed({
            type: 'error',
            message: '请选择至少一条申请记录进行投保申请!!'
          })
          return;
        }
                this.$confirm('确认提交,请仔细核对信息。', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
          merge(this.form)
            .then(response => {
                    this.$message({
                        type: 'success',
                        message: '确定!'
                    });
                message: '提交成功!'
              })
              this.visible = false
              this.$emit('success')
            }).catch(err => {
              this.$tip.apiFailed(err)
            })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消'
                    });
                });
          })
        })
      })
            },
            getValue(e) {
                console.log(e)
@@ -174,16 +208,20 @@
            },
            changeTime(e) {
                if (e.length > 0) {
                    this.form.applyStartTime = e[0]
                    this.form.applyEndTime = e[1]
        this.form.startDate = e[0]
        this.form.endDate = e[1]
                } else {
                    this.form.applyStartTime = ''
                    this.form.applyEndTime = ''
        this.form.startDate = ''
        this.form.endDate = ''
                }
            },
            open (title, target) {
                this.getSolutions()
                this.title = title
      this.solutions= []
      this.list= []
      this.item= null
      this.time= []
                if (target) {
                    this.$nextTick(() => {
                        this.$refs.form.resetFields()
@@ -198,15 +236,38 @@
            },
            // 查询全部方案
            getSolutions() {
                all({})
      all({ dataType: 0, type: 1 })
                    .then(res => {
                        this.solutions = res
                    })
            },
    search () {
      this.currentPage = 1
      this.getList()
    },
    getList () {
      fetchList({
        capacity: 10,
        page: this.currentPage,
        model: {
          solutionBaseId: this.form.solutionsId,
          status: 23
        }
      }).then(res => {
        this.list = res.records
        this.total = res.total
        this.$nextTick(() => {
          if (this.$refs.table && this.$refs.table.doLayout) {
            this.$refs.table.doLayout()
          }
        })
      })
    },
            // 选择保险单
            selectSolutions(id) {
      this.search()
                this.solutions.forEach(item => {
                    if (item.id === id) {
        if (item.baseId === id) {
                        this.item = item
                    }
                })
company/src/views/business/unionApply.vue
@@ -3,21 +3,21 @@
        <!-- 搜索表单 -->
        <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
            <el-form-item label="保单状态" prop="status">
                <el-select v-model="searchForm.status" placeholder="请选择" @keypress.enter.native="search">
                    <el-option label="待审核" value="1"></el-option>
                    <el-option label="待签署" value="2"></el-option>
                    <el-option label="待出单" value="3"></el-option>
                    <el-option label="保障中" value="4"></el-option>
                    <el-option label="已退回" value="5"></el-option>
                <el-select v-model="searchForm.status" placeholder="请选择"  clearable   @keypress.enter.native="search">
                    <el-option label="待审核" value="0"></el-option>
                    <el-option label="待签署" value="1"></el-option>
                    <el-option label="待出单" value="2"></el-option>
                    <el-option label="保障中" value="3"></el-option>
                    <el-option label="已退回" value="4"></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.solutionId" clearable  placeholder="请选择" @change="search">
                    <el-option
                        v-for="item in solutionList"
                        :key="item.baseId"
                        :key="item.id"
                        :label="item.name"
                        :value="item.baseId">
                        :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
@@ -40,7 +40,7 @@
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:insurance:create']">
                <li><el-button type="primary" @click="$refs.OpearaUnionApply.open('投保详情', row)" v-permissions="['business:insurance:create']">提交申请</el-button></li>
                <li><el-button type="primary" @click="$refs.OpearaUnionApply.open('委托投保申请')" v-permissions="['business:insurance:create']">提交申请</el-button></li>
            </ul>
            <el-table
                v-loading="isWorking.search"
@@ -54,10 +54,14 @@
                </el-table-column>
                <el-table-column prop="statusInfo" label="状态" min-width="100px">
                    <template slot-scope="{row}">
                        <span :class="'apply-status'+row.status" >{{row.statusInfo}}</span>
                        <span :class="'union-apply-status'+row.status" v-if="row.status==0">待审核 </span>
                        <span :class="'union-apply-status'+row.status" v-if="row.status==1">待签署 </span>
                        <span :class="'union-apply-status'+row.status" v-if="row.status==2">待出单 </span>
                        <span :class="'union-apply-status'+row.status" v-if="row.status==3">保障中 </span>
                        <span :class="'union-apply-status'+row.status" v-if="row.status==4">已退回 </span>
                    </template>
                </el-table-column>
                <el-table-column prop="solutionsName" label="保险方案" min-width="100px"></el-table-column>
                <el-table-column prop="solutionName" label="保险方案" min-width="100px"></el-table-column>
                <el-table-column prop="insureNum" label="投保人数" min-width="100px"></el-table-column>
                <el-table-column prop="fee" label="总费用(元)" min-width="100px"></el-table-column>
                <el-table-column prop="createDate" label="提交时间" min-width="100px"></el-table-column>
@@ -118,6 +122,7 @@
                'field.main': 'id'
            })
            this.search()
          this.loadSelectList()
        },
        methods:{
            // 搜索框重置
@@ -138,7 +143,7 @@
                this.search()
            },
            loadSelectList() {
                solutionAll({dataType:2}).then(res => {
                solutionAll({dataType:0,type:1}).then(res => {
                    this.solutionList = res
                }).catch(err => {
                })
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -878,11 +878,11 @@
    }
    public  enum UnionApplyStatus {
        MERGE(1, "待上传保单","",0),
        WAIT_SIGNATURE(2, "待签署","",0),
        UPLOAD_INSURANCE_POLICY(3, "待上传保单","",0),
        FINISH(4, "保障中","",0),
        CLOSE(5, "关闭","",0),
        MERGE(0, "待上传保单","",0),
        WAIT_SIGNATURE(1, "待签署","",0),
        UPLOAD_INSURANCE_POLICY(2, "待上传保单","",0),
        FINISH(3, "保障中","",0),
        CLOSE(4, "关闭","",0),
        ;
        // 成员变量
        private String name;
@@ -1052,8 +1052,8 @@
        WTB_UPLOAD(20, "提交投保","",28),
        WTB_COMPANY_APPLY_SIGNATURE(21, "委托保-企业已签署投保确认书","提交意见:${param}",28),
        WTB_COMPANY_MEMBER_LIST_SIGNATURE(22, "委托保-企业已签署人员名单","提交意见:${param}",22),
        WTB_COMPANY_APPLY_SIGNATURE(21, "企业已签署投保确认书","提交意见:${param}",28),
        WTB_COMPANY_MEMBER_LIST_SIGNATURE(22, "企业已签署人员名单","提交意见:${param}",22),
        WTB_BUSINESS_CHECK_PASS(23,"商户投保审核通过","提交意见:${param}",23),
        WTB_RETURN(24, "已退回","提交意见:${param}",24),
        WTB_CLOSED(25, "已关闭","提交意见:${param}",25),
server/service/src/main/java/com/doumee/dao/business/model/UnionApply.java
@@ -33,7 +33,6 @@
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
@@ -42,7 +41,6 @@
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
@@ -126,4 +124,7 @@
    @ApiModelProperty(value = "服务天数")
    @TableField(exist = false)
    private Integer serviceDays;
    @ApiModelProperty(value = "投保人数")
    @TableField(exist = false)
    private Integer insureNum;
}
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -362,12 +362,18 @@
    @Override
    public List<Solutions> findList(Solutions solutions) {
        LoginUserInfo user = (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
        solutions.setIsdeleted(Constants.ZERO);
        solutions.setStatus(Constants.ZERO);
        if(solutions.getDataType() == null){
            solutions.setDataType(Constants.TWO);
        }
        if(Constants.equalsObject(user.getType(),Constants.TWO)){
            //如果是删除
            solutions.setShopId(user.getCompanyId());
        }
        QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
        return solutionsMapper.selectList(wrapper);
    }
  
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -147,13 +147,18 @@
        MPJLambdaWrapper<UnionApply> queryWrapper = new MPJLambdaWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        queryWrapper.selectAll(UnionApply.class);
        queryWrapper.selectAs(Solutions::getName,UnionApply::getSolutionName);
        queryWrapper.select("(select count(b.id) from apply_detail b where b.isdeleted=0 and b.union_apply_id=t.id) as insureNum ");
        queryWrapper.leftJoin(Solutions.class,Solutions::getId,UnionApply::getSolutionId);
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(user.getType().equals(Constants.TWO)){
            queryWrapper.eq(UnionApply::getCompanyId, pageWrap.getModel().getCompanyId());
        if(Constants.equalsInteger(user.getType(),Constants.TWO)){
            queryWrapper.eq(UnionApply::getCompanyId, user.getCompanyId());
        }
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.eq(UnionApply::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getSolutionId() != null) {
            queryWrapper.eq(UnionApply::getSolutionId, pageWrap.getModel().getSolutionId());
        }
        if (pageWrap.getModel().getCreator() != null) {
            queryWrapper.eq(UnionApply::getCreator, pageWrap.getModel().getCreator());
@@ -219,7 +224,9 @@
        }
        if (pageWrap.getModel().getSignApplyNo() != null) {
            queryWrapper.eq(UnionApply::getSignApplyNo, pageWrap.getModel().getSignApplyNo());
        }
        }if(pageWrap.getSorts().size() == 0){
            queryWrapper.orderByDesc(UnionApply::getCreateDate );
        }else {
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
@@ -227,6 +234,8 @@
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        }
        PageData<UnionApply> pageData = PageData.from(unionApplyJoinMapper.selectJoinPage(page,UnionApply.class, queryWrapper));
        return pageData;
    }
@@ -273,6 +282,7 @@
    @Override
    @Transactional(rollbackFor ={BusinessException.class,Exception.class} )
    public Integer merge(SaveUnionApplyDTO saveUnionApplyDTO){
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(!user.getType().equals(Constants.TWO)){
@@ -280,16 +290,27 @@
        }
        if(Objects.isNull(saveUnionApplyDTO)
            || Objects.isNull(saveUnionApplyDTO.getApplyIds())
            || saveUnionApplyDTO.getApplyIds().size() == 0
            || Objects.isNull(saveUnionApplyDTO.getStartDate())
            || Objects.isNull(saveUnionApplyDTO.getEndDate())
            || saveUnionApplyDTO.getStartDate().getTime()>saveUnionApplyDTO.getEndDate().getTime()
            || Objects.isNull(saveUnionApplyDTO.getBaseSolutionId())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        Solutions solutions = solutionsMapper.selectOne(new QueryWrapper<Solutions>().lambda().
                eq(Solutions::getType,Constants.ONE)
                .eq(Solutions::getIsdeleted,Constants.ZERO)
                .eq(Solutions::getDataType,Constants.ZERO)
                .eq(Solutions::getBaseId,saveUnionApplyDTO.getBaseSolutionId()));
        //查询方案数据
        if(solutions == null){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,方案信息有误,请刷新页面重试");
        }
        List<InsuranceApply> insuranceApplyList = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class,
                new MPJLambdaWrapper<InsuranceApply>()
                        .selectAll(InsuranceApply.class)
                        .selectAs(InsuranceApply::getSolutionBaseId,Solutions::getBaseId)
                        .selectAs(Solutions::getBaseId,InsuranceApply::getSolutionBaseId)
                        .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                        .eq(InsuranceApply::getIsdeleted, Constants.ZERO)
                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_BUSINESS_CHECK_PASS.getKey())
@@ -312,11 +333,19 @@
        unionApply.setStatus(Constants.UnionApplyStatus.MERGE.getKey());
        unionApply.setCheckUserId(user.getId());
        unionApply.setCurrentFee(BigDecimal.ZERO);
        unionApply.setIsdeleted(Constants.ZERO);
        unionApply.setSolutionId(solutions.getId());
        Integer maxDays = DateUtil.calculateBetween(saveUnionApplyDTO.getStartDate(),saveUnionApplyDTO.getEndDate(),0);
        List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().select(ApplyDetail::getPrice)
                .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds()));
        unionApply.setFee(applyDetailList.stream().map(i->i.getPrice().multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add));
        List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().select(ApplyDetail::getId,ApplyDetail::getPrice)
                .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds())
                .eq(ApplyDetail::getIsdeleted,Constants.ZERO));
        if(applyDetailList.size()==0){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,存在委托投保申请记录信息有误,请返回查看申请人员是否为空!");
        }
        unionApply.setFee(applyDetailList.stream().map(i->Constants.formatBigdecimal(i.getPrice()).multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add));
        unionApplyMapper.insert(unionApply);
        insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
@@ -464,16 +493,11 @@
        multifile.setFileurl(uploadMultifileDTO.getFileurl());
        multifile.setName(uploadMultifileDTO.getName());
        multifileMapper.insert(multifile);
    }
    /**
     * 合并单 - 投保申请签署
     * @param id
     * @return
     */
    @Override