| | |
| | | export function importExcel (data) { |
| | | return request.post('/business/member/importExcel', data) |
| | | } |
| | | // 导å
¥æ¨¡æ¿ |
| | | export function importReuduceExcel (data) { |
| | | return request.post('/business/member/importReuduceExcel', data) |
| | | } |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function findList (data) { |
| | |
| | | .du-status2 { |
| | | color: #F95601 !important; |
| | | } |
| | | |
| | | .tip-warn { |
| | | margin: 4px 0 25px 0; |
| | | font-size: 12px; |
| | | color: #999; |
| | | line-height: 25px; |
| | | i { |
| | | color: orange; |
| | | margin-right: 4px; |
| | | font-size: 14px; |
| | | position: relative; |
| | | top: 1px; |
| | | } |
| | | } |
| | | .union-change-status2, |
| | | .apply-status5,.apply-status27,.settle-status7,.change-status2, |
| | | .tax-status1,.du-status1,.settle-status4 ,.union-apply-status3 { |
| | |
| | | <div class="desc_item_label" v-if="userInfo.type === 1 &&(model.statusCollect === 2 || model.statusCollect === 3)"> |
| | | <div class="desc_item_label_left"> |
| | | <span>ä¿é©å°æè¿æ <b style="color: #F95601;">{{model.loseEfficacyDays ? model.loseEfficacyDays : '-'}}</b> 天</span> |
| | | <el-button type="primary" v-if="model.statusCollect === 2 || model.statusCollect === 3" @click="$refs.OperaInsuranceApplyAddWindow.open('ç»ä¿', {id: dataId,type: 1 })">ä¸é®ç»ä¿</el-button> |
| | | <el-button type="primary" v-if="model.statusCollect === 2 || model.statusCollect === 3" @click="goYjxb">ä¸é®ç»ä¿</el-button> |
| | | <el-button type="primary" v-if="model.statusCollect === 2" @click="$refs.additionSubtractionApplication.open('å åä¿ç³è¯·', { id: dataId })">å åä¿ç³è¯·</el-button> |
| | | <el-button type="primary" v-if="model.statusCollect === 2" @click="$refs.factoryChange.open('æ´æ¢æ´¾é£åä½ç³è¯·', { id: dataId })">æ´æ¢æ´¾é£åä½ç³è¯·</el-button> |
| | | </div> |
| | |
| | | <!-- $refs.operaverifyPhoneNumberWindew.open('éªè¯ææºå·')--> |
| | | <el-button v-if="model.status == 2" type="primary" :disabled="loading" :loading="loading" @click="goSign()">ç¾ç½²æä¿å</el-button> |
| | | <el-button v-if="model.status == 5" type="primary" @click="viewBaoxiandan">æ¥çä¿é©å</el-button> |
| | | <el-button v-if="model.status == 4" type="primary" @click="$refs.OperaInsuranceApplyAddWindow.open('æä¿ç³è¯·', {id: dataId})">忬¡æä¿</el-button> |
| | | <el-button v-if="model.status == 4" type="primary" @click="$refs.operaInsuranceApplyAddWindow.open('æä¿ç³è¯·', {id: dataId})">忬¡æä¿</el-button> |
| | | <el-button v-if="[0, 2, 3, 10].includes(model.status)" type="danger" @click="$refs.applyReturn.open('ç³è¯·éå', {id: dataId})">ç³è¯·éå</el-button> |
| | | <el-button v-if="model.status == 4" type="primary" @click="closeOrder">å
³é订å</el-button> |
| | | </template> |
| | |
| | | <!-- ä¼ä¸ç³è¯·éå --> |
| | | <applyReturn ref="applyReturn" @success="successEvent" /> |
| | | <!-- æ°å¢æä¿ --> |
| | | <OperaInsuranceApplyAddWindow ref="OperaInsuranceApplyAddWindow" @success="successEvent" /> |
| | | <OperaInsuranceApplyAddWindow ref="operaInsuranceApplyAddWindow" @success="result" /> |
| | | <!-- å åä¿ç³è¯· --> |
| | | <additionSubtractionApplication ref="additionSubtractionApplication" @success="successEvent" /> |
| | | <!-- æ´æ¢æ´¾é£åä½ç³è¯· --> |
| | |
| | | import OperaApplyChangeUnitDetailWindow from '@/components/business/OperaApplyChangeUnitDetailWindow' |
| | | |
| | | import applyReturn from '@/components/enterprise/applyReturn' |
| | | import { getDetail, getSignLink, applyDetailPage, applyChagneDetailPage, exportExcel, applyChagneDetailExcel, applyOpt } from '@/api/business/insuranceApply' |
| | | import { getDetail, getSignLink, applyDetailPage, exportExcel, applyChagneDetailExcel, applyOpt } from '@/api/business/insuranceApply' |
| | | import { findListByDTO } from '@/api/business/dispatchUnit' |
| | | import { fetchList } from '@/api/business/applyChange' |
| | | import { findListByDTO as worktypeFindListByDTO } from '@/api/business/worktype' |
| | | import OperaInsuranceApplyAddWindow from '@/components/enterprise/OperaInsuranceApplyAddWindow' |
| | | import { mapState } from 'vuex' |
| | | |
| | | import OperaPdfViewerWindow from '@/components/business/OperaPdfViewerWindow' |
| | | export default { |
| | | name: 'OperaInsuranceApplyWindow1', |
| | |
| | | InsuranceDetails, |
| | | OperaInsuranceApplyCheckWindow, |
| | | applyReturn, |
| | | OperaInsuranceApplyAddWindow, |
| | | additionSubtractionApplication, |
| | | factoryChange, |
| | | OperaApplyChangeDetailWindow, |
| | | OperaApplyChangeUnitDetailWindow, |
| | | OperaInsuranceApplyAddWindow, |
| | | operaverifyPhoneNumberWindew |
| | | }, |
| | | data () { |
| | |
| | | this.getDW() |
| | | this.getGZ() |
| | | }, |
| | | result(flag,param){ |
| | | console.log(flag,param) |
| | | if(param && param.godetail && param.id){ |
| | | this.open('å§æä¿è¯¦æ
',{id:param.id}) |
| | | }else{ |
| | | this.successEvent() |
| | | } |
| | | }, |
| | | goYjxb(){ |
| | | this.$refs.operaInsuranceApplyAddWindow.open('ç»ä¿', {id: this.dataId,type: 1 }) |
| | | }, |
| | | // å
³é订å |
| | | closeOrder () { |
| | | this.$confirm('确认å
³éæ¤è®¢åå?', 'æç¤º', { |
| | |
| | | <div class="desc_item_label" v-if="userInfo.type === 1 && model.status ===27 "> |
| | | <div class="desc_item_label_left"> |
| | | <span>ä¿é©å°æè¿æ <b style="color: #F95601;">{{model.loseEfficacyDays ? model.loseEfficacyDays : '-'}}</b> 天</span> |
| | | <el-button type="primary" v-if="model.status === 27" @click="$refs.OperaInsuranceApplyAddWindow.open('ç»ä¿', {id: dataId,type: 1 })">ä¸é®ç»ä¿</el-button> |
| | | <el-button type="primary" v-if="model.status === 27" @click="goYjxb">ä¸é®ç»ä¿</el-button> |
| | | <el-button type="primary" v-if="model.status === 27 && ( model.loseEfficacyDays ||!model.loseEfficacyDays)" @click="$refs.additionSubtractionApplication.open('å åä¿ç³è¯·', { id: dataId })">å åä¿ç³è¯·</el-button> |
| | | <el-button type="primary" v-if="model.status === 27 && ( model.loseEfficacyDays ||!model.loseEfficacyDays)" @click="$refs.factoryChange.open('æ´æ¢æ´¾é£åä½ç³è¯·', { id: dataId })">æ´æ¢æ´¾é£åä½ç³è¯·</el-button> |
| | | </div> |
| | |
| | | <!-- ä¼ä¸ç³è¯·éå --> |
| | | <applyReturn ref="applyReturn" @success="successEvent" /> |
| | | <!-- æ°å¢æä¿ --> |
| | | <OperaInsuranceApplyAddWindowNew ref="OperaInsuranceApplyAddWindow" @success="successEvent" /> |
| | | <OperaInsuranceApplyAddWindowNew ref="OperaInsuranceApplyAddWindow" @success="result" /> |
| | | <!-- å åä¿ç³è¯· --> |
| | | <additionSubtractionApplication ref="additionSubtractionApplication" @success="successEvent" /> |
| | | <!-- æ´æ¢æ´¾é£åä½ç³è¯· --> |
| | |
| | | </el-dialog> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import OperaInsuranceApplyAddWindowNew from '@/components/enterprise/OperaInsuranceApplyAddWindowNew' |
| | | import OperaInsuranceApplyAddWindowNew from '@/components/enterprise/OperaInsuranceApplyAddWindow' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import InsuranceDetails from '@/components/business/InsuranceDetails' |
| | | import OperaWtbApplyCheckWindow from '@/components/business/OperaWtbApplyCheckWindow' |
| | |
| | | import { fetchList } from '@/api/business/applyChange' |
| | | import { findListByDTO as worktypeFindListByDTO } from '@/api/business/worktype' |
| | | import { mapState } from 'vuex' |
| | | import {sendSms} from "@/api/business/smsEmail"; |
| | | import {sendSms} from '@/api/business/smsEmail'; |
| | | |
| | | export default { |
| | | name: 'OperaWtbApplyShopWindow', |
| | |
| | | this.$tip.apiFailed(err) |
| | | }) |
| | | }, |
| | | goYjxb(){ |
| | | this.$refs.OperaInsuranceApplyAddWindow.open('ç»ä¿', {id: this.dataId,type: 1 }) |
| | | }, |
| | | viewToubaodan () { |
| | | if (this.model.toubaodanSignedFile && this.model.toubaodanSignedFile.fileurlFull) { |
| | | setTimeout(() => { |
| | |
| | | }).catch(err => { |
| | | }) |
| | | }, |
| | | result(flag,param){ |
| | | console.log(flag,param) |
| | | if(param && param.godetail && param.id){ |
| | | this.open('å§æä¿è¯¦æ
',{id:param.id}) |
| | | }else{ |
| | | this.successEvent() |
| | | } |
| | | }, |
| | | successEvent () { |
| | | // this.visible=false |
| | | this.getDetail() |
| | |
| | | <confirmJobType ref="confirmJobType" @result="getUser" /> |
| | | <!-- æ¥ç详å --> |
| | | <detailsPolicyholder ref="detailsPolicyholder" @success="successEvent" /> |
| | | <!-- ç´ä¿æä¿è¯¦æ
--> |
| | | <!-- <!– ç´ä¿æä¿è¯¦æ
–> |
| | | <OperaInsuranceApplyDetails ref="OperaInsuranceApplyDetails" /> |
| | | <!-- å§ææä¿è¯¦æ
--> |
| | | <OperaWtbApplyShopWindow ref="OperaWtbApplyShopWindow" /> |
| | | <!– å§ææä¿è¯¦æ
–> |
| | | <OperaWtbApplyShopWindow ref="OperaWtbApplyShopWindow" />--> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import selectEmployees from '@/components/enterprise/selectEmployees' |
| | | import addEmployee from '@/components/enterprise/addEmployee' |
| | | import addEmployee from '@/components/enterprise/addEmployeeWithDu' |
| | | import importEmployees from '@/components/enterprise/importEmployees' |
| | | import confirmJobType from '@/components/enterprise/confirmJobType' |
| | | import detailsPolicyholder from '@/components/business/detailsPolicyholder' |
| | | import OperaInsuranceApplyDetails from '@/components/business/OperaInsuranceApplyWindow' |
| | | import OperaWtbApplyShopWindow from '@/components/business/OperaWtbApplyShopWindow' |
| | | import { all, getNewVersion } from '@/api/business/solutions' |
| | | import { mapState } from 'vuex' |
| | | import { create, getCountCyclePriceVO, getDetail, findList, updateData } from '@/api/business/insuranceApply' |
| | | import { create, getCountCyclePriceVO, getDetail, findList } from '@/api/business/insuranceApply' |
| | | import { UTable, UTableColumn } from 'umy-ui' |
| | | // Vue.component(UTable.name, UTable); |
| | | // Vue.component(UTableColumn.name, UTableColumn); |
| | | export default { |
| | | name: 'OperaInsuranceApplyAddWindowNew', |
| | | extends: BaseOpera, |
| | | components: { |
| | | GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType, detailsPolicyholder, UTable, UTableColumn |
| | | , OperaWtbApplyShopWindow, OperaInsuranceApplyDetails |
| | | GlobalWindow, |
| | | selectEmployees, |
| | | addEmployee, |
| | | importEmployees, |
| | | confirmJobType, |
| | | detailsPolicyholder, |
| | | UTable, |
| | | UTableColumn |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | solutionId: this.form.solutionId |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.visible = false |
| | | if (this.item.type == 1) { |
| | | this.$emit('success', 1, { id: res }) |
| | | this.$refs.OperaWtbApplyShopWindow.open('å§ææä¿è¯¦æ
', { id: res }) |
| | | } else { |
| | | this.$emit('success', 1, { id: res }) |
| | | this.$refs.OperaInsuranceApplyDetails.open('æä¿è¯¦æ
', { id: res }) |
| | | } |
| | | this.$emit('success', 1, { id: res,godetail:true,type:this.item.type}) |
| | | this.$tip.apiSuccess('æä½æå') |
| | | this.visible = false |
| | | // this.$emit('success','å§ææä¿è¯¦æ
', { id: res }) |
| | | }) |
| | | .catch(e => { |
| | |
| | | return sums |
| | | }, |
| | | getSummaries2 () { |
| | | this.sumFee = 0; |
| | | this.sumFee = 0 |
| | | if(this.tableData&&this.tableData.length){ |
| | | this.tableData.forEach((column, index) => { |
| | | this.sumFee = parseFloat(this.sumFee) + parseFloat(column.fee) |
| | |
| | | this.$message.warning('请å
éæ©ä¿é©æ¹æ¡') |
| | | return |
| | | } |
| | | this.$refs.addEmployee.open('æ·»å åå·¥', { arr: this.tableData, price: this.price }) |
| | | this.$refs.addEmployee.open('æ·»å åå·¥', { arr: this.tableData, price: this.price, solutionId: this.form.solutionId }) |
| | | }, |
| | | uploadUser () { |
| | | if (!this.form.solutionId) { |
| | |
| | | }, |
| | | // åæ¢æ¹æ¡ |
| | | changeSolution (e) { |
| | | this.sumFee =0; |
| | | this.sumFee = 0 |
| | | this.form.applyEndTime = '' |
| | | this.form.applyStartTime = '' |
| | | if (!this.form.id) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="100%" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :inline="true" class="demo-form-inline"> |
| | | <div v-for="(item, index) in list" :key="index"> |
| | | <el-form-item label="å§å" required> |
| | | <el-input v-model="item.memberName" placeholder="请è¾å
¥"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="身份è¯å·" required> |
| | | <el-input v-model="item.idCard" maxlength="18" placeholder="请è¾å
¥"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ´¾é£åä½" > |
| | | <el-select v-model="item.duId" @change="selectChange(index)" placeholder="è¯·éæ©" clearable> |
| | | <el-option |
| | | v-for="item in dispatching" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æå±å·¥ç§" > |
| | | <el-select v-model="item.worktypeId" @change="selectChangeWT(index)" placeholder="è¯·éæ©" clearable> |
| | | <el-option |
| | | v-for="item1 in item.options" |
| | | :key="item1.id" |
| | | :label="item1.name" |
| | | :value="item1.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" v-if="index === 0" @click="add">æ·»å </el-button> |
| | | <el-button type="danger" v-else @click="dele(index)">å é¤</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { findListByDTO } from '@/api/business/dispatchUnit' |
| | | import { findListByDTO as worktype } from '@/api/business/worktype' |
| | | export default { |
| | | name: 'addEmployee', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | tempIndex: -1, |
| | | dispatching: [], |
| | | solutionId: null, |
| | | list: [ |
| | | { |
| | | memberName: '', |
| | | idCard: '', |
| | | workTypeName: '', |
| | | worktypeId: '', |
| | | duName: '', |
| | | options: [], |
| | | duId: '', |
| | | fee: '' |
| | | } |
| | | ], |
| | | price: 0, |
| | | arr: [] |
| | | } |
| | | }, |
| | | methods: { |
| | | open (title, obj, tempIndex) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.tempIndex = tempIndex |
| | | this.solutionId = obj.solutionId |
| | | this.list = [ |
| | | { |
| | | memberName: '', |
| | | idCard: '', |
| | | workTypeName: '', |
| | | worktypeId: '', |
| | | duName: '', |
| | | options: [], |
| | | duId: '', |
| | | fee: '' |
| | | } |
| | | ] |
| | | this.arr = obj.arr |
| | | this.price = obj.price |
| | | this.getFindListByDTO() |
| | | }, |
| | | getFindListByDTO () { |
| | | findListByDTO({ |
| | | solutionId: this.solutionId |
| | | // dataType: 0 |
| | | }).then(res => { |
| | | this.dispatching = res |
| | | }) |
| | | }, |
| | | selectChange (index) { |
| | | this.list[index].options = [] |
| | | let duSolutionId = '' |
| | | this.list[index].duName = null |
| | | this.dispatching.forEach(item => { |
| | | if (item.id === this.list[index].duId) { |
| | | duSolutionId = item.duSolutionId |
| | | this.list[index].duName = item.name |
| | | } |
| | | }) |
| | | worktype({ id: duSolutionId, queryType: 1 }) |
| | | .then(res => { |
| | | this.list[index].options = res |
| | | }) |
| | | }, |
| | | selectChangeWT (index) { |
| | | this.list[index].workTypeName =null |
| | | this.list[index].options.forEach(item => { |
| | | if (item.id === this.list[index].worktypeId) { |
| | | this.list[index].workTypeName = item.name |
| | | } |
| | | }) |
| | | }, |
| | | add () { |
| | | this.list.push({ |
| | | memberName: '', |
| | | idCard: '', |
| | | workTypeName: '', |
| | | worktypeId: '', |
| | | duName: '', |
| | | duId: '', |
| | | options: [], |
| | | fee: '', |
| | | id: this.tempIndex - 1 |
| | | }) |
| | | }, |
| | | dele (index) { |
| | | this.list.splice(index, 1) |
| | | }, |
| | | hasDuplicates (arr) { |
| | | return arr.some((value, index) => arr.indexOf(value) !== index) |
| | | }, |
| | | confirm () { |
| | | // 夿åè¡¨å¦æ¯æç©ºå¼ |
| | | // for (let i = 0; this.list.length; i++) { |
| | | // if (!this.list[i].memberName || !this.list[i].idCard) { |
| | | // this.$message.warning('请å
å®åä¿¡æ¯ååæäº¤') |
| | | // return |
| | | // } |
| | | // } |
| | | // 夿æ°å½å
¥æ°æ®èº«ä»½è¯æ¯å¦æéå¤ |
| | | const idcardList = this.list.map(item => item.idCard) |
| | | if (this.hasDuplicates(idcardList)) { |
| | | this.$message.warning('èº«ä»½è¯æéå¤') |
| | | return |
| | | } |
| | | // å¤æèº«ä»½è¯æ¯å¦ææ |
| | | for (let i = 0; i < this.list.length; i++) { |
| | | const regExp = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/ |
| | | if (!regExp.test(this.list[i].idCard)) { |
| | | this.$message.warning(`第${i + 1}项å工身份è¯ä¸åæ³`) |
| | | return |
| | | } |
| | | } |
| | | // å¤æè¯¦æ
åè¡¨æ°æ®èº«ä»½è¯æ¯å¦æéå¤ |
| | | let next = true |
| | | this.list.forEach(item => { |
| | | this.arr.forEach(child => { |
| | | if (item.idCard === child.idCard) { |
| | | next = false |
| | | } |
| | | }) |
| | | }) |
| | | if (next) { |
| | | this.list.forEach(item => { |
| | | item.fee = this.price |
| | | }) |
| | | this.$emit('result', this.list) |
| | | this.visible = false |
| | | } else { |
| | | this.$message.warning('身份è¯å·ä¸è½éå¤ï¼') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |
| | |
| | | <div class="btns"> |
| | | <div class="btns_item"> |
| | | <el-button type="primary" @click="seleUser">éååå·¥</el-button> |
| | | <el-button type="primary" @click="uploadUser" v-if="activeName !== '1'">导å
¥åå·¥</el-button> |
| | | <el-button type="primary" @click="uploadUser">导å
¥åå·¥</el-button> |
| | | <el-button type="primary" @click="addUser" v-if="activeName !== '1'">æ·»å åå·¥</el-button> |
| | | <el-button type="danger" @click="deleItem">å é¤</el-button> |
| | | </div> |
| | |
| | | let total = 0 |
| | | if (this.activeName === '0') { |
| | | this.form.addDetailList.forEach(item => { |
| | | total += item.fee |
| | | total += item.fee || 0 |
| | | }) |
| | | sums[index] = total.toFixed(2) |
| | | sums[index] = (total || 0).toFixed(2) |
| | | } else { |
| | | this.form.delDetailList.forEach(item => { |
| | | total += item.reducePrice |
| | | }) |
| | | sums[index] = total.toFixed(2) |
| | | sums[index] = (total || 0).toFixed(2) |
| | | } |
| | | } |
| | | }) |
| | |
| | | return |
| | | }*/ |
| | | if (this.activeName === '0') { |
| | | this.$refs.selectEmployees.open('éååå·¥', { arr: this.form.addDetailList, price: this.price, notInInsuranceApplyId: this.form.id, validTime: this.form.applyStartTime }) |
| | | this.$refs.selectEmployees.open('éåå ä¿åå·¥', { arr: this.form.addDetailList, price: this.price, notInInsuranceApplyId: this.form.id, validTime: this.form.applyStartTime }) |
| | | } else { |
| | | this.$refs.selectEmployees.open('éååå·¥', { arr: this.form.delDetailList, price: this.reducePrice, insuranceApplyId: this.form.id, validTime: this.form.applyStartTime }) |
| | | this.$refs.selectEmployees.open('éååä¿åå·¥', { arr: this.form.delDetailList, price: this.reducePrice, insuranceApplyId: this.form.id, validTime: this.form.applyStartTime }) |
| | | } |
| | | }, |
| | | addUser () { |
| | |
| | | return |
| | | } |
| | | if (this.activeName === '0') { |
| | | this.$refs.addEmployee.open('æ·»å åå·¥', { arr: this.form.addDetailList, price: this.price }) |
| | | this.$refs.addEmployee.open('æ·»å å ä¿åå·¥', { arr: this.form.addDetailList, price: this.price }) |
| | | } else { |
| | | this.$refs.addEmployee.open('æ·»å åå·¥', { arr: this.form.delDetailList, price: this.reducePrice }) |
| | | this.$refs.addEmployee.open('æ·»å åä¿åå·¥', { arr: this.form.delDetailList, price: this.reducePrice }) |
| | | } |
| | | }, |
| | | uploadUser () { |
| | |
| | | return |
| | | } |
| | | if (this.activeName === '0') { |
| | | this.$refs.importEmployees.open('ä¸ä¼ åå', { arr: this.form.addDetailList, price: this.price, solutionId: this.form.solutionId }) |
| | | this.$refs.importEmployees.open('å ä¿åå·¥åå', { arr: this.form.addDetailList,type:1, price: this.price, solutionId: this.form.solutionId }) |
| | | } else { |
| | | this.$refs.importEmployees.open('ä¸ä¼ åå', { arr: this.form.delDetailList, price: this.reducePrice, solutionId: this.form.solutionId }) |
| | | this.$refs.importEmployees.open('åä¿åå·¥åå', { arr: this.form.delDetailList,type:0, price: this.reducePrice, solutionId: this.form.solutionId,insuranceApplyId: this.form.id }) |
| | | } |
| | | }, |
| | | // åæ¢æ¹æ¡ |
| | |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <p class="tip-warn" v-if="type ==1"><i class="el-icon-warning"></i>æéï¼<br> |
| | | <span style="">å ä¿äººåååä¸ï¼äººåå§åã身份è¯å·ãæ´¾é£åä½åå·¥ç§ä¿¡æ¯å为å¿
填项ï¼å¤æ³¨ä¿¡æ¯å¯ä¸ºç©ºï¼è¯·å½å
¥åæ³æ°æ®ã</span> |
| | | </p> |
| | | <p class="tip-warn" v-if="type !=1"><i class="el-icon-warning"></i>æéï¼<br> |
| | | <span style="">åä¿äººåååä¸ï¼äººåå§åã身份è¯å·å为å¿
填项ï¼å¤æ³¨ä¿¡æ¯å¯ä¸ºç©ºï¼è¯·å½å
¥åæ³æ°æ®ã</span> |
| | | </p> |
| | | <el-form class="demo-form-inline"> |
| | | <el-form-item label="ä¸ä¼ åå" required> |
| | | <div style="width: 100%;display: flex;align-items: center;"> |
| | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { importExcel } from '@/api/business/member' |
| | | import { importExcel,importReuduceExcel } from '@/api/business/member' |
| | | export default { |
| | | name: 'importEmployees', |
| | | extends: BaseOpera, |
| | |
| | | price: 0, |
| | | type: null, |
| | | solutionId: null, |
| | | applyId: null, |
| | | addList: [], |
| | | delList: [], |
| | | fileName: '' |
| | | } |
| | | }, |
| | |
| | | open (title, obj) { |
| | | this.title = title |
| | | this.addList = [] |
| | | this.delList = [] |
| | | this.fileName = '' |
| | | this.type = obj.type |
| | | this.visible = true |
| | | this.solutionId = obj.solutionId |
| | | this.applyId = obj.insuranceApplyId |
| | | this.list = obj.arr |
| | | this.price = obj.price |
| | | this.importing=false |
| | |
| | | // æä¿ç³è¯· |
| | | if (this.type === 1) { |
| | | window.open('/template/personnel_add.xlsx') |
| | | // window.open(process.env.VUE_APP_MEMBER1_URL) |
| | | } else { |
| | | window.open('/template/personnel_add.xlsx') |
| | | // window.open(process.env.VUE_APP_MEMBER_URL) |
| | | window.open('/template/personnel_reduce.xlsx') |
| | | } |
| | | }, |
| | | clickRef () { |
| | |
| | | this.$refs.fileExcel.click() |
| | | }, |
| | | result (e) { |
| | | if (this.type === 1) { |
| | | this.result1(e) |
| | | } else { |
| | | this.result2(e) |
| | | } |
| | | }, |
| | | result1 (e) { |
| | | this.addList = [] |
| | | const data = new FormData() |
| | | data.append('file', e.target.files[0]) |
| | | data.append('solutionId', this.solutionId) |
| | |
| | | this.$refs.fileExcel.value = null |
| | | }) |
| | | }, |
| | | result2 (e) { |
| | | this.delList = [] |
| | | const data = new FormData() |
| | | data.append('file', e.target.files[0]) |
| | | data.append('applyId', this.applyId) |
| | | importReuduceExcel(data) |
| | | .then(res => { |
| | | res.forEach(item => { |
| | | item.memberName = item.name |
| | | }) |
| | | this.delList = res |
| | | this.fileName = e.target.files[0].name |
| | | this.importing =false |
| | | }) |
| | | .catch(err => { |
| | | this.importing = false |
| | | this.$message.error(err) |
| | | this.fileName = '' |
| | | }) |
| | | .finally(() => { |
| | | this.importing =false |
| | | this.$refs.fileExcel.value = null |
| | | }) |
| | | }, |
| | | confirm () { |
| | | if (this.type === 1) { |
| | | this.confirm1() |
| | | } else { |
| | | this.confirm2() |
| | | } |
| | | }, |
| | | confirm1 () { |
| | | if(this.addList==null || this.addList.length ==0){ |
| | | this.$message.error('导å
¥äººååå为空ï¼è¯·å
ä¸ä¼ 人ååå') |
| | | return; |
| | | return |
| | | } |
| | | if(this.confirming){ |
| | | return |
| | |
| | | for (let i = 0; i < this.addList.length; i++) { |
| | | for (let a = 0; a < this.list.length; a++) { |
| | | if (this.addList[i].idCard === this.list[a].idcardNo) { |
| | | this.$message.warning(`[${this.addList[i].name}]åå·¥éå¤`) |
| | | this.$message.warning(`ã${this.addList[i].name}ãå工身份è¯ã${this.addList[i].idCard}ãéå¤`) |
| | | this.confirming = false |
| | | return |
| | | } |
| | | if (this.addList[i].idCard === this.list[a].idCard) { |
| | | this.$message.warning(`ã${this.addList[i].name}ãå工身份è¯ã${this.addList[i].idCard}ãéå¤`) |
| | | this.confirming = false |
| | | return |
| | | } |
| | | } |
| | |
| | | this.addList.forEach(item => { |
| | | item.fee = this.price |
| | | }) |
| | | |
| | | // this.confirming = false |
| | | this.visible = false |
| | | this.$emit('result', this.addList) |
| | | }, |
| | | confirm2() { |
| | | if(this.delList==null || this.delList.length ==0){ |
| | | this.$message.error('导å
¥äººååå为空ï¼è¯·å
ä¸ä¼ 人ååå') |
| | | return |
| | | } |
| | | if(this.confirming){ |
| | | return |
| | | } |
| | | this.confirming = true |
| | | for (let i = 0; i < this.delList.length; i++) { |
| | | for (let a = 0; a < this.list.length; a++) { |
| | | if (this.delList[i].idCard === this.list[a].idcardNo) { |
| | | this.$message.warning(`ã${this.delList[i].name}ãå工身份è¯ã${this.delList[i].idCard}ãéå¤`) |
| | | this.confirming = false |
| | | return |
| | | } |
| | | if (this.delList[i].idCard === this.list[a].idCard) { |
| | | this.$message.warning(`ã${this.delList[i].name}ãå工身份è¯ã${this.delList[i].idCard}ãéå¤`) |
| | | this.confirming = false |
| | | return |
| | | } |
| | | } |
| | | } |
| | | this.visible = false |
| | | this.$emit('result', this.delList) |
| | | } |
| | | } |
| | | } |
| | |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å¢æä¿ --> |
| | | <OperaInsuranceApplyAddWindow ref="OperaInsuranceApplyAddWindow" @success="handlePageChange" /> |
| | | <OperaInsuranceApplyAddWindow ref="OperaInsuranceApplyAddWindow" @success="result" /> |
| | | <OperaWtbApplyShopWindow ref="OperaWtbApplyShopWindow" @success="handlePageChange" /> |
| | | <!-- æä¿è¯¦æ
--> |
| | | <OperaInsuranceApplyDetails ref="OperaInsuranceApplyDetails" @success="handlePageChange" /> |
| | |
| | | this.$refs.searchForm.resetFields() |
| | | this.search() |
| | | }, |
| | | result(flag,param){ |
| | | console.log(flag,param) |
| | | if(param && param.godetail && param.id){ |
| | | if (param.type == 1) { |
| | | this.$refs.OperaWtbApplyShopWindow.open('å§ææä¿è¯¦æ
', { id: param.id }) |
| | | } else { |
| | | this.$refs.OperaInsuranceApplyDetails.open('æä¿è¯¦æ
', { id: param.id }) |
| | | } |
| | | } |
| | | this.handlePageChange() |
| | | }, |
| | | godetail (row) { |
| | | if (row.solutionType == 1) { |
| | | this.$refs.OperaWtbApplyShopWindow.open('å§ææä¿è¯¦æ
', { id: row.id }) |
| | |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å¢æä¿ --> |
| | | <OperaInsuranceApplyWindow ref="OperaInsuranceApplyWindow" @success="handlePageChange" /> |
| | | <OperaInsuranceApplyWindow ref="OperaInsuranceApplyWindow" @success="result" /> |
| | | <!-- æä¿è¯¦æ
--> |
| | | <OperaInsuranceApplyDetails ref="OperaInsuranceApplyDetails" @success="handlePageChange" /> |
| | | <OperaWtbApplyShopWindow ref="OperaWtbApplyShopWindow" @success="handlePageChange" /> |
| | |
| | | this.$refs.OperaInsuranceApplyDetails.open('æä¿è¯¦æ
', { id: row.id }) |
| | | } |
| | | }, |
| | | result(flag,param){ |
| | | console.log(flag,param) |
| | | if(param && param.godetail && param.id){ |
| | | if (param.type == 1) { |
| | | this.$refs.OperaWtbApplyShopWindow.open('å§ææä¿è¯¦æ
', { id: param.id }) |
| | | } else { |
| | | this.$refs.OperaInsuranceApplyDetails.open('æä¿è¯¦æ
', { id: param.id }) |
| | | } |
| | | } |
| | | this.handlePageChange() |
| | | }, |
| | | see () { |
| | | this.searchForm.statusCollect = '7' |
| | | this.search() |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import com.doumee.dao.business.dto.MemberQueryDTO; |
| | | import com.doumee.dao.business.dto.MemberReduceImport; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.MemberInsurance; |
| | | import com.doumee.service.business.MemberService; |
| | |
| | | public ApiResponse<List<MemberImport>> importExcel (@ApiParam(value = "file") MultipartFile file,Integer solutionId) { |
| | | return ApiResponse.success(memberService.importBatch(file,solutionId)); |
| | | } |
| | | @ApiOperation(value = "人ååä¿ä¿¡æ¯å¯¼å
¥" ,notes = "ä¿åç³è¯·") |
| | | @PostMapping("/importReuduceExcel") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | }) |
| | | @RequiresPermissions("business:member:importExcel") |
| | | public ApiResponse<List<MemberReduceImport>> importReuduceExcel (@ApiParam(value = "file") MultipartFile file, Integer applyId) { |
| | | return ApiResponse.success(memberService.importReduceBatch(file,applyId)); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * @author æ±è¹è¹ |
| | |
| | | @ApiModel("å工信æ¯å¯¼å
¥") |
| | | public class MemberImport { |
| | | |
| | | @ExcelColumn(name="åºå·",value = "sn" ) |
| | | @ExcelColumn(name="åºå·",value = "sn" ,index = 1) |
| | | private Integer sn; |
| | | |
| | | @ExcelColumn(name="å§å",value = "name" ) |
| | | @ExcelColumn(name="å§å",value = "name" ,index = 2) |
| | | private String name; |
| | | |
| | | @ExcelColumn(name="身份è¯å·",value = "idCard" ) |
| | | @ExcelColumn(name="身份è¯å·",value = "idCard" ,index = 3) |
| | | private String idCard; |
| | | |
| | | @ExcelColumn(name="æ´¾é£åä½" , value = "duName") |
| | | @ExcelColumn(name="æ´¾é£åä½" , value = "duName" ,index = 4) |
| | | private String duName; |
| | | |
| | | @ExcelColumn(name="å·¥ç§" , value = "workTypeName") |
| | | @ExcelColumn(name="å·¥ç§" , value = "workTypeName" ,index = 5) |
| | | private String workTypeName; |
| | | |
| | | @ExcelColumn(name="夿³¨",value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨",value = "夿³¨" ,index = 6) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(name="å¹´é¾",value = "age") |
| | |
| | | @ApiModelProperty(value = "æå±å·¥ç§ä¸»é®") |
| | | private Integer worktypeId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | | @Data |
| | | @ApiModel("å工信æ¯å¯¼å
¥") |
| | | public class MemberReduceImport { |
| | | |
| | | @ExcelColumn(name="åºå·",value = "sn" ,index = 1) |
| | | private Integer sn; |
| | | |
| | | @ExcelColumn(name="å§å",value = "name" ,index = 2) |
| | | private String name; |
| | | |
| | | @ExcelColumn(name="身份è¯å·",value = "idCard" ,index = 3) |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(name="æ´¾é£åä½" , value = "workTypeName") |
| | | private String duName; |
| | | @ExcelColumn(name="夿³¨",value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(name="å·¥ç§" , value = "workTypeName") |
| | | private String workTypeName; |
| | | |
| | | |
| | | @ApiModelProperty(name="å¹´é¾",value = "age") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "æ§å«") |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty(value = "æ´¾é£åä½ä¸»é®") |
| | | private Integer duId; |
| | | |
| | | @ApiModelProperty(value = "æå±å·¥ç§ä¸»é®") |
| | | private Integer worktypeId; |
| | | |
| | | @ApiModelProperty(value = "è´¹ç¨") |
| | | private BigDecimal fee; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty(value = "ä¿åæç»è¡æå¡è´¹") |
| | | @TableField(exist = false) |
| | | private BigDecimal detailServerCost; |
| | | |
| | | @ApiModelProperty(value = "è¡ä¿é©çææ¢æ") |
| | | @TableField(exist = false) |
| | | private Date parentEndTime; |
| | | |
| | | @ApiModelProperty(value = "è¡ä¿é©çæèµ·æ") |
| | | @TableField(exist = false) |
| | | private Date parentStartTime; |
| | | } |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import com.doumee.dao.business.dto.MemberQueryDTO; |
| | | import com.doumee.dao.business.dto.MemberReduceImport; |
| | | import com.doumee.dao.business.model.Member; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | List<Member> findListByDTO(MemberQueryDTO memberQueryDTO); |
| | | |
| | | List<MemberImport> importBatch(MultipartFile file,Integer solutionId); |
| | | List<MemberReduceImport> importReduceBatch(MultipartFile file, Integer applyId); |
| | | |
| | | } |
| | |
| | | .apply(" t1.BASE_ID in ( select du.id from dispatch_unit du where du.STATUS = 0 and du.ISDELETED = 0 ) ") |
| | | ); |
| | | if(!CollectionUtils.isNotEmpty(duSolutionList)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æ°æ®å¼å¸¸ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°æ´¾é£åä½"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°æ´¾é£åä½ä¿¡æ¯ï¼è¯·ç¡®ä¿æ´¾é£åä½åå·¥ä½é
ç½®å¹¶å®¡æ ¸éè¿ï¼"); |
| | | } |
| | | //æ¥è¯¢æææ´¾é£åä½ä¸çå·¥ç§ |
| | | List<Integer> duSolutionIdList = duSolutionList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | |
| | | .eq(checkNewData,Worktype::getDataType,Constants.TWO) |
| | | .in(DuWorktype::getDuSolutionId,duSolutionIdList)); |
| | | if(!CollectionUtils.isNotEmpty(duWorktypeList)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æ°æ®å¼å¸¸ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°å·¥ç§ä¿¡æ¯"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°å·¥ç§ä¿¡æ¯ï¼è¯·ç¡®ä¿æ´¾é£åä½åå·¥ä½é
ç½®å¹¶å®¡æ ¸éè¿ï¼"); |
| | | } |
| | | |
| | | if(CollectionUtils.isNotEmpty(applyDetailList)){ |
| | |
| | | member.setCompanyId(insuranceApply.getCompanyId()); |
| | | member.setSex(Constants.getSexByIdCard(applyDetail.getIdcardNo())); |
| | | if(!IdcardUtil.isValidCard(applyDetail.getIdcardNo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æä¿å工信æ¯èº«ä»½è¯ä¿¡æ¯é误["+member.getName()+"]"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼æä¿åå·¥ã"+member.getName()+"ã身份è¯ä¿¡æ¯ã"+applyDetail.getIdcardNo()+"ãé误"); |
| | | } |
| | | member.setIdcardNo(applyDetail.getIdcardNo()); |
| | | member.setApplyId(insuranceApply.getId()); |
| | |
| | | ||Objects.isNull(applyDetail.getDuId()) |
| | | ||Objects.isNull(applyDetail.getWorktypeId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æä¿åå·¥ä¿¡æ¯æ°æ®ç¼ºå¤±"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼æä¿åå·¥ä¿¡æ¯æ°æ®ç¼ºå¤±ï¼è¯·æç
§è¦æ±å¡«ååå·¥çææä¿¡æ¯ï¼"); |
| | | } |
| | | applyDetail.setCreateDate(new Date()); |
| | | applyDetail.setCreator(loginUserInfo.getId()); |
| | |
| | | //è·åè®¡ç®æ»å¤©æ° |
| | | Integer maxDays = DateUtil.calculateBetween(applyDetail.getStartTime(),applyDetail.getEndTime(),0); |
| | | if(Constants.equalsInteger(maxDays,0)||Objects.isNull(applyDetail.getFee())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æä¿ä¿¡æ¯å¼å¸¸ï¼æ»å¤©æ°ä¸æ»éé¢é误"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æä¿ä¿¡æ¯å¼å¸¸ï¼æä¿æ»å¤©æ°ä¸æ»éé¢é误"); |
| | | } |
| | | applyDetail.setPrice( |
| | | applyDetail.getFee().divide(new BigDecimal(maxDays),7,RoundingMode.HALF_UP) |
| | | ); |
| | | //éªè¯æ´¾é£åä½ä¿¡æ¯æ¯å¦åå¨ |
| | | if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"ã"+applyDetail.getMemberName()+"ãå工派é£å使ªæ¥è¯¢å°ï¼"); |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"ã"+applyDetail.getMemberName()+applyDetail.getIdcardNo()+"ãå工派é£å使ªæ¥è¯¢å°ï¼"); |
| | | } |
| | | if(duWorktypeList.stream().filter(d->d.getWorkTypeId().equals(applyDetail.getWorktypeId())) |
| | | .collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"ã"+applyDetail.getMemberName()+"ãå工工ç§ä¿¡æ¯æªæ¥è¯¢å°ï¼"); |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"ã"+applyDetail.getMemberName()+applyDetail.getIdcardNo()+"ãå工工ç§ä¿¡æ¯æªæ¥è¯¢å°ï¼"); |
| | | } |
| | | } |
| | | applyDetailJoinMapper.insertBatchSomeColumn(applyDetailList); |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.InsuranceApplyMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.SolutionsMapper; |
| | | import com.doumee.dao.business.WorktypeMapper; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import com.doumee.dao.business.dto.MemberQueryDTO; |
| | | import com.doumee.dao.business.dto.MemberReduceImport; |
| | | import com.doumee.dao.business.dto.WorktypeImport; |
| | | import com.doumee.dao.business.join.ApplyDetailJoinMapper; |
| | | import com.doumee.dao.business.join.DispatchUnitJoinMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | |
| | | |
| | | @Autowired |
| | | private DispatchUnitJoinMapper dispatchUnitJoinMapper; |
| | | @Autowired |
| | | private ApplyDetailJoinMapper applyDetailJoinMapper; |
| | | |
| | | @Autowired |
| | | private WorktypeMapper worktypeMapper; |
| | | |
| | | @Autowired |
| | | private SolutionsMapper solutionsMapper; |
| | | @Autowired |
| | | private InsuranceApplyMapper insuranceApplyMapper; |
| | | |
| | | @Override |
| | | public Integer create(Member member) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MemberImport> importBatch(MultipartFile file,Integer solutionId){ |
| | | public List<MemberReduceImport> importReduceBatch(MultipartFile file, Integer applyId){ |
| | | if(applyId == null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼è¯·éæ©ææçæ¹æ¡åè¿è¡æä½ï¼"); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éä¼ä¸äººåæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | List<Member> list = memberJoinMapper.selectJoinList(Member.class,new MPJLambdaWrapper<Member>() |
| | | .selectAll(Member.class) |
| | | .selectAs(DispatchUnit::getName,Member::getDuName) |
| | | .selectAs(Worktype::getName,Member::getWorkTypeName) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,Member::getDuId) |
| | | .leftJoin(Worktype.class,Worktype::getId,Member::getWorktypeId) |
| | | .isNotNull(Member::getIdcardNo) |
| | | .eq(Member::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | ); |
| | | ExcelImporter ie = null; |
| | | List<MemberReduceImport> dataList =null; |
| | | try { |
| | | ie = new ExcelImporter(file,1,0); |
| | | dataList = ie.getDataList(MemberReduceImport.class,null); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(dataList == null || dataList.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼å½å
¥æ°æ®ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | InsuranceApply insuranceApply = insuranceApplyMapper.selectById(applyId); |
| | | if (Objects.isNull(insuranceApply) || !Constants.equalsInteger(insuranceApply.getCompanyId(),loginUserInfo.getCompanyId())) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对ä¸èµ·ï¼ä¿åä¿¡æ¯ä¸åå¨ï¼è¯·å·æ°é¡µé¢éè¯ï¼"); |
| | | } |
| | | if (!(Constants.equalsInteger(insuranceApply.getStatus(), Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | ||Constants.equalsInteger(insuranceApply.getStatus(), Constants.InsuranceApplyStatus.WTB_DONE.getKey()) |
| | | )) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "对ä¸èµ·ï¼ä¿åå½åç¶æä¸æ¯æè¯¥æä½ï¼"); |
| | | } |
| | | if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO ) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "ä¿åå·²è¿ä¿ï¼ä¸æ¯æè¯¥æä½"); |
| | | } |
| | | if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO ) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "ä¿åå·²è¿ä¿ï¼ä¸æ¯æè¯¥æä½"); |
| | | } |
| | | |
| | | Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ä¿é©æ¹æ¡"); |
| | | } |
| | | int index = Constants.TWO; |
| | | Map<String,String> idCardMap = new HashMap<>(); |
| | | for(MemberReduceImport model : dataList){ |
| | | //æ ¡éªåæ°æ¯å¦åæ³ |
| | | validReduceImportParam(model,idCardMap,dataList,index); |
| | | index += 1; |
| | | } |
| | | index = Constants.TWO; |
| | | for(MemberReduceImport model : dataList){ |
| | | ApplyDetail detail =applyDetailJoinMapper.selectJoinOne(ApplyDetail.class,new MPJLambdaWrapper<ApplyDetail>() |
| | | .selectAll(ApplyDetail.class) |
| | | .selectAs(Worktype::getName,ApplyDetail::getWorkTypeName) |
| | | .selectAs(DispatchUnit::getName,ApplyDetail::getDuName) |
| | | .selectAs(InsuranceApply::getStartTime,ApplyDetail::getStartTime) |
| | | .selectAs(InsuranceApply::getFinalEndTime,ApplyDetail::getEndTime) |
| | | .selectAs(InsuranceApply::getServerCost,ApplyDetail::getDetailServerCost) |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId) |
| | | .eq(ApplyDetail::getApplyId,insuranceApply.getId()) |
| | | .eq(ApplyDetail::getApplyId,insuranceApply.getId()) |
| | | .eq(ApplyDetail::getIdcardNo,model.getIdCard()) |
| | | .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(new Date(),1)) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(new Date(),3))); |
| | | if(detail == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å½åä¿åä¸ï¼åå·¥ã" + model.getName()+model.getIdCard() + "ãéå¨ä¿äººåï¼å¦æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | model.setDuId(detail.getDuId()); |
| | | model.setDuName(detail.getDuName()); |
| | | model.setWorktypeId(detail.getWorktypeId()); |
| | | model.setWorkTypeName(detail.getWorkTypeName()); |
| | | model.setFee( |
| | | Constants.reduceFee(solutions, |
| | | Objects.isNull(detail.getDetailServerCost())? |
| | | solutions.getPrice():solutions.getPrice().add(detail.getDetailServerCost()),detail.getParentStartTime(),detail.getParentEndTime(),detail.getStartTime(), |
| | | detail.getEndTime()).subtract(detail.getFee())); |
| | | index += 1; |
| | | } |
| | | return dataList; |
| | | } |
| | | |
| | | private void validReduceImportParam(MemberReduceImport model, Map<String, String> idCardMap, List<MemberReduceImport> dataList, int index) { |
| | | if(StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®å§åä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(model.getIdCard())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯å·ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(model.getIdCard())||model.getIdCard().length()!=18){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯ã"+model.getIdCard()+"ãæ ¼å¼ä¸æ£ç¡®ï¼"); |
| | | } |
| | | if(!IdcardUtil.isValidCard(model.getIdCard())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯ã"+model.getIdCard()+"ãä¿¡æ¯ä¸æ£ç¡®ï¼"); |
| | | } |
| | | if(Objects.nonNull(idCardMap.get(model.getIdCard()))){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ææ¡£ä¸ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯å·ã"+model.getIdCard()+"ãåå¨ç¸åæ°æ®ï¼"); |
| | | } |
| | | idCardMap.put(model.getIdCard(), model.getIdCard()); |
| | | } |
| | | @Override |
| | | public List<MemberImport> importBatch(MultipartFile file,Integer solutionId){ |
| | | if(solutionId == null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼è¯·éæ©ææçæ¹æ¡åè¿è¡æä½ï¼"); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éä¼ä¸äººåæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | ExcelImporter ie = null; |
| | | List<MemberImport> dataList =null; |
| | | try { |
| | |
| | | if(dataList == null || dataList.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼å½å
¥æ°æ®ä¸ºç©ºï¼"); |
| | | } |
| | | // List<String> idCardList = dataList.stream().map(m->m.getIdCard()).collect(Collectors.toList()); |
| | | // Set<String> set = new HashSet<>(idCardList); |
| | | // if(idCardList.size() != set.size()){ |
| | | // throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对ä¸èµ·ï¼å½å
¥æ°æ®åå¨èº«ä»½è¯å·ç¸åæ°æ®ï¼"); |
| | | // } |
| | | List<DispatchUnit> dispatchUnitList = new ArrayList<>(); |
| | | if(!Objects.isNull(solutionId)){ |
| | | dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | | int index = Constants.TWO; |
| | | Map<String,String> idCardMap = new HashMap<>(); |
| | | for(MemberImport model : dataList){ |
| | | //æ ¡éªåæ°æ¯å¦åæ³ |
| | | validImportParam(model,idCardMap,dataList,index,solutionId); |
| | | index += 1; |
| | | } |
| | | List<DispatchUnit> dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | | new MPJLambdaWrapper<DispatchUnit>() |
| | | .selectAll(DispatchUnit.class) |
| | | .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+solutionId+" limit 1) as du_solution_id" ) |
| | |
| | | dispatchUnit.setWorktypeList(worktypeList); |
| | | } |
| | | } |
| | | } |
| | | long index = Constants.TWO; |
| | | Map<String,String> idCardMap = new HashMap<>(); |
| | | index = Constants.TWO; |
| | | for(MemberImport model : dataList){ |
| | | if(StringUtils.isBlank(model.getIdCard())||model.getIdCard().length()!=18){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯ä¿¡æ¯å¼å¸¸ï¼"); |
| | | //æ ¡éªäººåæ¯å¦å·²ç»å¨åä¿ä¸ |
| | | isMemberValidForSolution(model,index,solutionId); |
| | | //æ£æ¥æ´¾é£åä½åå·¥ç§æææ§ |
| | | dealDuAndWorktype(model,index,dispatchUnitList); |
| | | index += 1; |
| | | } |
| | | if(!IdcardUtil.isValidCard(model.getIdCard())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯ä¿¡æ¯å¼å¸¸ï¼"); |
| | | return dataList; |
| | | } |
| | | if(StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®å§åä¿¡æ¯å¼å¸¸ï¼"); |
| | | |
| | | private void isMemberValidForSolution(MemberImport model, int index, Integer solutionId) { |
| | | /* ApplyDetail detail = applyDetailJoinMapper.selectJoinOne(ApplyDetail.class,new MPJLambdaWrapper<ApplyDetail>() |
| | | .last("limit 1")); |
| | | if(detail!=null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡èº«ä»½è¯ä¸ºã"+model.getIdCard()+"ã人åå·²ç»å¨è¯¥æ¹æ¡ä¸å卿ä¿è®°å½ï¼"); |
| | | }*/ |
| | | } |
| | | if(Objects.nonNull(idCardMap.get(model.getIdCard()))){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯å·ã"+model.getIdCard()+"ãåå¨ç¸åæ°æ®ï¼"); |
| | | } |
| | | idCardMap.put(model.getIdCard(), model.getIdCard()); |
| | | index = index + Constants.ONE; |
| | | if(CollectionUtils.isNotEmpty(list)){ |
| | | Optional<Member> memberOptional= list.stream().filter(m->m.getIdcardNo().equals(model.getIdCard())).findFirst(); |
| | | if(memberOptional.isPresent()){ |
| | | Member member = memberOptional.get(); |
| | | model.setIdCard(member.getIdcardNo()); |
| | | model.setSex(member.getSex()); |
| | | }else{ |
| | | model.setSex(Constants.getSexByIdCard(model.getIdCard())); |
| | | } |
| | | }else{ |
| | | model.setSex(Constants.getSexByIdCard(model.getIdCard())); |
| | | } |
| | | if(StringUtils.isNotBlank(model.getDuName())&&CollectionUtils.isNotEmpty(dispatchUnitList)){ |
| | | |
| | | private void dealDuAndWorktype(MemberImport model, int index, List<DispatchUnit> dispatchUnitList ) { |
| | | |
| | | if(CollectionUtils.isNotEmpty(dispatchUnitList)){ |
| | | Optional<DispatchUnit> dispatchUnitOptional= dispatchUnitList.stream().filter(m->m.getName().equals(model.getDuName())).findFirst(); |
| | | if(dispatchUnitOptional.isPresent()){ |
| | | DispatchUnit dispatchUnit = dispatchUnitOptional.get(); |
| | |
| | | } |
| | | } |
| | | if(Objects.isNull(model.getDuId())){ |
| | | model.setWorkTypeName(null); |
| | | model.setDuName(null); |
| | | }else if(Objects.isNull(model.getWorktypeId())){ |
| | | model.setWorkTypeName(null); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®æ´¾é£åä½ã"+model.getDuName()+"ã䏿£ç¡®ï¼"); |
| | | } |
| | | if(Objects.isNull(model.getWorktypeId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®å·¥ç§ã"+model.getWorkTypeName()+"ã䏿£ç¡®ï¼"); |
| | | } |
| | | } |
| | | return dataList; |
| | | |
| | | private void validImportParam(MemberImport model, Map<String, String> idCardMap, List<MemberImport> dataList,int index,Integer solutionId) { |
| | | if(StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®å§åä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(model.getIdCard())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯å·ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(model.getDuName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®æ´¾é£åä½ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(model.getWorkTypeName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®å·¥ç§ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | if(StringUtils.isBlank(model.getIdCard())||model.getIdCard().length()!=18){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯ã"+model.getIdCard()+"ãæ ¼å¼ä¸æ£ç¡®ï¼"); |
| | | } |
| | | if(!IdcardUtil.isValidCard(model.getIdCard())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯ã"+model.getIdCard()+"ãä¿¡æ¯ä¸æ£ç¡®ï¼"); |
| | | } |
| | | if(Objects.nonNull(idCardMap.get(model.getIdCard()))){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼ææ¡£ä¸ç¬¬"+index+"è¡æ°æ®èº«ä»½è¯å·ã"+model.getIdCard()+"ãåå¨ç¸åæ°æ®ï¼"); |
| | | } |
| | | idCardMap.put(model.getIdCard(), model.getIdCard()); |
| | | |
| | | } |
| | | |
| | | |