Commit 97abc1f1 authored by danfuman's avatar danfuman

Merge branch 'dev20230707' of http://192.168.60.201/root/dsk-operate-sys into dev20230707

parents 9ccf7c3a 58f49330
...@@ -28,7 +28,7 @@ public class ContactInfoController extends BaseController { ...@@ -28,7 +28,7 @@ public class ContactInfoController extends BaseController {
/** /**
* 联系人列表 * 联系人列表
*/ */
// @PreAuthorize("@ss.hasPermi('contact:list')") // @PreAuthorize("@ss.hasPermi('contact:info:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo selectPageList(ContactInfoSearchDto dto){ public TableDataInfo selectPageList(ContactInfoSearchDto dto){
startPage(); startPage();
...@@ -47,7 +47,7 @@ public class ContactInfoController extends BaseController { ...@@ -47,7 +47,7 @@ public class ContactInfoController extends BaseController {
/** /**
* 添加用户联系人 * 添加用户联系人
*/ */
// @PreAuthorize("@ss.hasPermi('contact:add')") // @PreAuthorize("@ss.hasPermi('contact:info:add')")
@PostMapping() @PostMapping()
@RepeatSubmit() @RepeatSubmit()
public AjaxResult add(@RequestBody ContactInfo baen){ public AjaxResult add(@RequestBody ContactInfo baen){
...@@ -57,7 +57,7 @@ public class ContactInfoController extends BaseController { ...@@ -57,7 +57,7 @@ public class ContactInfoController extends BaseController {
/** /**
* 编辑用户联系人 * 编辑用户联系人
*/ */
// @PreAuthorize("@ss.hasPermi('contact:edit')") // @PreAuthorize("@ss.hasPermi('contact:info:edit')")
@PutMapping() @PutMapping()
@RepeatSubmit() @RepeatSubmit()
public AjaxResult edit(@RequestBody ContactInfo baen){ public AjaxResult edit(@RequestBody ContactInfo baen){
...@@ -67,7 +67,7 @@ public class ContactInfoController extends BaseController { ...@@ -67,7 +67,7 @@ public class ContactInfoController extends BaseController {
/** /**
* 删除用户联系人 * 删除用户联系人
*/ */
// @PreAuthorize("@ss.hasPermi('contact:del')") // @PreAuthorize("@ss.hasPermi('contact:info:del')")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@RepeatSubmit() @RepeatSubmit()
public AjaxResult del(@PathVariable("id") Long id){ public AjaxResult del(@PathVariable("id") Long id){
......
...@@ -65,7 +65,8 @@ export function removeLabel(param) { ...@@ -65,7 +65,8 @@ export function removeLabel(param) {
//查询项目联系人 //查询项目联系人
export function getLXR(param) { export function getLXR(param) {
return request({ return request({
url: '/business/contacts/list', // url: '/business/contacts/list',
url: '/contact/info/list',
method: 'GET', method: 'GET',
params:param params:param
}) })
...@@ -73,8 +74,9 @@ export function getLXR(param) { ...@@ -73,8 +74,9 @@ export function getLXR(param) {
//修改项目联系人 //修改项目联系人
export function editLXR(param) { export function editLXR(param) {
return request({ return request({
url: '/business/contacts/edit', // url: '/business/contacts/edit',
method: 'POST', url: '/contact/info',
method: 'PUT',
data:param data:param
}) })
} }
...@@ -82,12 +84,21 @@ export function editLXR(param) { ...@@ -82,12 +84,21 @@ export function editLXR(param) {
//新增项目联系人 //新增项目联系人
export function addLXR(param) { export function addLXR(param) {
return request({ return request({
url: '/business/contacts/add', // url: '/business/contacts/add',
url: '/contact/info',
method: 'POST', method: 'POST',
data:param data:param
}) })
} }
//删除项目联系人
export function delLXR(param) {
return request({
url: '/contact/info/'+param,
method: 'DELETE',
})
}
//跟进记录 //跟进记录
export function getGJJL(param) { export function getGJJL(param) {
return request({ return request({
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="flex-box avatar-wrapper"> <div class="flex-box avatar-wrapper">
<img v-if="avatar" class="pic-avatar" :src="avatar"> <img v-if="avatar" class="pic-avatar" :src="avatar">
<span v-else class="user-avatar">{{ name&&name.slice(0, 1).toUpperCase() }}</span> <span v-else class="user-avatar">{{ name&&name.slice(0, 1).toUpperCase() }}</span>
{{ name }} {{ name.length>10?name.slice(0, 10)+'...':name}}
</div> </div>
<el-dropdown-menu slot="dropdown" class="user-dropdown"> <el-dropdown-menu slot="dropdown" class="user-dropdown">
<router-link to="/user/profile"> <router-link to="/user/profile">
......
...@@ -384,14 +384,14 @@ export default { ...@@ -384,14 +384,14 @@ export default {
} }
} }
.alltags{ .alltags{
position: absolute; position: fixed;
align-items: center; align-items: center;
border-radius: 9px; border-radius: 9px;
height: 17px; height: 17px;
justify-content: center; justify-content: center;
width: 36px; width: 36px;
right: -130px; right: 10px;
bottom: 0px; top: 37px;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
&:hover{ &:hover{
......
<template> <template>
<div class="decisionMaking"> <!--<div class="decisionMaking">-->
<template v-if="ifEmpty"> <!--<template v-if="ifEmpty">-->
<div class="flex-box query-box"> <!--<div class="flex-box query-box">-->
<div class="flex-box query-params"></div> <!--<div class="flex-box query-params"></div>-->
<div class="flex-box query-add"> <!--<div class="flex-box query-add">-->
<el-button type="primary" icon="el-icon-plus" @click="opennew">新增联系人</el-button> <!--<el-button type="primary" icon="el-icon-plus" @click="opennew">新增联系人1</el-button>-->
</div> <!--</div>-->
</div> <!--</div>-->
<div class="table-item"> <!--<div class="table-item">-->
<tables <!--<tables-->
:indexFixed="true" <!--:indexFixed="true"-->
:tableLoading="tableLoading" <!--:tableLoading="tableLoading"-->
:tableData="tableData" <!--:tableData="tableData"-->
:forData="forData" <!--:forData="forData"-->
:tableDataTotal="tableDataTotal" <!--:tableDataTotal="tableDataTotal"-->
:queryParams="queryParams" <!--:queryParams="queryParams"-->
@handle-current-change="handleCurrentChange" <!--@handle-current-change="handleCurrentChange"-->
/> <!--/>-->
</div> <!--</div>-->
</template> <!--</template>-->
<template v-else> <!--<template v-else>-->
<div class="cooperate_empty"> <!--<div class="cooperate_empty">-->
<img src="@/assets/images/project/empty.png"/> <!--<img src="@/assets/images/project/empty.png"/>-->
<div class="empty-t">暂无客户联系人数据</div> <!--<div class="empty-t">暂无客户联系人数据</div>-->
<div class="empty-d">抱歉,你还未添加客户联系人,快去添加吧</div> <!--<div class="empty-d">抱歉,你还未添加客户联系人,快去添加吧</div>-->
<el-button type="primary" class="empty-b" @click="opennew">添加联系人</el-button> <!--<el-button type="primary" class="empty-b" @click="opennew">添加联系人</el-button>-->
</div> <!--</div>-->
</template> <!--</template>-->
<!-- 弹窗添加联系人 --> <!--&lt;!&ndash; 弹窗添加联系人 &ndash;&gt;-->
<el-dialog <!--<el-dialog-->
class="popups1" <!--class="popups1"-->
:visible.sync="dialogVisible" <!--:visible.sync="dialogVisible"-->
:before-close="cancel" <!--:before-close="cancel"-->
width="464px"> <!--width="464px">-->
<div class="poptitle"> <!--<div class="poptitle">-->
<img src="@/assets/images/economies/icon.png"> <!--<img src="@/assets/images/economies/icon.png">-->
<span>{{ companyInfo && companyInfo.companyName || customerInfo.companyName }}</span> <!--<span>{{ companyInfo && companyInfo.companyName || customerInfo.companyName }}</span>-->
</div> <!--</div>-->
<el-form :model="addRorm" :rules="addRules" ref="addRorm" class="popform" label-width="90px"> <!--<el-form :model="addRorm" :rules="addRules" ref="addRorm" class="popform" label-width="90px">-->
<el-form-item label="姓名:" prop="name"> <!--<el-form-item label="姓名:" prop="name">-->
<el-input v-model="addRorm.name" placeholder="请输入"></el-input> <!--<el-input v-model="addRorm.name" placeholder="请输入"></el-input>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="角色:" prop="role"> <!--<el-form-item label="角色:" prop="role">-->
<el-input v-model="addRorm.role" placeholder="请输入"></el-input> <!--<el-input v-model="addRorm.role" placeholder="请输入"></el-input>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="职位:" prop="workUnit"> <!--<el-form-item label="职位:" prop="workUnit">-->
<el-input v-model="addRorm.workUnit" placeholder="请输入"></el-input> <!--<el-input v-model="addRorm.workUnit" placeholder="请输入"></el-input>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="公司/机关:" prop="position"> <!--<el-form-item label="公司/机关:" prop="position">-->
<el-input v-model="addRorm.position" placeholder="请输入"></el-input> <!--<el-input v-model="addRorm.position" placeholder="请输入"></el-input>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="联系方式:" prop="contactInformation"> <!--<el-form-item label="联系方式:" prop="contactInformation">-->
<el-input v-model="addRorm.contactInformation" placeholder="请输入"></el-input> <!--<el-input v-model="addRorm.contactInformation" placeholder="请输入"></el-input>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="备注:" prop="remark"> <!--<el-form-item label="备注:" prop="remark">-->
<el-input v-model="addRorm.remark" placeholder="请输入"></el-input> <!--<el-input v-model="addRorm.remark" placeholder="请输入"></el-input>-->
</el-form-item> <!--</el-form-item>-->
<div class="popbot"> <!--<div class="popbot">-->
<div class="btn btn_cancel h32" @click="cancel">返回</div> <!--<div class="btn btn_cancel h32" @click="cancel">返回</div>-->
<div class="btn btn_primary h32" @click="add">保存</div> <!--<div class="btn btn_primary h32" @click="add">保存</div>-->
</div> <!--</div>-->
</el-form> <!--</el-form>-->
</el-dialog> <!--</el-dialog>-->
</div> <!--</div>-->
<lxr :isDisabled='isDisabled' :customerId="detailId" :customname="companyInfo.companyName" listtype="custom"></lxr>
</template> </template>
<script> <script>
import Tables from "../component/Tables" // import Tables from "../component/Tables"
import { // import {
getList, // getList,
addChain // addChain
} from '@/api/detail/party-a/decisionMaking' // } from '@/api/detail/party-a/decisionMaking'
import lxr from '../../../project/projectList/component/lxr.vue'
export default { export default {
name: 'DecisionMaking', name: 'DecisionMaking',
components: { components: {
Tables // Tables
lxr
}, },
props: ['customerIds','companyInfo','customerInfo'], props: ['customerIds','companyInfo','customerInfo'],
data() { data() {
return { return {
ifEmpty:false, isDisabled:false,
queryParams:{ detailId:this.customerIds,
customerId:this.customerIds, // ifEmpty:false,
pageNum:1, // queryParams:{
pageSize:20, // customerId:this.customerIds,
}, // pageNum:1,
forData: [ // pageSize:20,
{label: '姓名', prop: 'name', width: '124'}, // },
{label: '角色', prop: 'role', width: '110'}, // forData: [
{label: '公司/机关', prop: 'position', width: '268'}, // {label: '姓名', prop: 'name', width: '124'},
{label: '职位', prop: 'workUnit', width: '110'}, // {label: '角色', prop: 'role', width: '110'},
{label: '联系方式', prop: 'contactInformation', width: '105'}, // {label: '公司/机关', prop: 'position', width: '268'},
{label: '内部维护人', prop: 'updateBy', width: '100'}, // {label: '职位', prop: 'workUnit', width: '110'},
{label: '备注', prop: 'remark'}, // {label: '联系方式', prop: 'contactInformation', width: '105'},
], // {label: '内部维护人', prop: 'updateBy', width: '100'},
addRorm: { // {label: '备注', prop: 'remark'},
customerId:this.customerIds, // ],
name:'', // addRorm: {
role:'', // customerId:this.customerIds,
workUnit:'', // name:'',
position:'', // role:'',
contactInformation:'', // workUnit:'',
remark:'', // position:'',
}, // contactInformation:'',
addRules:{ // remark:'',
name: [ // },
{ required: true, message: '请输入姓名', trigger: 'blur' }, // addRules:{
], // name: [
}, // { required: true, message: '请输入姓名', trigger: 'blur' },
stageOptions:[], // ],
statusOptions:[], // },
//列表 // stageOptions:[],
tableLoading:false, // statusOptions:[],
tableData:[], // //列表
tableDataTotal:0, // tableLoading:false,
//弹窗 // tableData:[],
dialogVisible: false, // tableDataTotal:0,
// //弹窗
// dialogVisible: false,
} }
}, },
created() { created() {
this.list(); // this.list();
}, },
computed: { computed: {
}, },
methods: { methods: {
list(){ // list(){
this.tableLoading = true // this.tableLoading = true
getList(this.queryParams).then((res) => { // getList(this.queryParams).then((res) => {
if(res.code == 200){ // if(res.code == 200){
if(res.rows.length >0){ // if(res.rows.length >0){
this.tableData = res.rows // this.tableData = res.rows
this.tableDataTotal = res.total // this.tableDataTotal = res.total
this.ifEmpty = true // this.ifEmpty = true
} // }
this.tableLoading = false // this.tableLoading = false
} // }
}) // })
}, // },
//分页 // //分页
handleCurrentChange(e){ // handleCurrentChange(e){
this.queryParams.pageNum = e // this.queryParams.pageNum = e
this.list() // this.list()
}, // },
add(){ // add(){
this.$refs.addRorm.validate((valid) => { // this.$refs.addRorm.validate((valid) => {
if (valid) { // if (valid) {
addChain(this.addRorm).then((res) => { // addChain(this.addRorm).then((res) => {
if(res.data){ // if(res.data){
this.$message({ // this.$message({
message: '新增成功', // message: '新增成功',
type: 'success' // type: 'success'
}); // });
this.cancel() // this.cancel()
this.list() // this.list()
}else{ // }else{
this.$message({ // this.$message({
message: res.msg, // message: res.msg,
type: 'error' // type: 'error'
}); // });
} // }
}) // })
} // }
}); // });
}, // },
cancel(){ // cancel(){
this.$refs.addRorm.resetFields(); // this.$refs.addRorm.resetFields();
this.dialogVisible = false // this.dialogVisible = false
}, // },
//打开新建窗口 // //打开新建窗口
opennew(){ // opennew(){
this.dialogVisible = true // this.dialogVisible = true
}, // },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.decisionMaking{ /*.decisionMaking{*/
background: #ffffff; /*background: #ffffff;*/
border-radius: 4px; /*border-radius: 4px;*/
padding: 16px; /*padding: 16px;*/
input{ /*input{*/
border: 1px solid #EFEFEF; /*border: 1px solid #EFEFEF;*/
} /*}*/
::v-deep .el-form-item{ /*::v-deep .el-form-item{*/
margin-bottom: 16px; /*margin-bottom: 16px;*/
} /*}*/
::v-deep .el-input__inner{ /*::v-deep .el-input__inner{*/
border-radius: 2px 0 2px 0; /*border-radius: 2px 0 2px 0;*/
height: 32px; /*height: 32px;*/
line-height: 32px; /*line-height: 32px;*/
} /*}*/
.cooperate-name{ /*.cooperate-name{*/
::v-deep .el-form-item__content{ /*::v-deep .el-form-item__content{*/
display: flex; /*display: flex;*/
span{ /*span{*/
width: 60px; /*width: 60px;*/
height: 32px; /*height: 32px;*/
background: #F5F5F5; /*background: #F5F5F5;*/
text-align: center; /*text-align: center;*/
color: #0081FF; /*color: #0081FF;*/
border: 1px solid #EFEFEF; /*border: 1px solid #EFEFEF;*/
border-left: 0; /*border-left: 0;*/
cursor: pointer; /*cursor: pointer;*/
} /*}*/
} /*}*/
} /*}*/
.query-add{ /*.query-add{*/
button{ /*button{*/
width: 124px; /*width: 124px;*/
line-height: 32px; /*line-height: 32px;*/
height: 32px; /*height: 32px;*/
background: #0081FF; /*background: #0081FF;*/
border-radius: 2px 2px 2px 2px; /*border-radius: 2px 2px 2px 2px;*/
padding: 0; /*padding: 0;*/
color: #ffffff; /*color: #ffffff;*/
span{ /*span{*/
color: #ffff; /*color: #ffff;*/
margin-left: 4px; /*margin-left: 4px;*/
} /*}*/
} /*}*/
} /*}*/
.cooperate_empty{ /*.cooperate_empty{*/
text-align: center; /*text-align: center;*/
height: calc(100vh - 170px); /*height: calc(100vh - 170px);*/
display: flex; /*display: flex;*/
align-items: center; /*align-items: center;*/
justify-content: center; /*justify-content: center;*/
flex-direction: column; /*flex-direction: column;*/
img{ /*img{*/
width: 108px; /*width: 108px;*/
height: 108px; /*height: 108px;*/
border-radius: 50%; /*border-radius: 50%;*/
margin-bottom: 24px; /*margin-bottom: 24px;*/
} /*}*/
.empty-t{ /*.empty-t{*/
font-size: 16px; /*font-size: 16px;*/
color: #333333; /*color: #333333;*/
margin-bottom: 8px; /*margin-bottom: 8px;*/
} /*}*/
.empty-d{ /*.empty-d{*/
font-size: 14px; /*font-size: 14px;*/
font-weight: 400; /*font-weight: 400;*/
color: #999999; /*color: #999999;*/
margin-bottom: 24px; /*margin-bottom: 24px;*/
} /*}*/
.empty-b{ /*.empty-b{*/
width: 116px; /*width: 116px;*/
height: 36px; /*height: 36px;*/
background: #0081FF; /*background: #0081FF;*/
border-radius: 4px; /*border-radius: 4px;*/
padding: 0; /*padding: 0;*/
} /*}*/
} /*}*/
.table-item{ /*.table-item{*/
margin-top: 10px; /*margin-top: 10px;*/
} /*}*/
// 弹窗 /*// 弹窗*/
.popups1{ /*.popups1{*/
.poptitle { /*.poptitle {*/
line-height: 48px; /*line-height: 48px;*/
border-bottom: 1px solid #E1E1E1; /*border-bottom: 1px solid #E1E1E1;*/
height: 48px; /*height: 48px;*/
position: absolute; /*position: absolute;*/
top: 0; /*top: 0;*/
left: 0; /*left: 0;*/
width: 100%; /*width: 100%;*/
img { /*img {*/
width: 17px; /*width: 17px;*/
margin: 16px; /*margin: 16px;*/
float: left; /*float: left;*/
} /*}*/
span { /*span {*/
font-weight: bold; /*font-weight: bold;*/
font-size: 16px; /*font-size: 16px;*/
color: #232323; /*color: #232323;*/
font-family: Microsoft YaHei-Bold, Microsoft YaHei; /*font-family: Microsoft YaHei-Bold, Microsoft YaHei;*/
width: 385px; /*width: 385px;*/
display: block; /*display: block;*/
overflow: hidden; /*overflow: hidden;*/
white-space: nowrap; /*white-space: nowrap;*/
text-overflow: ellipsis; /*text-overflow: ellipsis;*/
} /*}*/
} /*}*/
::v-deep .el-dialog__body{ /*::v-deep .el-dialog__body{*/
padding: 24px 24px 18px; /*padding: 24px 24px 18px;*/
} /*}*/
.popform { /*.popform {*/
padding-top: 14px; /*padding-top: 14px;*/
::v-deep .el-form-item__label{ /*::v-deep .el-form-item__label{*/
padding:0; /*padding:0;*/
} /*}*/
.row { /*.row {*/
padding-bottom: 16px; /*padding-bottom: 16px;*/
.left { /*.left {*/
width: 137px; /*width: 137px;*/
display: inline-block; /*display: inline-block;*/
text-align: right; /*text-align: right;*/
opacity: 0.8; /*opacity: 0.8;*/
} /*}*/
::v-deep .el-input { /*::v-deep .el-input {*/
display: inline-block; /*display: inline-block;*/
width: 240px; /*width: 240px;*/
} /*}*/
} /*}*/
.popbot { /*.popbot {*/
text-align: right; /*text-align: right;*/
padding-top: 8px; /*padding-top: 8px;*/
} /*}*/
} /*}*/
} /*}*/
} /*}*/
::v-deep .el-table__fixed::before, ::v-deep .el-table__fixed-right::before{ /*::v-deep .el-table__fixed::before, ::v-deep .el-table__fixed-right::before{*/
background-color:unset; /*background-color:unset;*/
} /*}*/
::v-deep .el-dialog__headerbtn{ /*::v-deep .el-dialog__headerbtn{*/
z-index: 9; /*z-index: 9;*/
} /*}*/
</style> </style>
...@@ -26,39 +26,37 @@ ...@@ -26,39 +26,37 @@
<!--<div class="btn btn_primary h36 w102" @click="opennew" v-if="isDisableds == false">新增联系人</div>--> <!--<div class="btn btn_primary h36 w102" @click="opennew" v-if="isDisableds == false">新增联系人</div>-->
<!--</div>--> <!--</div>-->
<!--</template>--> <!--</template>-->
<el-table-column <el-table-column label="序号" width="60">
prop="name"
label="姓名"
width="113">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.name || '--'}} <span>{{(searchParam.pageNum - 1) *searchParam.pageSize + scope.$index + 1}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="操作" label="姓名"
width="118"> width="113">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="edit" @click="getDetail(scope.row)"> <div class="wordprimary"><span @click="getDetail(scope.row)">{{scope.row.name || '--'}} </span><img v-if="isDisabled == false" @click="deltip(scope.row.id)" src="@/assets/images/delete.png"></div>
<img src="@/assets/images/project/edit.png">
<span>编辑</span>
</div>
</template> </template>
</el-table-column> </el-table-column>
<!--<el-table-column-->
<!--prop="name"-->
<!--label="操作"-->
<!--width="118">-->
<!--<template slot-scope="scope">-->
<!--<div class="edit" @click="getDetail(scope.row)">-->
<!--<img src="@/assets/images/project/edit.png">-->
<!--<span>编辑</span>-->
<!--</div>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column <el-table-column
prop="role" prop="role"
label="角色" label="联系人性别"
sortable sortable
width="146"> width="146">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.role || '--'}} {{scope.row.sex==0?'女':'男' || '--'}}
</template>
</el-table-column>
<el-table-column
prop="office"
label="关联企业">
<template slot-scope="scope">
{{scope.row.office || '--'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -70,19 +68,47 @@ ...@@ -70,19 +68,47 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="phone" prop="role"
label="联系人角色"
sortable
width="146">
<template slot-scope="scope">
{{scope.row.role || '--'}}
</template>
</el-table-column>
<el-table-column
prop="contactInformation"
label="联系方式" label="联系方式"
width="175"> width="175">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.phone || '--'}} {{scope.row.contactInformation || '--'}}
</template>
</el-table-column>
<el-table-column
prop="office"
label="关联企业">
<template slot-scope="scope">
<router-link :to="scope.row.uipId?`/enterprise/${encodeStr(scope.row.uipId)}`:`/company/${encodeStr(scope.row.companyId)}`" tag="a" class="a-link" v-if="(scope.row.companyId||scope.row.uipId)&&scope.row.office" v-html="scope.row.office"></router-link>
<div v-else v-html="scope.row.office || '--'"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="accendant" prop="updateBy"
label="内部维护人" label="内部维护人"
width="146"> width="146">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.accendant || '--'}} {{scope.row.updateBy || '--'}}
</template>
</el-table-column>
<el-table-column v-if="thistype == 'custom'"
prop="projectName"
label="来源"
width="146">
<template slot-scope="scope">
<div v-if="scope.row.projectName && scope.row.projectId" class="wordprimary" @click="todetail(scope.row.projectId)">
{{scope.row.projectName || '--'}}
</div>
<div v-else>自主填报</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -104,7 +130,8 @@ ...@@ -104,7 +130,8 @@
width="464px"> width="464px">
<div class="poptitle"> <div class="poptitle">
<img src="@/assets/images/economies/icon.png"> <img src="@/assets/images/economies/icon.png">
<span>{{projectname}}</span> <span v-if="thistype == 'project'">{{projectname}}</span>
<span v-if="thistype == 'custom'">{{companyName}}</span>
</div> </div>
<el-form class="popform" :model="queryParam" ref="ruleForm" label-width="137px" :rules="rules" > <el-form class="popform" :model="queryParam" ref="ruleForm" label-width="137px" :rules="rules" >
<el-form-item label="联系人姓名:" class="row" prop="name"> <el-form-item label="联系人姓名:" class="row" prop="name">
...@@ -119,7 +146,7 @@ ...@@ -119,7 +146,7 @@
<el-form-item label="联系人角色:" class="row"> <el-form-item label="联系人角色:" class="row">
<el-input type="text" v-model="queryParam.role" placeholder="请输入"></el-input> <el-input type="text" v-model="queryParam.role" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="关联企业:" class="row"> <el-form-item label="关联企业:" class="row" v-if="thistype == 'project'">
<el-input type="text" v-model="queryParam.office" placeholder="请输入"></el-input> <el-input type="text" v-model="queryParam.office" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系人职位:" class="row"> <el-form-item label="联系人职位:" class="row">
...@@ -129,7 +156,15 @@ ...@@ -129,7 +156,15 @@
<!--<el-input type="text" v-model="queryParam.accendant" placeholder="请输入"></el-input>--> <!--<el-input type="text" v-model="queryParam.accendant" placeholder="请输入"></el-input>-->
<!--</el-form-item>--> <!--</el-form-item>-->
<el-form-item label="联系方式:" class="row"> <el-form-item label="联系方式:" class="row">
<el-input type="text" v-model="queryParam.phone" placeholder="请输入"></el-input> <el-input type="text" v-model="queryParam.contactInformation" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="备注:" class="row">
<el-input
type="textarea"
:rows="2"
placeholder="请输入"
v-model="queryParam.remark">
</el-input>
</el-form-item> </el-form-item>
<div class="popbot"> <div class="popbot">
<div class="btn btn_cancel h32" @click="cancel">返回</div> <div class="btn btn_cancel h32" @click="cancel">返回</div>
...@@ -137,26 +172,41 @@ ...@@ -137,26 +172,41 @@
</div> </div>
</el-form> </el-form>
</el-dialog> </el-dialog>
<div class="delform" v-if="isdel">
<div class="words">是否删除联系人</div>
<div>
<div class="btnsmall btn_primary h28" @click="deletes">确定</div>
<div class="btnsmall btn_cancel h28" @click="isdel=false">取消</div>
</div>
</div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import "@/assets/styles/project.scss" import "@/assets/styles/project.scss"
import {getLXR,editLXR,addLXR} from '@/api/project/project' import {getLXR,editLXR,addLXR,delLXR} from '@/api/project/project'
import skeleton from './skeleton' import skeleton from './skeleton'
import {encodeStr} from "@/assets/js/common.js"
export default { export default {
encodeStr,
components:{skeleton}, components:{skeleton},
name: 'lxr', name: 'lxr',
props: { props: {
detailId: { //从企业详情跳转过来ID detailId: { //从项目详情跳转过来ID
type: Number, type: Number,
default: 0 default: 0
}, },
customerId:'',//客户列表跳转过来ID
isDisabled:false, isDisabled:false,
listtype:'',//project项目详情 custom客户列表
customname:'',//企业名称
}, },
data(){ data(){
return{ return{
isdel:false,
thistype:this.listtype,
rules:{ rules:{
name:[{ required: true, message: '请输入非空格字符!', trigger: 'blur' },], name:[{ required: true, message: '请输入非空格字符!', trigger: 'blur' },],
}, },
...@@ -170,20 +220,44 @@ ...@@ -170,20 +220,44 @@
searchParam:{ searchParam:{
pageNum:1, pageNum:1,
pageSize:20, pageSize:20,
businessId:this.detailId ? this.detailId : this.$route.query.id
}, },
id:this.detailId ? this.detailId : this.$route.query.id,
total:0, total:0,
projectname:this.$route.query.projectname, projectname:this.$route.query.projectname,
companyName:this.customname,
queryParam:[], queryParam:[],
isDisableds:this.isDisabled, isDisableds:this.isDisabled,
isSkeleton:true, isSkeleton:true,
delid:null,
} }
}, },
created(){ created(){
if(this.thistype == 'project'){
this.searchParam.projectId = this.detailId ? this.detailId : this.$route.query.id
}
if(this.thistype == 'custom'){
this.searchParam.customerId = this.customerId ? this.customerId : null
}
this.getList() this.getList()
}, },
methods:{ methods:{
todetail(id){
this.$router.push({ path: '/project/projectList/detail', query: {id:id,tag:'xmsl'} });
},
deltip(id){
this.delid = id
this.isdel = true
},
deletes(){
delLXR(this.delid).then(res=>{
if(res.code == 200){
this.$message.success('删除成功!')
this.handleCurrentChange(1)
this.isdel = false
}
})
},
getDetail(item){ getDetail(item){
if(this.isDisableds == true){ if(this.isDisableds == true){
return this.$message.warning("您无权限进行操作") return this.$message.warning("您无权限进行操作")
...@@ -191,7 +265,7 @@ ...@@ -191,7 +265,7 @@
this.dialogVisible = true this.dialogVisible = true
item.sex = item.sex.toString() item.sex = item.sex.toString()
this.queryParam = item this.queryParam = JSON.parse(JSON.stringify(item))
this.isnew = false this.isnew = false
}, },
getList(){ getList(){
...@@ -207,13 +281,13 @@ ...@@ -207,13 +281,13 @@
if (valid) { if (valid) {
let param = JSON.parse(JSON.stringify(this.queryParam)) let param = JSON.parse(JSON.stringify(this.queryParam))
param.sex = parseInt(param.sex) param.sex = parseInt(param.sex)
if (!this.queryParam.phone) { if (!this.queryParam.contactInformation) {
this.$message.error('请输入电话号码') this.$message.error('请输入电话号码')
return false return false
} }
var regPartton = /1[3-9]+\d{9}/; var regPartton = /1[3-9]+\d{9}/;
var regPartton1 = /0\d{2,3}-\d{7,8}|\(?0\d{2,3}[)-]?\d{7,8}|\(?0\d{2,3}[)-]*\d{7,8}/; var regPartton1 = /0\d{2,3}-\d{7,8}|\(?0\d{2,3}[)-]?\d{7,8}|\(?0\d{2,3}[)-]*\d{7,8}/;
if (!regPartton.test(this.queryParam.phone) && !regPartton1.test(this.queryParam.phone)) { if (!regPartton.test(this.queryParam.contactInformation) && !regPartton1.test(this.queryParam.contactInformation)) {
this.$message.error("请输入正确的电话"); this.$message.error("请输入正确的电话");
return false return false
} }
...@@ -251,15 +325,21 @@ ...@@ -251,15 +325,21 @@
this.dialogVisible = true this.dialogVisible = true
this.isnew = true this.isnew = true
this.queryParam = { this.queryParam = {
businessId:this.id,
name:"", name:"",
sex:"1", sex:"1",
role:"", role:"",
office:"",
position:"", position:"",
phone:"", contactInformation:"",
remark:"",
// accendant:"", // accendant:"",
} }
if(this.thistype == 'project'){
this.queryParam.projectId = this.searchParam.projectId
this.office = ""
}
if(this.thistype == 'custom'){
this.queryParam.customerId = this.searchParam.customerId
}
}, },
} }
} }
...@@ -275,5 +355,25 @@ ...@@ -275,5 +355,25 @@
margin-right: 8px; margin-right: 8px;
background: url('../../../../../src/assets/images/project/add_2.png')no-repeat center center; background: url('../../../../../src/assets/images/project/add_2.png')no-repeat center center;
background-size: 100%; background-size: 100%;
}
.wordprimary{
img{
display: none;
height: 20px;
position: absolute;
margin-left: 10px;
}
&:hover{
img{
display: inline-block;
}
}
}
.delform{
position: fixed;
left: 50%;
top: 50%;
margin-left: -100px;
margin-top: -57px;
} }
</style> </style>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<!--建设内容--> <!--建设内容-->
<jsnr v-if="thistag == 'jsnr'" :key="keys1" :isDisabled='isDisabled' @Refrehmoney="getXMSL" :detailId="detailId"></jsnr> <jsnr v-if="thistag == 'jsnr'" :key="keys1" :isDisabled='isDisabled' @Refrehmoney="getXMSL" :detailId="detailId"></jsnr>
<!--联系人--> <!--联系人-->
<lxr v-if="thistag == 'lxr'" :isDisabled='isDisabled' :detailId="detailId"></lxr> <lxr v-if="thistag == 'lxr'" :isDisabled='isDisabled' :detailId="detailId" listtype="project"></lxr>
<!--跟进记录--> <!--跟进记录-->
<gjjl v-if="thistag == 'gjjl'" :isDisabled='isDisabled' types="gjjl" :detailId="detailId"></gjjl> <gjjl v-if="thistag == 'gjjl'" :isDisabled='isDisabled' types="gjjl" :detailId="detailId"></gjjl>
<!--工作待办--> <!--工作待办-->
......
package com.dsk.system.dskService; package com.dsk.system.dskService;
import cn.hutool.core.bean.BeanException;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
...@@ -13,6 +14,7 @@ import com.dsk.common.core.redis.RedisCache; ...@@ -13,6 +14,7 @@ import com.dsk.common.core.redis.RedisCache;
import com.dsk.common.utils.DskOpenApiUtil; import com.dsk.common.utils.DskOpenApiUtil;
import com.dsk.common.utils.EncodeIdUtil; import com.dsk.common.utils.EncodeIdUtil;
import com.dsk.system.domain.customer.vo.CustomerStatusListVo; import com.dsk.system.domain.customer.vo.CustomerStatusListVo;
import com.dsk.system.searchService.BusinessOpportunityRadarService;
import com.dsk.system.service.ICustomerService; import com.dsk.system.service.ICustomerService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
...@@ -21,11 +23,9 @@ import org.slf4j.LoggerFactory; ...@@ -21,11 +23,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
...@@ -80,7 +80,7 @@ public class EnterpriseService { ...@@ -80,7 +80,7 @@ public class EnterpriseService {
Integer bondCreditRatingCode = MapUtils.getInteger(bondCreditRatingMap, "code", 300); Integer bondCreditRatingCode = MapUtils.getInteger(bondCreditRatingMap, "code", 300);
if (200 != bondCreditRatingCode) return R.ok(companyData); if (200 != bondCreditRatingCode) return R.ok(companyData);
List<Map<String, Object>> bondCreditRatingList = (List<Map<String, Object>>)MapUtils.getObject(bondCreditRatingMap, "data", new ArrayList<>()); List<Map<String, Object>> bondCreditRatingList = (List<Map<String, Object>>) MapUtils.getObject(bondCreditRatingMap, "data", new ArrayList<>());
if (CollectionUtils.isEmpty(bondCreditRatingList)) return R.ok(companyData); if (CollectionUtils.isEmpty(bondCreditRatingList)) return R.ok(companyData);
companyData.put("bratingSubjectLevel", MapUtils.getString(bondCreditRatingList.get(0), "bratingSubjectLevel", null)); companyData.put("bratingSubjectLevel", MapUtils.getString(bondCreditRatingList.get(0), "bratingSubjectLevel", null));
...@@ -248,8 +248,8 @@ public class EnterpriseService { ...@@ -248,8 +248,8 @@ public class EnterpriseService {
for (Object dataMap : list) { for (Object dataMap : list) {
String name = MapUtils.getString(CommonUtils.assertAsMap(dataMap), "companyName"); String name = MapUtils.getString(CommonUtils.assertAsMap(dataMap), "companyName");
if (ObjectUtil.isNotEmpty(name) && ObjectUtil.isNotEmpty(body.getKeys())) { if (ObjectUtil.isNotEmpty(name) && ObjectUtil.isNotEmpty(body.getKeys())) {
name = name.replaceAll("<font color='red'>",""); name = name.replaceAll("<font color='red'>", "");
name = name.replaceAll("</font>",""); name = name.replaceAll("</font>", "");
companyNames.add(name); companyNames.add(name);
} else { } else {
companyNames.add(name); companyNames.add(name);
...@@ -267,7 +267,7 @@ public class EnterpriseService { ...@@ -267,7 +267,7 @@ public class EnterpriseService {
if (codeRating.equals(HttpStatus.OK.value())) { if (codeRating.equals(HttpStatus.OK.value())) {
Object object = bondCreditRatingMap.get("data"); Object object = bondCreditRatingMap.get("data");
if (ObjectUtil.isNotEmpty(object)) { if (ObjectUtil.isNotEmpty(object)) {
objArrayList = (ArrayList)object; objArrayList = (ArrayList) object;
} }
} }
...@@ -278,45 +278,45 @@ public class EnterpriseService { ...@@ -278,45 +278,45 @@ public class EnterpriseService {
String uipId = MapUtils.getString(companyMap, "uipId"); String uipId = MapUtils.getString(companyMap, "uipId");
String companyName = MapUtils.getString(companyMap, "companyName", ""); String companyName = MapUtils.getString(companyMap, "companyName", "");
if (ObjectUtil.isNotEmpty(companyName) && ObjectUtil.isNotEmpty(body.getKeys())) { if (ObjectUtil.isNotEmpty(companyName) && ObjectUtil.isNotEmpty(body.getKeys())) {
companyName = companyName.replace("<font color='red'>",""); companyName = companyName.replace("<font color='red'>", "");
companyName = companyName.replace("</font>",""); companyName = companyName.replace("</font>", "");
} }
Long companyId = MapUtils.getLong(companyMap, "companyId"); Long companyId = MapUtils.getLong(companyMap, "companyId");
companyMap.put("bondBalance",MapUtils.getDouble(companyMap, "bondBalance")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "bondBalance"))); companyMap.put("bondBalance", MapUtils.getDouble(companyMap, "bondBalance") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "bondBalance")));
companyMap.put("totalAssets",MapUtils.getDouble(companyMap, "totalAssets")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "totalAssets"))); companyMap.put("totalAssets", MapUtils.getDouble(companyMap, "totalAssets") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "totalAssets")));
companyMap.put("belongNetAssets",MapUtils.getDouble(companyMap, "belongNetAssets")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "belongNetAssets"))); companyMap.put("belongNetAssets", MapUtils.getDouble(companyMap, "belongNetAssets") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "belongNetAssets")));
companyMap.put("monetaryFunds",MapUtils.getDouble(companyMap, "monetaryFunds")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "monetaryFunds"))); companyMap.put("monetaryFunds", MapUtils.getDouble(companyMap, "monetaryFunds") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "monetaryFunds")));
companyMap.put("landAssets",MapUtils.getDouble(companyMap, "landAssets")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "landAssets"))); companyMap.put("landAssets", MapUtils.getDouble(companyMap, "landAssets") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "landAssets")));
companyMap.put("restrictedAssets",MapUtils.getDouble(companyMap, "restrictedAssets")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "restrictedAssets"))); companyMap.put("restrictedAssets", MapUtils.getDouble(companyMap, "restrictedAssets") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "restrictedAssets")));
companyMap.put("accountsReceivable",MapUtils.getDouble(companyMap, "accountsReceivable")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "accountsReceivable"))); companyMap.put("accountsReceivable", MapUtils.getDouble(companyMap, "accountsReceivable") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "accountsReceivable")));
companyMap.put("otherReceivable",MapUtils.getDouble(companyMap, "otherReceivable")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "otherReceivable"))); companyMap.put("otherReceivable", MapUtils.getDouble(companyMap, "otherReceivable") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "otherReceivable")));
companyMap.put("econData_001",MapUtils.getDouble(companyMap, "econData_001")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "econData_001"))); companyMap.put("econData_001", MapUtils.getDouble(companyMap, "econData_001") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "econData_001")));
companyMap.put("govSubsidy",MapUtils.getDouble(companyMap, "govSubsidy")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "govSubsidy"))); companyMap.put("govSubsidy", MapUtils.getDouble(companyMap, "govSubsidy") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "govSubsidy")));
companyMap.put("specialPayable",MapUtils.getDouble(companyMap, "specialPayable")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "specialPayable"))); companyMap.put("specialPayable", MapUtils.getDouble(companyMap, "specialPayable") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "specialPayable")));
companyMap.put("operatingIncome",MapUtils.getDouble(companyMap, "operatingIncome")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "operatingIncome"))); companyMap.put("operatingIncome", MapUtils.getDouble(companyMap, "operatingIncome") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "operatingIncome")));
companyMap.put("belongNetProfit",MapUtils.getDouble(companyMap, "belongNetProfit")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "belongNetProfit"))); companyMap.put("belongNetProfit", MapUtils.getDouble(companyMap, "belongNetProfit") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "belongNetProfit")));
companyMap.put("roe",MapUtils.getDouble(companyMap, "roe")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "roe"))); companyMap.put("roe", MapUtils.getDouble(companyMap, "roe") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "roe")));
companyMap.put("netOperatingCashFlow",MapUtils.getDouble(companyMap, "netOperatingCashFlow")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "netOperatingCashFlow"))); companyMap.put("netOperatingCashFlow", MapUtils.getDouble(companyMap, "netOperatingCashFlow") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "netOperatingCashFlow")));
companyMap.put("netFinancingCashFlow",MapUtils.getDouble(companyMap, "netFinancingCashFlow")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "netFinancingCashFlow"))); companyMap.put("netFinancingCashFlow", MapUtils.getDouble(companyMap, "netFinancingCashFlow") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "netFinancingCashFlow")));
companyMap.put("netInvestmentCashFlow",MapUtils.getDouble(companyMap, "netInvestmentCashFlow")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "netInvestmentCashFlow"))); companyMap.put("netInvestmentCashFlow", MapUtils.getDouble(companyMap, "netInvestmentCashFlow") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "netInvestmentCashFlow")));
companyMap.put("totalLiabilities",MapUtils.getDouble(companyMap, "totalLiabilities")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "totalLiabilities"))); companyMap.put("totalLiabilities", MapUtils.getDouble(companyMap, "totalLiabilities") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "totalLiabilities")));
companyMap.put("uipInterestBearingDebt",MapUtils.getDouble(companyMap, "uipInterestBearingDebt")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "uipInterestBearingDebt"))); companyMap.put("uipInterestBearingDebt", MapUtils.getDouble(companyMap, "uipInterestBearingDebt") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "uipInterestBearingDebt")));
companyMap.put("econData_002",MapUtils.getDouble(companyMap, "econData_002")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "econData_002"))); companyMap.put("econData_002", MapUtils.getDouble(companyMap, "econData_002") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "econData_002")));
companyMap.put("ofcb",MapUtils.getDouble(companyMap, "ofcb")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "ofcb"))); companyMap.put("ofcb", MapUtils.getDouble(companyMap, "ofcb") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "ofcb")));
companyMap.put("cashRatio",MapUtils.getDouble(companyMap, "cashRatio")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "cashRatio"))); companyMap.put("cashRatio", MapUtils.getDouble(companyMap, "cashRatio") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "cashRatio")));
companyMap.put("cashFlowRatio",MapUtils.getDouble(companyMap, "cashFlowRatio")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "cashFlowRatio"))); companyMap.put("cashFlowRatio", MapUtils.getDouble(companyMap, "cashFlowRatio") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "cashFlowRatio")));
companyMap.put("cashDebtRatio",MapUtils.getDouble(companyMap, "cashDebtRatio")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "cashDebtRatio"))); companyMap.put("cashDebtRatio", MapUtils.getDouble(companyMap, "cashDebtRatio") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "cashDebtRatio")));
companyMap.put("creditBalance",MapUtils.getDouble(companyMap, "creditBalance")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "creditBalance"))); companyMap.put("creditBalance", MapUtils.getDouble(companyMap, "creditBalance") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "creditBalance")));
companyMap.put("econData_003",MapUtils.getDouble(companyMap, "econData_003")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "econData_003"))); companyMap.put("econData_003", MapUtils.getDouble(companyMap, "econData_003") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "econData_003")));
companyMap.put("ebitdaIcr",MapUtils.getDouble(companyMap, "ebitdaIcr")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "ebitdaIcr"))); companyMap.put("ebitdaIcr", MapUtils.getDouble(companyMap, "ebitdaIcr") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "ebitdaIcr")));
companyMap.put("ppnBalanceProp",MapUtils.getDouble(companyMap, "ppnBalanceProp")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "ppnBalanceProp"))); companyMap.put("ppnBalanceProp", MapUtils.getDouble(companyMap, "ppnBalanceProp") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "ppnBalanceProp")));
companyMap.put("econData_004",MapUtils.getDouble(companyMap, "econData_004")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "econData_004"))); companyMap.put("econData_004", MapUtils.getDouble(companyMap, "econData_004") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "econData_004")));
companyMap.put("econData_005",MapUtils.getDouble(companyMap, "econData_005")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "econData_005"))); companyMap.put("econData_005", MapUtils.getDouble(companyMap, "econData_005") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "econData_005")));
companyMap.put("econData_006",MapUtils.getDouble(companyMap, "econData_006")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "econData_006"))); companyMap.put("econData_006", MapUtils.getDouble(companyMap, "econData_006") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "econData_006")));
companyMap.put("nonStandardBalance",MapUtils.getDouble(companyMap, "nonStandardBalance")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "nonStandardBalance"))); companyMap.put("nonStandardBalance", MapUtils.getDouble(companyMap, "nonStandardBalance") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "nonStandardBalance")));
companyMap.put("nonStandardRatio",MapUtils.getDouble(companyMap, "nonStandardRatio")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "nonStandardRatio"))); companyMap.put("nonStandardRatio", MapUtils.getDouble(companyMap, "nonStandardRatio") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "nonStandardRatio")));
companyMap.put("guaranteeAmount",MapUtils.getDouble(companyMap, "guaranteeAmount")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "guaranteeAmount"))); companyMap.put("guaranteeAmount", MapUtils.getDouble(companyMap, "guaranteeAmount") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "guaranteeAmount")));
companyMap.put("guaranteeRatio",MapUtils.getDouble(companyMap, "guaranteeRatio")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "guaranteeRatio"))); companyMap.put("guaranteeRatio", MapUtils.getDouble(companyMap, "guaranteeRatio") == null ? null : String.format("%.2f", MapUtils.getDouble(companyMap, "guaranteeRatio")));
companyMap.put("claimStatus", null); companyMap.put("claimStatus", null);
for (CustomerStatusListVo vo : claimStatusList) { for (CustomerStatusListVo vo : claimStatusList) {
...@@ -371,6 +371,7 @@ public class EnterpriseService { ...@@ -371,6 +371,7 @@ public class EnterpriseService {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterprise/bondCreditRating", BeanUtil.beanToMap(body, false, false)); Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterprise/bondCreditRating", BeanUtil.beanToMap(body, false, false));
return BeanUtil.toBean(map, R.class); return BeanUtil.toBean(map, R.class);
} }
public R getUipIdByCid(List<Integer> body) throws Exception { public R getUipIdByCid(List<Integer> body) throws Exception {
if (CollectionUtils.isEmpty(body)) return R.ok(); if (CollectionUtils.isEmpty(body)) return R.ok();
HashMap<String, Object> paramMap = new HashMap<>(); HashMap<String, Object> paramMap = new HashMap<>();
...@@ -396,9 +397,40 @@ public class EnterpriseService { ...@@ -396,9 +397,40 @@ public class EnterpriseService {
} }
Object data = map.get("data"); Object data = map.get("data");
if (ObjectUtil.isNotEmpty(data)) { if (ObjectUtil.isNotEmpty(data)) {
redisCache.setCacheList(redisKey, (List)data); redisCache.setCacheList(redisKey, (List) data);
redisCache.expire(redisKey, 24, TimeUnit.HOURS); redisCache.expire(redisKey, 24, TimeUnit.HOURS);
} }
return BeanUtil.toBean(map, R.class); return BeanUtil.toBean(map, R.class);
} }
@Autowired
private BusinessOpportunityRadarService opportunityRadarService;
//企业id、uipId
public Map<String, Object> getCidAndUipIdByCompanyName(String companyName) {
Map<String, Object> result = new HashMap<>();
if (ObjectUtils.isEmpty(companyName)) return result;
try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(companyName);
if (!ObjectUtils.isEmpty(map.get("data"))) {
result.put("companyId", MapUtil.getInt(BeanUtil.beanToMap(map.get("data")), "jskEid"));
}
if (!ObjectUtil.isEmpty(result.get("companyId"))) {
R res = this.getUipIdByCid(new ArrayList<>(MapUtils.getInteger(result, "companyId")));
if (!ObjectUtils.isEmpty(res.getData())) {
List<Map<String, Object>> data = (List<Map<String, Object>>) res.getData();
result.put("uipId", MapUtil.getStr(BeanUtil.beanToMap(data.get((0))), "uipId"));
}
}
if (ObjectUtil.isEmpty(result.get("uipId"))) {
R res = this.getUipId(companyName);
if (!ObjectUtils.isEmpty(res.getData())) {
result.put("uipId", MapUtil.getStr(BeanUtil.beanToMap(res.getData()), "uipId"));
}
}
} catch (Exception e) {
log.debug("获取企业id错误!error:{}", e.getMessage());
}
return result;
}
} }
...@@ -100,11 +100,4 @@ public interface IBusinessInfoService ...@@ -100,11 +100,4 @@ public interface IBusinessInfoService
List<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto); List<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto);
/**
* 查询企业的城投id和建设库id
* @param companyName
* @return
*/
Map queryUipIdOrCid (String companyName);
} }
...@@ -26,6 +26,7 @@ import com.dsk.system.domain.customer.vo.CustomerVo; ...@@ -26,6 +26,7 @@ import com.dsk.system.domain.customer.vo.CustomerVo;
import com.dsk.system.domain.business.vo.BusinessBrowseVo; import com.dsk.system.domain.business.vo.BusinessBrowseVo;
import com.dsk.system.domain.business.vo.BusinessLabelVo; import com.dsk.system.domain.business.vo.BusinessLabelVo;
import com.dsk.system.domain.business.vo.BusinessListVo; import com.dsk.system.domain.business.vo.BusinessListVo;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.BusinessInfoMapper; import com.dsk.system.mapper.BusinessInfoMapper;
import com.dsk.system.mapper.BusinessLabelMapper; import com.dsk.system.mapper.BusinessLabelMapper;
import com.dsk.system.mapper.BusinessRelateCompanyMapper; import com.dsk.system.mapper.BusinessRelateCompanyMapper;
...@@ -66,6 +67,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -66,6 +67,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
private DskOpenApiUtil dskOpenApiUtil; private DskOpenApiUtil dskOpenApiUtil;
@Autowired @Autowired
private ICustomerService customerService; private ICustomerService customerService;
@Autowired
private EnterpriseService enterpriseService;
/** /**
...@@ -98,8 +101,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -98,8 +101,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
List<BusinessListVo> businessListVos = businessInfoMapper.selectBusinessInfoList(dto); List<BusinessListVo> businessListVos = businessInfoMapper.selectBusinessInfoList(dto);
if (!CollectionUtils.isEmpty(businessListVos) && ObjectUtil.isNotEmpty(dto.getProjectName())) { if (!CollectionUtils.isEmpty(businessListVos) && ObjectUtil.isNotEmpty(dto.getProjectName())) {
for (BusinessListVo vo : businessListVos) { for (BusinessListVo vo : businessListVos) {
vo.setProjectName(StringUtils.markInRed(vo.getProjectName(),dto.getProjectName())); vo.setProjectName(StringUtils.markInRed(vo.getProjectName(), dto.getProjectName()));
vo.setOwnerCompany(StringUtils.markInRed(vo.getOwnerCompany(),dto.getProjectName())); vo.setOwnerCompany(StringUtils.markInRed(vo.getOwnerCompany(), dto.getProjectName()));
} }
} }
return businessListVos; return businessListVos;
...@@ -144,7 +147,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -144,7 +147,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
for (Map<String, Object> map : list) { for (Map<String, Object> map : list) {
BusinessLikeProjectNameListVo vo = new BusinessLikeProjectNameListVo(); BusinessLikeProjectNameListVo vo = new BusinessLikeProjectNameListVo();
vo.setProjectName(StringUtils.markInRed(MapUtil.getStr(map, "projectName"),dto.getProjectName())); vo.setProjectName(StringUtils.markInRed(MapUtil.getStr(map, "projectName"), dto.getProjectName()));
vo.setCompanyName(MapUtil.getStr(map, "tenderee")); vo.setCompanyName(MapUtil.getStr(map, "tenderee"));
vo.setInvestmentAmount(Double.parseDouble(MapUtil.getStr(map, "projectContractAmount"))); vo.setInvestmentAmount(Double.parseDouble(MapUtil.getStr(map, "projectContractAmount")));
vo.setProjectType(MapUtil.getStr(map, "projectType")); vo.setProjectType(MapUtil.getStr(map, "projectType"));
...@@ -288,17 +291,12 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -288,17 +291,12 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
if (!CheckUtils.isPhone(businessInfo.getConstructionPhone()) || !CheckUtils.isPhone(businessInfo.getSupervisorPhone())) if (!CheckUtils.isPhone(businessInfo.getConstructionPhone()) || !CheckUtils.isPhone(businessInfo.getSupervisorPhone()))
throw new BaseException("500", "请输入正确的电话号码"); throw new BaseException("500", "请输入正确的电话号码");
} }
// BusinessInfo info = businessInfoMapper.selectBusinessInfoById(businessInfo.getId());
//查询企业的城投id和建设库id //查询企业的城投id和建设库id
BusinessRelateCompany relateCompany = relateCompanyMapper.selectByProprietor(businessInfo.getId()); BusinessRelateCompany relateCompany = relateCompanyMapper.selectByProprietor(businessInfo.getId());
if (ObjectUtil.isNotEmpty(businessInfo.getConstructionUnit())) { if (ObjectUtil.isNotEmpty(businessInfo.getConstructionUnit())) {
Map map = queryUipIdOrCid(businessInfo.getConstructionUnit()); Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessInfo.getConstructionUnit());
if (map.containsKey("jskEid")) { businessInfo.setConstructionUnitUipId(MapUtils.getString(map, "uipId"));
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "jskEid", null)); businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "companyId"));
} else {
businessInfo.setConstructionUnitUipId(MapUtils.getString(map, "uipId", null));
businessInfo.setConstructionUnitCid(MapUtils.getInteger(map, "companyId", null));
}
//相关企业 //相关企业
if (ObjectUtil.isEmpty(relateCompany)) { if (ObjectUtil.isEmpty(relateCompany)) {
relateCompanyMapper.insertBusinessRelateCompany(dealwithCustomer(businessInfo)); relateCompanyMapper.insertBusinessRelateCompany(dealwithCustomer(businessInfo));
...@@ -309,16 +307,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -309,16 +307,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
relateCompany.setCompanyName(businessInfo.getConstructionUnit()); relateCompany.setCompanyName(businessInfo.getConstructionUnit());
relateCompanyMapper.updateBusinessRelateCompany(relateCompany); relateCompanyMapper.updateBusinessRelateCompany(relateCompany);
} }
// //客户信息
// if(ObjectUtil.isNotEmpty(info.getCustomerId())){
// CustomerVo customerVo = customerService.info(info.getCustomerId());
// customerVo
// customerService.edit(customerVo);
// }else {
// Customer customer = new Customer();
// customer.setCompanyName()
// customerService.add()
// }
} }
if (ObjectUtil.isNotEmpty(relateCompany) && if (ObjectUtil.isNotEmpty(relateCompany) &&
...@@ -382,43 +370,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -382,43 +370,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
return businessInfoMapper.selectCustomerBusinessList(dto); return businessInfoMapper.selectCustomerBusinessList(dto);
} }
@Override
public Map queryUipIdOrCid(String companyName) {
Map<Object, Object> map = MapUtil.builder().build();
if (StringUtils.isEmpty(companyName)) return map;
//查询城投企业
Map<String, Object> paramMap = MapUtil.<String, Object>builder().put("companyName", companyName).build();
Map<String, Object> resultMap = dskOpenApiUtil.requestBody("/urbanInvestment/detailsByCompanyName", paramMap);
Integer code = MapUtils.getInteger(resultMap, "code", 300);
if (code == HttpStatus.SUCCESS) {
Map data = MapUtils.getMap(resultMap, "data", null);
if (data != null) {
map.put("uipId", MapUtils.getString(data, "uipId", null));
map.put("companyId", MapUtils.getInteger(data, "companyId", null));
}
}
if (MapUtil.isEmpty(map)) {
//查村建设库企业
Map<String, Object> jskParamMap = MapUtil.<String, Object>builder()
.put("keyword", companyName)
.put("page", MapUtil.<String, Object>builder().put("page", 1).put("limit", 10).build())
.build();
Map<String, Object> jskResultMap = dskOpenApiUtil.requestBody("/enterprise/index", jskParamMap);
if (MapUtils.getInteger(resultMap, "code", 300).equals(HttpStatus.SUCCESS)) {
Map data = MapUtils.getMap(jskResultMap, "data", null);
if (data != null) {
List<Object> list = CommonUtils.assertAsArray(MapUtils.getObject(data, "list", ""));
if (CollectionUtil.isNotEmpty(list)) {
for (Object obj : list) {
map.put("jskEid", MapUtils.getInteger(BeanUtil.beanToMap(obj, false, false), "jskEid", null));
}
}
}
}
}
return map;
}
private BusinessRelateCompany dealwithCustomer(BusinessInfo bean) { private BusinessRelateCompany dealwithCustomer(BusinessInfo bean) {
BusinessRelateCompany relateCompany = new BusinessRelateCompany(); BusinessRelateCompany relateCompany = new BusinessRelateCompany();
relateCompany.setBusinessId(bean.getId()); relateCompany.setBusinessId(bean.getId());
......
...@@ -7,10 +7,11 @@ import com.dsk.common.exception.base.BaseException; ...@@ -7,10 +7,11 @@ import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils; import com.dsk.common.utils.CheckUtils;
import com.dsk.common.utils.DateUtils; import com.dsk.common.utils.DateUtils;
import com.dsk.system.domain.business.dto.BusinessIdDto; import com.dsk.system.domain.business.dto.BusinessIdDto;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.BusinessRelateCompanyMapper; import com.dsk.system.mapper.BusinessRelateCompanyMapper;
import com.dsk.system.service.IBusinessInfoService;
import com.dsk.system.service.IBusinessRelateCompanyService; import com.dsk.system.service.IBusinessRelateCompanyService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -26,12 +27,11 @@ import java.util.stream.Collectors; ...@@ -26,12 +27,11 @@ import java.util.stream.Collectors;
* @date 2023-05-17 * @date 2023-05-17
*/ */
@Service @Service
public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyService public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyService {
{
@Resource @Resource
private BusinessRelateCompanyMapper businessRelateCompanyMapper; private BusinessRelateCompanyMapper businessRelateCompanyMapper;
@Resource @Autowired
private IBusinessInfoService businessInfoService; private EnterpriseService enterpriseService;
/** /**
* 查询项目关联单位 * 查询项目关联单位
...@@ -40,8 +40,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -40,8 +40,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位 * @return 项目关联单位
*/ */
@Override @Override
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id) public BusinessRelateCompany selectBusinessRelateCompanyById(Long id) {
{
return businessRelateCompanyMapper.selectBusinessRelateCompanyById(id); return businessRelateCompanyMapper.selectBusinessRelateCompanyById(id);
} }
...@@ -52,8 +51,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -52,8 +51,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 项目关联单位 * @return 项目关联单位
*/ */
@Override @Override
public List<BusinessRelateCompany> selectBusinessRelateCompanyList(BusinessRelateCompany businessRelateCompany) public List<BusinessRelateCompany> selectBusinessRelateCompanyList(BusinessRelateCompany businessRelateCompany) {
{
return businessRelateCompanyMapper.selectBusinessRelateCompanyList(businessRelateCompany); return businessRelateCompanyMapper.selectBusinessRelateCompanyList(businessRelateCompany);
} }
...@@ -65,18 +63,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -65,18 +63,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
*/ */
@Override @Override
@Transactional @Transactional
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) {
{ if (ObjectUtil.isNotEmpty(businessRelateCompany.getPhone()) && !CheckUtils.isPhone(businessRelateCompany.getPhone())) {
// if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的电话号码"); throw new BaseException("500", "请输入正确的电话号码");
businessRelateCompany.setCreateTime(DateUtils.getNowDate());
//查询企业的城投id和建设库id
Map map = businessInfoService.queryUipIdOrCid(businessRelateCompany.getCompanyName());
if(map.containsKey("jskEid")){
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"jskEid",null));
}else {
businessRelateCompany.setCompanyUipId(MapUtils.getString(map,"uipId",null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"companyId",null));
} }
//查询企业的城投id和建设库id
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.insertBusinessRelateCompany(businessRelateCompany); return businessRelateCompanyMapper.insertBusinessRelateCompany(businessRelateCompany);
} }
...@@ -88,20 +82,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -88,20 +82,14 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
*/ */
@Override @Override
@Transactional @Transactional
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) {
{ if (ObjectUtil.isNotEmpty(businessRelateCompany.getPhone()) && !CheckUtils.isPhone(businessRelateCompany.getPhone())) {
if(ObjectUtil.isNotEmpty(businessRelateCompany.getPhone())){ throw new BaseException("500", "请输入正确的电话号码");
if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的电话号码");
} }
businessRelateCompany.setUpdateTime(DateUtils.getNowDate());
//查询企业的城投id和建设库id //查询企业的城投id和建设库id
Map map = businessInfoService.queryUipIdOrCid(businessRelateCompany.getCompanyName()); Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
if(map.containsKey("jskEid")){ businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"jskEid",null)); businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
}else {
businessRelateCompany.setCompanyUipId(MapUtils.getString(map,"uipId",null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map,"companyId",null));
}
return businessRelateCompanyMapper.updateBusinessRelateCompany(businessRelateCompany); return businessRelateCompanyMapper.updateBusinessRelateCompany(businessRelateCompany);
} }
...@@ -112,8 +100,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -112,8 +100,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteBusinessRelateCompanyByIds(Long[] ids) public int deleteBusinessRelateCompanyByIds(Long[] ids) {
{
return businessRelateCompanyMapper.deleteBusinessRelateCompanyByIds(ids); return businessRelateCompanyMapper.deleteBusinessRelateCompanyByIds(ids);
} }
...@@ -124,8 +111,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -124,8 +111,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteBusinessRelateCompanyById(Long id) public int deleteBusinessRelateCompanyById(Long id) {
{
return businessRelateCompanyMapper.deleteBusinessRelateCompanyById(id); return businessRelateCompanyMapper.deleteBusinessRelateCompanyById(id);
} }
...@@ -136,6 +122,6 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS ...@@ -136,6 +122,6 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
.eq(BusinessRelateCompany::getBusinessId, dto.getBusinessId()) .eq(BusinessRelateCompany::getBusinessId, dto.getBusinessId())
.groupBy(BusinessRelateCompany::getCompanyRole) .groupBy(BusinessRelateCompany::getCompanyRole)
.orderByDesc(BusinessRelateCompany::getCreateTime)); .orderByDesc(BusinessRelateCompany::getCreateTime));
return roleList.stream().map(p ->p.getCompanyRole()).collect(Collectors.toList()); return roleList.stream().map(p -> p.getCompanyRole()).collect(Collectors.toList());
} }
} }
...@@ -6,14 +6,18 @@ import com.dsk.common.utils.SecurityUtils; ...@@ -6,14 +6,18 @@ import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.ContactInfo; import com.dsk.system.domain.customer.ContactInfo;
import com.dsk.system.domain.customer.dto.ContactInfoSearchDto; import com.dsk.system.domain.customer.dto.ContactInfoSearchDto;
import com.dsk.system.domain.customer.vo.ContactInfoListVo; import com.dsk.system.domain.customer.vo.ContactInfoListVo;
import com.dsk.system.dskService.EnterpriseService;
import com.dsk.system.mapper.ContactInfoMapper; import com.dsk.system.mapper.ContactInfoMapper;
import com.dsk.system.service.IContactInfoService; import com.dsk.system.service.IContactInfoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 用户联系人(CustomerContact)表服务实现类 * 用户联系人(CustomerContact)表服务实现类
...@@ -28,6 +32,12 @@ public class ContactInfoServiceImpl implements IContactInfoService { ...@@ -28,6 +32,12 @@ public class ContactInfoServiceImpl implements IContactInfoService {
@Resource @Resource
private ContactInfoMapper baseMapper; private ContactInfoMapper baseMapper;
@Autowired
private EnterpriseService enterpriseService;
// @Resource
// private ICustomerService customerService;
@Override @Override
public List<ContactInfoListVo> selectList(ContactInfoSearchDto dto) { public List<ContactInfoListVo> selectList(ContactInfoSearchDto dto) {
return baseMapper.selectPageList(dto); return baseMapper.selectPageList(dto);
...@@ -41,6 +51,7 @@ public class ContactInfoServiceImpl implements IContactInfoService { ...@@ -41,6 +51,7 @@ public class ContactInfoServiceImpl implements IContactInfoService {
@Override @Override
public boolean insert(ContactInfo bean) { public boolean insert(ContactInfo bean) {
verifyParameter(bean); verifyParameter(bean);
bean.setCreateBy(bean.getUpdateBy());
return baseMapper.insert(bean) > 0; return baseMapper.insert(bean) > 0;
} }
...@@ -60,9 +71,18 @@ public class ContactInfoServiceImpl implements IContactInfoService { ...@@ -60,9 +71,18 @@ public class ContactInfoServiceImpl implements IContactInfoService {
* 参数验证 * 参数验证
*/ */
private void verifyParameter(ContactInfo bean) { private void verifyParameter(ContactInfo bean) {
// if (ObjectUtils.isEmpty(bean.getCustomerId())) throw new BeanException("客户id不能为空!"); if (!ObjectUtils.isEmpty(bean.getCompanyName())) {
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(bean.getCompanyName());
bean.setCompanyId(MapUtils.getInteger(map, "companyId"));
bean.setUipId(MapUtils.getString(map, "uipId"));
}
// if (!ObjectUtils.isEmpty(bean.getCustomerId()) && ObjectUtils.isEmpty(bean.getId())) {
// CustomerVo info = customerService.info(bean.getCustomerId());
// bean.setCompanyName(info.getCompanyName());
// bean.setCompanyId(info.getCompanyId());
// bean.setUipId(info.getUipId());
// }
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
bean.setCreateBy(loginUser.getUser().getNickName());
bean.setUpdateId(loginUser.getUserId()); bean.setUpdateId(loginUser.getUserId());
bean.setUpdateBy(loginUser.getUser().getNickName()); bean.setUpdateBy(loginUser.getUser().getNickName());
} }
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
from contact_info cc from contact_info cc
left join business_info bi on cc.project_id = bi.id left join business_info bi on cc.project_id = bi.id
<where> <where>
<if test="cc.customerId != null and cc.customerId !='' "> and (cc.customer_id = #{customerId} or cc.company_name =#{companyName})</if> <if test="customerId != null and customerId !='' "> and (cc.customer_id = #{customerId} or bi.customer_id = #{customerId})</if>
<if test="cc.projectId != null "> and cc.project_id = #{projectId} </if> <if test="projectId != null "> and cc.project_id = #{projectId} </if>
</where> </where>
order by cc.create_time desc order by cc.create_time desc
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment