Commit 33dafbda authored by liuChang's avatar liuChang

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

parents 1baca8db 035c20d7
package com.dsk.web.controller.customer;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import com.dsk.system.service.ICustomerOverviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 客户概览
* @author lcl
* @create 2023/8/15
*/
@RestController
@RequestMapping("/customer/overview")
public class CustomerOverviewController extends BaseController {
@Autowired
private ICustomerOverviewService baseService;
/**
* 客户统计
*/
@GetMapping("/statistics")
public AjaxResult statistics(){
return AjaxResult.success(baseService.statistics(new CustomerSearchDto()));
}
/**
* 客户合作情况
*/
@GetMapping("/cooperation/top")
public AjaxResult cooperationTop(){
return AjaxResult.success(baseService.cooperationTop(new CustomerSearchDto()));
}
/**
* 客户信资评级
*/
@GetMapping("/credit/level")
public AjaxResult creditLevel(){
return AjaxResult.success(baseService.cooperationTop(new CustomerSearchDto()));
}
}
......@@ -121,5 +121,10 @@ public class EnterpriseBussinessController {
return enterpriseBussinessService.awardDetail(paramMap);
}
@ApiOperation(value = "荣誉奖项详情")
@RequestMapping(value = "/select", method = RequestMethod.POST)
public R select(@RequestBody EnterpriseBusinessAwardDetailBody paramMap) throws Exception {
return enterpriseBussinessService.select(paramMap);
}
}
......@@ -28,6 +28,13 @@ public class EnterpriseController {
@Autowired
private EnterpriseService enterpriseService;
@ApiOperation(value = "企业标签信息(建设库)")
@PostMapping("/label")
public R label(@RequestBody @Valid EnterpriseInfoLabelBody body) throws Exception {
return enterpriseService.label(body);
}
@ApiOperation(value = "企业详情头部信息(建设库)")
@PostMapping("/infoHeader")
public R infoHeader(@RequestBody @Valid EnterpriseInfoHeaderBody body) throws Exception {
......
package com.dsk.web.controller.dsk;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.model.*;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.dskService.IndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @ClassName IndexController
* @Description TODO
* @Author Dgm
* @Date 2023/8/15 12:01
* @Version 1.0
*/
@Api("首页数据相关")
@RestController
@RequestMapping("/index")
public class IndexController {
@Autowired
private IndexService enterpriseService;
@ApiOperation(value = "企业中标排行榜")
@PostMapping("/winningBidsRanking")
public R winningBidsRanking(@RequestBody Map<String, Object> paramMap) throws Exception {
return enterpriseService.winningBidsRanking(paramMap);
}
@ApiOperation(value = "企业中标排行-项目类型")
@PostMapping("/rankingProjectType")
public R rankingProjectType(@RequestBody Map<String, Object> paramMap) throws Exception {
return enterpriseService.rankingProjectType(paramMap);
}
@ApiOperation(value = "大项目最新中标")
@PostMapping(value = "bigWinningBidsPage")
public TableDataInfo bigWinningBidsPage(@RequestBody IndexBigWinningBidsPageBody vo) throws Exception {
return enterpriseService.bigWinningBidsPage(vo);
}
@ApiOperation(value = "大项目最新招标")
@PostMapping(value = "bigBidPage")
public TableDataInfo bigBidPage(@RequestBody IndexBigBidPageBody vo) throws Exception {
return enterpriseService.bigBidPage(vo);
}
@ApiOperation(value = "企业中标排行-项目类型")
@PostMapping("/bigBidProjectType")
public R bigBidProjectType(@RequestBody Map<String, Object> paramMap) throws Exception {
return enterpriseService.bigBidProjectType(paramMap);
}
}
package com.dsk.common.core.domain.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class EnterpriseInfoLabelBody
{
/**
* 企业id
*/
@NotNull(message = "企业id不能为空")
private Integer companyId;
public boolean isVaildCid() {
return 0 == companyId;
}
}
package com.dsk.common.core.domain.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.Date;
import java.util.List;
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class IndexBigBidPageBody extends BasePage
{
/**
* 开始时间
*/
private Date timeStart;
/**
* 截止时间
*/
private Date timeEnd;
/**
* 金额起 默认2亿
*/
private Double amountStart = 20000.00;
/**
* 金额止
*/
private Double amountEnd;
/**
* 省份Id
*/
private Integer provinceId;
private List<String> projects;
}
package com.dsk.common.core.domain.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.Date;
import java.util.List;
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class IndexBigWinningBidsPageBody extends BasePage {
/**
* 开始时间
*/
private Date timeStart;
/**
* 截止时间
*/
private Date timeEnd;
/**
* 金额起 默认2亿
*/
private Double amountStart = 20000.00;
/**
* 金额止
*/
private Double amountEnd;
/**
* 省份Id
*/
private Integer provinceId;
private List<String> projects;
}
......@@ -98,9 +98,9 @@
{label: '企业地区', prop: 'address', minWidth: '150'},
],
formData: [
{ type: 4, fieldName: 'combineMemberLevel', value: '', placeholder: '成员层级', options:[]},
{ type: 4, fieldName: 'businessType', value: '', placeholder: '主营业务', options:[]},
{ type: 7, fieldName: 'province', value: '',props: {multiple: true}, placeholder: '地区', options:[]},
{ type: 4, fieldName: 'combineMemberLevels', value: '', placeholder: '成员层级', options:[]},
{ type: 1, fieldName: 'businessType', value: '', placeholder: '主营业务', options:[]},
{ type: 7, fieldName: 'province', value: '',props: {multiple: true,value: 'id',expandTrigger: 'hover'}, placeholder: '地区', options:[]},
{ type: 6, fieldName: 'money', value: '', placeholder: '注册资本', startMoney: 'minAmount', endMoney: 'maxAmount',moneyList:[] },
{ type: 0, fieldName: 'penalizeReasonType', value: '', placeholder: '筛选', options: []},
{ type: 3, fieldName: 'searchValue', value: '', placeholder: '输入关键词查询'},
......@@ -115,16 +115,20 @@
value:'集团本身'
},
{
name:'一级公司',
value:'一级公司'
name:'一级公司',
value:'一级公司'
},
{
name:'二级公司',
value:'二级公司'
name:'二级公司',
value:'二级公司'
},
{
name:'三级子公司',
value:'三级子公司'
name:'三级公司',
value:'三级公司'
},
{
name:'其他公司',
value:'其他公司'
},
],
kjxqy:[
......@@ -223,9 +227,13 @@
handleQuery(params){
let data = this.getAreaList(params || this.queryParams)
memberList(data).then(res=>{
this.isSkeleton = false
if(res.code === 200){
this.tableData = res.rows
this.tableDataTotal = res.total
this.isSkeleton = false
}else {
this.tableData = []
}
})
},
//地区
......@@ -328,14 +336,14 @@
getAreaList(params){
if(params.province&&params.province.length>0){
let arr = this.$children[0].$refs.cascader[0].getCheckedNodes()
let provinceIds = [], cityIds = [], areaIds = []
let provinceIds = [], cityIds = [], districtIds = []
for (var i in arr) {
if (arr[i].parent) {
if (!arr[i].parent.checked) {
if(arr[i].hasChildren || arr[i].level==2){
cityIds.push(arr[i].data.id)
}else{
areaIds.push(arr[i].data.id)
districtIds.push(arr[i].data.id)
}
}
} else {
......@@ -345,19 +353,19 @@
delete params.province
provinceIds.length>0?params.provinceIds = provinceIds:''
cityIds.length>0?params.cityIds = cityIds:''
areaIds.length>0?params.areaIds = areaIds:''
districtIds.length>0?params.districtIds = districtIds:''
}
return params
},
sortChange({ column, prop, order }){
this.queryParams.field = prop
this.queryParams.orderName = prop
if(column.order === "ascending"){
this.queryParams.order = 'asc'
this.queryParams.orderType = 'asc'
}else if(column.order === "descending"){
this.queryParams.order = 'desc'
this.queryParams.orderType = 'desc'
}else {
this.queryParams.order=''
this.queryParams.field=''
this.queryParams.orderType=''
this.queryParams.orderName=''
}
this.pageIndex = 1;
this.handleQuery()
......
......@@ -77,7 +77,7 @@
{label: '业主单位', prop: 'projectUnit', slot: true,minWidth: '200'},
],
formData: [
{ type: 7, fieldName: 'combineMemberLevel', value: '',props: {multiple: true}, placeholder: '项目地区', options:[]},
{ type: 7, fieldName: 'province', value: '',props: {multiple: true,value: 'id',expandTrigger: 'hover'}, placeholder: '项目地区', options:[]},
{ type: 5, fieldName: 'time', value: '', placeholder: '中标时间', startTime: 'startBidTime', endTime: 'endBidTime',timeList:[] },
{ type: 6, fieldName: 'money', value: '', placeholder: '中标金额', startMoney: 'minAmount', endMoney: 'maxAmount',moneyList:[] },
{ type: 4, fieldName: 'boundTypes', value: '', placeholder: '业绩类型', options: []},
......@@ -136,7 +136,7 @@
methods: {
handleQuery(params){
this.isSkeleton = true
let data = params ? params : this.queryParams;
let data = this.getAreaList(params || this.queryParams)
if(data.cgbl){
if(data.cgbl === '100%'){
data.minStockPercent=1
......@@ -214,6 +214,30 @@
this.addressList = str;
this.formData[0].options=str;
},
getAreaList(params){
if(params.province&&params.province.length>0){
let arr = this.$children[0].$refs.cascader[0].getCheckedNodes()
let provinceIds = [], cityIds = [], districtIds = []
for (var i in arr) {
if (arr[i].parent) {
if (!arr[i].parent.checked) {
if(arr[i].hasChildren || arr[i].level==2){
cityIds.push(arr[i].data.id)
}else{
districtIds.push(arr[i].data.id)
}
}
} else {
provinceIds.push(arr[i].data.id)
}
}
delete params.province
provinceIds.length>0?params.provinceIds = provinceIds:''
cityIds.length>0?params.cityIds = cityIds:''
districtIds.length>0?params.districtIds = districtIds:''
}
return params
},
}
}
</script>
......
......@@ -53,14 +53,14 @@
queryParams: {
combineId:'54355f88a5b16d3e52f74931f5567853',
pageNum: 1,
pageSize: 10
pageSize: 20
},
forData: [
{label: '资质名称', prop: 'qualificationName'},
{label: '拥有该资质成员', prop: 'companyCount', slot: true},
],
formData: [
{ type: 4, fieldName: 'combineMemberLevel', value: '', placeholder: '筛选', options:[]},
{ type: 1, fieldName: 'qualificationType', value: '', placeholder: '筛选', options:[]},
],
tableData:[],
tableDataTotal:0,
......@@ -77,9 +77,13 @@
this.isSkeleton = true
let data = params ? params : this.queryParams
certificateList(data).then(res=>{
this.isSkeleton = false
if(res.code === 200){
this.tableData = res.rows
this.tableDataTotal = res.total
this.isSkeleton = false
}else {
this.tableData = []
}
})
},
getCertificateList(){
......
......@@ -6,7 +6,9 @@
custom-class="client-drawer"
:with-header="false"
@closed="cancel">
<skeleton style="margin-left:16px;" v-if="isSkeleton"></skeleton>
<tables
v-if="!isSkeleton"
:indexFixed="true"
:tableLoading="tableLoading"
:tableData="tableData"
......@@ -39,6 +41,7 @@ export default {
data() {
return {
drawer: false,
isSkeleton:true,
queryParams: {
id: this.data.id,
pageNum: 1,
......@@ -64,10 +67,10 @@ export default {
},
methods: {
async handleQuery(params) {
this.tableLoading = true
this.isSkeleton = true
let param = params?params:this.queryParams
let res = await memberCertificateList(param)
this.tableLoading = false
this.isSkeleton = false
if(res.code==200){
this.tableData = res.rows
}
......
......@@ -151,6 +151,9 @@ export default {
case '一亿以上':
moneyStr = [10000]
break;
case '5亿-10亿':
moneyStr = [50000, 100000]
break;
case '1亿-10亿':
moneyStr = [10000, 100000]
break;
......
......@@ -14,7 +14,7 @@
:style="form.width?'width:'+form.width+'px':'max-width: 110px'"
:placeholder="form.placeholder"
@change="changeSelect">
<el-option v-for="(item, index) in form.options" :key="index" :label="item.name" :value="item.value" />
<el-option v-for="(item, index) in form.options" :key="index" :label="item.name" :value="item.value" :disabled="item.disabled"/>
</el-select>
</template>
<!-- 年月日 -->
......@@ -51,7 +51,7 @@
style="max-width: 170px"
:placeholder="form.placeholder"
@change="changeSelect">
<el-option v-for="(item, index) in form.options" :key="index" :label="item.name" :value="item.value" :disabled="item.disabled"/>
<el-option v-for="(item, index) in form.options" :key="index" :label="item.name" :value="item.value"/>
</el-select>
</template>
<!-- 时间、自定义 -->
......
......@@ -59,7 +59,16 @@ export default {
handleSearch(){
let params = this.formParams()
params.pageNum = 1
this.queryParams.pageNum = 1
this.queryParams.pageNum = 1;
if(params.companyTypes){
if(params.companyTypes.length === 0){
delete params.companyTypes
}
}
if(!params.companyType){
delete params.companyType
}
this.handleQuery(params)
},
//分页
......
This diff is collapsed.
......@@ -75,7 +75,7 @@
<el-table-column prop="count" label="中标数量 (个)" align="right" :formatter="formatStatus" sortable width="130"/>
<el-table-column prop="countRate" label="数量占比(%)" align="right" :formatter="formatStatus" sortable width="150"/>
<el-table-column prop="sumMoney" label="中标总金额 (万元)" align="right" :formatter="formatStatus" width="140"/>
<el-table-column prop="moneyRate" label="金额占比(%)" align="right" :formatter="formatStatus" width="120"/>
<el-table-column prop="moneyRate" label="金额占比(%)" align="right" :formatter="formatStatus"/>
</el-table>
</div>
</div>
......@@ -130,7 +130,7 @@
</div>
</div>
<div class="content_box">
<div class="box-left" style="width: 60%;">
<div class="box-left">
<div id="echarts4" style="height: 300px"></div>
</div>
<div class="box-right">
......@@ -175,7 +175,7 @@
border
show-summary
max-height="280"
:summary-method="getSummaries"
:summary-method="getSummaries1"
fit
highlight-current-row
:default-sort = "{prop: 'count', order: 'descending'}"
......@@ -208,7 +208,7 @@
</div>
</div>
<div class="content_box" v-if="topList.length > 0 && !isSkeleton">
<div class="box-left" style="width: 60%;">
<div class="box-left">
<div id="echarts6" style="height: 300px"></div>
</div>
<div class="box-right">
......@@ -218,7 +218,7 @@
border
show-summary
max-height="280"
:summary-method="getSummaries1"
:summary-method="getSummaries2"
fit
highlight-current-row
:default-sort = "{prop: 'count', order: 'descending'}"
......@@ -227,9 +227,9 @@
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column prop="month" label="时间" :formatter="formatStatus" width="120"/>
<el-table-column prop="sgRate" label="施工类项目下浮率(%)" align="right" :formatter="formatStatus" width="170"/>
<el-table-column prop="kcsjRate" label="勘察设计类项目下浮率(%)" align="right" :formatter="formatStatus" width="200"/>
<el-table-column prop="jlRate" label="监理类项目下浮率(%)" align="right" :formatter="formatStatus" width="170"/>
<el-table-column prop="sgRate" label="施工类下浮率(%)" align="right" :formatter="formatStatus" width="160"/>
<el-table-column prop="kcsjRate" label="勘察设计类下浮率(%)" align="right" :formatter="formatStatus"/>
<el-table-column prop="jlRate" label="监理类下浮率(%)" align="right" :formatter="formatStatus" width="160"/>
</el-table>
</div>
</div>
......@@ -306,9 +306,13 @@
this.xmtjList.forEach(item =>{
item.money=Number(item.money)
})
var list=[];
for(var i=0;i<10;i++){
list.push(res.data.date[i])
}
if(res.data){
this.$nextTick(() => {
this.initChart1(res.data.date)
this.initChart1(list)
})
}
})
......@@ -406,11 +410,6 @@
initChart1(data) {
this.$nextTick(() => {
let myChart = echarts.init(document.getElementById("echarts1"))
let list1=[],list2=[]
for(var i=0; i<data.length; i++) {
list1.push(data[i].count)
list2.push(data[i].money)
}
let option ={
tooltip: {
trigger: 'axis',
......@@ -421,7 +420,7 @@
xAxis: {
type: 'category',
axisLabel: { //坐标轴刻度标签的相关设置
margin: 15, //刻度标签与轴线之间的距离
margin: 10, //刻度标签与轴线之间的距离
color:"#666666",
show: true,
interval: 0
......@@ -474,8 +473,8 @@
],
grid: {
top:30,
left:80,
right:90,
left:70,
right:100,
bottom:30,
},
series: [
......@@ -483,7 +482,7 @@
name:'中标金额(万元)',
smooth: false, //平滑
type:"line",
symbolSize: 6,
symbolSize: 5,
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
......@@ -694,7 +693,7 @@
type: 'category',
axisLabel: { //坐标轴刻度标签的相关设置
margin: 15, //刻度标签与轴线之间的距离
color:"#666666"
color:"#666666",
},
axisTick: false, //坐标轴刻度
axisPointer: {
......@@ -801,8 +800,10 @@
xAxis: {
type: 'category',
axisLabel: { //坐标轴刻度标签的相关设置
margin: 15, //刻度标签与轴线之间的距离
color:"#666666"
margin: 10, //刻度标签与轴线之间的距离
color:"#666666",
// show: true,
// interval: 0
},
axisTick: false, //坐标轴刻度
axisPointer: {
......@@ -845,8 +846,8 @@
],
grid: {
top:30,
left:80,
right:90,
left:70,
right:70,
bottom:30,
},
series: [
......@@ -854,7 +855,7 @@
name:'下浮率',
smooth: false, //平滑
type:"line",
symbolSize: 6,
symbolSize: 5,
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
......@@ -869,7 +870,7 @@
{
name:'统计项目数量',
type: 'bar',
barWidth: 20,
barWidth: 18,
tooltip: {
valueFormatter: function (value) {
return value + '个';
......@@ -1060,6 +1061,37 @@
return sums;
},
getSummaries1(param){
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 1) {
sums[index] = '平均下浮率';
return;
}
if (index === 0 ||index === 3) {
sums[index] = '-';
return;
}
const values = data.map(item => Number(item[column.property]));
let length=0
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
length=values.length
return Number(prev) + Number(curr)
} else {
return prev;
}
}, 0);
if (index === 2) {
sums[index] = (Number(sums[index])/length).toFixed(2);
return;
}
});
return sums;
},
getSummaries2(param){
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
......@@ -1150,10 +1182,10 @@
display: flex;
justify-content: space-between;
.box-left{
width: 60%;
width: 50%;
}
.box-right{
width: 33%;
width: 43%;
float: right;
::v-deep .el-table{
.sort-caret.ascending{
......
package com.dsk.system.domain.customer.dto;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author lcl
* @create 2023/5/16
*/
@Data
@NoArgsConstructor
public class CustomerSearchDto implements Serializable {
/**
* 企业id
......@@ -22,6 +27,10 @@ public class CustomerSearchDto implements Serializable {
* 企业名称
*/
private String companyName;
/**
* 企业性质
*/
private String companyNature;
/**
* 客户id
*/
......@@ -34,5 +43,41 @@ public class CustomerSearchDto implements Serializable {
* 客户状态 0:正常 1:历史
*/
private Integer status;
/**
* 是否上市 0:否 1:是
*/
private Integer isOn;
/**
* 省id
*/
private List<Integer> provinceIds;
/**
* 市id
*/
private List<Integer> cityIds;
/**
* 区id
*/
private List<Integer> districtIds;
/**
* 企业性质
*/
private List<String> companyNatures;
/**
* 信资等级
*/
private List<String> creditLevels;
/**
* 数据权限
*/
private Map<String, Object> params;
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
}
package com.dsk.system.domain.customer.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 客户分析
*
* @author lcl
* @create 2023/8/15
*/
@Data
public class CustomerAnalyzeVo implements Serializable {
/**
* 客户id
*/
private String customerId;
/**
* 企业名称
*/
private String companyName;
/**
* 企业id
*/
private Integer companyId;
/**
* 城投id
*/
private String uipId;
/**
* 项目数量
*/
private Integer businessCount;
/**
* 总投资金额
*/
private Double totalAmount;
}
......@@ -71,11 +71,11 @@ public class JskCombineSearchDto implements Serializable {
/**
* 中标时间(开始)
*/
private Date startBidTime;
private String startBidTime;
/**
* 中标时间(结束)
*/
private Date endBidTime;
private String endBidTime;
/**
* 业绩类型
*/
......
......@@ -81,6 +81,7 @@ public class EnterpriseBussinessService {
Map<String, Object> dataMap = CommonUtils.assertAsMap(supplierProject);
dataMap.put("sourceId", null);
dataMap.put("sourceType", null);
dataMap.put("sourceList", null);
String source = MapUtils.getString(dataMap, "source");
if (ObjectUtil.isNotEmpty(source)) {
List<EnterpriseBussinessVo> enterpriseBussinessVoList = JSONUtil.toList(source, EnterpriseBussinessVo.class);
......@@ -88,6 +89,7 @@ public class EnterpriseBussinessService {
EnterpriseBussinessVo vo = enterpriseBussinessVoList.get(0);
dataMap.put("sourceId", vo.getSource_id());
dataMap.put("sourceType", vo.getSource_type());
dataMap.put("sourceList", enterpriseBussinessVoList);
}
}
}
......@@ -176,6 +178,7 @@ public class EnterpriseBussinessService {
EnterpriseBussinessVo vo = enterpriseBussinessVoList.get(0);
dataMap.put("sourceId", vo.getSource_id());
dataMap.put("sourceType", vo.getSource_type());
dataMap.put("sourceList", enterpriseBussinessVoList);
}
}
}
......@@ -245,4 +248,33 @@ public class EnterpriseBussinessService {
}
return BeanUtil.toBean(map, R.class);
}
public R select(EnterpriseBusinessAwardDetailBody body) throws Exception {
Map<String, Object> map = new HashMap<>();
List<String> sourcesList = new ArrayList<>(5);
sourcesList.add("中标公示");
sourcesList.add("四库业绩");
sourcesList.add("中标业绩");
sourcesList.add("水利业绩");
sourcesList.add("荣誉奖项");
map.put("sources", sourcesList);
List<String> projectsList = new ArrayList<>(2);
projectsList.add("矿山工程");
projectsList.add("铁路工程");
projectsList.add("港口与航道工程");
projectsList.add("冶金工程");
projectsList.add("水利工程");
projectsList.add("机电工程");
projectsList.add("市政工程");
projectsList.add("石油化工工程");
projectsList.add("电力工程");
projectsList.add("通信工程");
projectsList.add("公路工程");
projectsList.add("房建工程");
projectsList.add("其他");
map.put("projects", projectsList);
return R.ok(map);
}
}
......@@ -49,6 +49,30 @@ public class EnterpriseService {
@Autowired
private RedisCache redisCache;
public R label(EnterpriseInfoLabelBody body) throws Exception {
List<Map<String, Object>> mapList = new ArrayList<>();
if (body.isVaildCid()) {
return R.ok(mapList);
}
Map<String, Object> companyMap = dskOpenApiUtil.requestBody("/api/jsk/enterprise/label", BeanUtil.beanToMap(body, false, false));
Integer companyCode = MapUtils.getInteger(companyMap, "code", 300);
if (200 != companyCode) {
return R.ok(mapList);
}
// list
List<Map<String, Object>> data = (List<Map<String, Object>>) companyMap.get("data");
if (ObjectUtil.isNotEmpty(data)) {
for (Map<String, Object> labelsMap : data) {
String labelName = MapUtils.getString(labelsMap,"labelName", "");
if (labelName.equals("央企企业") || labelName.equals("国企") || labelName.equals("央企") ||
labelName.equals("央企子公司") || labelName.equals("国有企业") || labelName.equals("省属国企")) {
mapList.add(labelsMap);
}
}
}
return R.ok(mapList);
}
public R infoHeader(EnterpriseInfoHeaderBody body) throws Exception {
if (body.isVaildCid()) return R.ok();
Map<String, Object> companyMap = dskOpenApiUtil.requestBody("/api/jsk/enterprise/infoHeader", BeanUtil.beanToMap(body, false, false));
......
package com.dsk.system.dskService;
import cn.hutool.core.bean.BeanUtil;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.model.*;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.DskOpenApiUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName enterpriseService
* @Description TODO
* @Author Dgm
* @Date 2023/5/15 12:00
* @Version 1.0
*/
@Service
public class IndexService {
private static final Logger log = LoggerFactory.getLogger(IndexService.class);
@Autowired
private DskOpenApiUtil dskOpenApiUtil;
public R winningBidsRanking(Map<String, Object> paramMap) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseProject/winningBidsRanking", paramMap);
return BeanUtil.toBean(map, R.class);
}
public R rankingProjectType(Map<String, Object> paramMap) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseProject/rankingProjectType", paramMap);
return BeanUtil.toBean(map, R.class);
}
public TableDataInfo bigWinningBidsPage(IndexBigWinningBidsPageBody body) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseProject/bigWinningBidsPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public TableDataInfo bigBidPage(IndexBigBidPageBody body) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseProject/bigBidPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public R bigBidProjectType(Map<String, Object> paramMap) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseProject/bigBidProjectType", paramMap);
return BeanUtil.toBean(map, R.class);
}
}
......@@ -37,6 +37,17 @@ public class JskCombineInfoService {
public TableDataInfo memberList(JskCombineSearchDto dto) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/combine/memberList", BeanUtil.beanToMap(dto, false, false));
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
if (!ObjectUtils.isEmpty(data.get("list"))) {
List<Map<String, Object>> list = (List<Map<String, Object>>) data.get("list");
list.parallelStream().forEach(res -> {
Integer companyId = MapUtils.getInteger(res, "companyId");
String companyName = MapUtils.getString(res, "companyName");
res.put("uipId", enterpriseService.getUipIdByCompanyNameOrCompanyId(companyName, companyId));
});
}
}
return dskOpenApiUtil.responsePage(map);
}
......
......@@ -3,6 +3,7 @@ package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.customer.Customer;
import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import com.dsk.system.domain.customer.vo.CustomerAnalyzeVo;
import com.dsk.system.domain.customer.vo.CustomerListVo;
import com.dsk.system.domain.customer.vo.CustomerStatusListVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -20,7 +21,7 @@ import java.util.List;
@Mapper
public interface CustomerMapper extends BaseMapper<Customer> {
List<CustomerListVo> selectList(@Param("dto") CustomerSearchDto dto);
List<CustomerListVo> selectList(CustomerSearchDto dto);
List<Customer> selectUserList(Long userId);
......@@ -30,7 +31,9 @@ public interface CustomerMapper extends BaseMapper<Customer> {
List<CustomerStatusListVo> selectStatusListByCompanyName(@Param("companyNames") List<String> companyNames, @Param("userId") Long userId);
// List<String> selectUipIdList(@Param("uipIds") List<String> uipIds, @Param("userId") Long userId);
int selectCustomerCount(CustomerSearchDto dto);
List<CustomerAnalyzeVo> selectCooperationTop(CustomerSearchDto dto);
}
package com.dsk.system.service;
import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import com.dsk.system.domain.customer.vo.CustomerAnalyzeVo;
import java.util.List;
import java.util.Map;
/**
* @author lcl
* @create 2023/8/15
*/
public interface ICustomerOverviewService {
Map<String,Object> statistics(CustomerSearchDto dto);
List<CustomerAnalyzeVo> cooperationTop(CustomerSearchDto dto);
}
package com.dsk.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.Customer;
import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import com.dsk.system.domain.customer.vo.CustomerAnalyzeVo;
import com.dsk.system.mapper.CustomerMapper;
import com.dsk.system.service.ICustomerOverviewService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 客户概览相关
* @author lcl
* @create 2023/8/15
*/
@Service
public class CustomerOverviewServiceImpl implements ICustomerOverviewService {
@Resource
private CustomerMapper customerMapper;
@Override
public Map<String, Object> statistics(CustomerSearchDto dto) {
Map<String, Object> resultMap = new HashMap<>();
dto.setUserId(SecurityUtils.getUserId());
//总
resultMap.put("totalCount",customerMapper.selectCustomerCount(dto));
//国企
dto.setCompanyNature("国有企业");
resultMap.put("nationCount",customerMapper.selectCustomerCount(dto));
//央企
dto.setCompanyNature("央企");
resultMap.put("centreCount",customerMapper.selectCustomerCount(dto));
//事业
dto.setCompanyNature("事业单位");
resultMap.put("undertakingCount",customerMapper.selectCustomerCount(dto));
return resultMap;
}
@Override
public List<CustomerAnalyzeVo> cooperationTop(CustomerSearchDto dto) {
dto.setUserId(SecurityUtils.getUserId());
return customerMapper.selectCooperationTop(dto);
}
}
......@@ -27,7 +27,38 @@
select count(status) num,customer_id from business_info where `status` = 2 group by customer_id
) bi3 on bi3.customer_id = ct.customer_id
where ctu.user_id = #{dto.userId} and ctu.status = #{dto.status}
<if test="dto.companyName != null and dto.companyName != '' "> and ct.company_name like concat('%',#{dto.companyName},'%')</if>
<if test="companyName != null and companyName != '' "> and ct.company_name like concat('%',#{companyName},'%')</if>
<if test="isOn != null "> and ct.is_on = #{isOn}</if>
<if test="provinceIds != null and provinceIds.size > 0 ">
and ct.province_id in
<foreach collection="provinceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="cityIds != null and cityIds.size > 0 ">
and ct.city_id in
<foreach collection="cityIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="districtIds != null and districtIds.size > 0 ">
and ct.district_id in
<foreach collection="districtIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="companyNatures != null and companyNatures.size > 0 ">
and ct.company_nature in
<foreach collection="companyNatures" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="creditLevels != null and creditLevels.size > 0 ">
and ct.credit_level in
<foreach collection="creditLevels" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by ct.create_time desc
</select>
......@@ -69,16 +100,27 @@
</foreach>
</select>
<!-- <select id="selectUipIdList" resultType="java.lang.String">-->
<!-- select-->
<!-- ct.uip_id-->
<!-- from customer ct-->
<!-- join customer_user ctu on ct.customer_id = ctu.customer_id-->
<!-- where ctu.user_id = #{userId} and ctu.status = 0 and ct.uip_id in-->
<!-- <foreach collection="uipIds" item="uipId" open="(" separator="," close=")">-->
<!-- #{uipId}-->
<!-- </foreach>-->
<!-- </select>-->
<select id="selectCustomerCount" resultType="java.lang.Integer">
select
count(ct.customer_id)
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
where ctu.status = 0 and ctu.user_id = #{userId}
<if test="companyNature != null and companyNature != ''"> and ct.company_nature = #{companyNature} </if>
</select>
<select id="selectCooperationTop" resultType="com.dsk.system.domain.customer.vo.CustomerAnalyzeVo">
select
ct.customer_id, ct.company_name, ct.company_id, ct.uip_id, count(bi.id) businessCount,
sum(bi.investment_amount) totalAmount
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
left join business_info bi on (bi.customer_id = ct.customer_id and bi.status = 2)
where ctu.status = 0 and ctu.user_id = #{userId}
group by ct.customer_id
order by totalAmount desc
limit 10
</select>
</mapper>
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