Commit bf92e4a9 authored by danfuman's avatar danfuman

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

parents bac979a4 3a0dab50
......@@ -125,6 +125,8 @@ public class CustomerController extends BaseController {
}
}
/**
* 编辑客户
*/
......@@ -190,4 +192,31 @@ public class CustomerController extends BaseController {
success.put("successCount", successCount);
return success;
}
/**
* 客户状态
*/
@GetMapping("/status/{companyName}")
public AjaxResult status(@PathVariable String companyName) {
return AjaxResult.success(baseService.status(companyName));
}
/**
* 取消认领
*/
@PutMapping("/cancelClaim/{companyName}")
@RepeatSubmit
public AjaxResult cancelClaim(@PathVariable String companyName) {
return toAjax(baseService.cancelClaim(companyName));
}
/**
* 历史认领
*/
@PutMapping("/historyClaim/{companyName}")
@RepeatSubmit
public AjaxResult historyClaim(@PathVariable String companyName) {
return toAjax(baseService.historyClaim(companyName));
}
}
......@@ -576,6 +576,9 @@
padding: 16px;
border-radius: 6px;
border: 1px solid #68AEFF;
&.w836{
width: 836px;
}
.wri_top{
>img{
float: left;
......@@ -662,6 +665,11 @@
width: 128px;
}
}
.w120{
.el-input__inner{
width: 120px;
}
}
}
}
}
......
......@@ -9,7 +9,7 @@
<img src="@/assets/images/project/add_3.png">
<div>新建一条跟进记录,如:周五上午预约客户上门拜访</div>
</div>
<div class="writting" v-if="isEdit == true">
<div class="writting" v-if="isEdit == true" :class="{'w836':showtype!='gjjl'}">
<div class="wri_top">
<img src="@/assets/images/project/add_3.png">
<el-input v-model="addParam.content" placeholder="新建一条跟进记录,如:周五上午预约客户上门拜访"></el-input>
......@@ -43,6 +43,13 @@
<el-input v-model="addParam.position" placeholder="客户职位" style="width: 100px;">
</el-input>
</div>
<div class="sels times" style="width: 132px"><img src="@/assets/images/project/ico_4.png">
<el-date-picker class="w120" value-format="yyyy-MM-dd"
v-model="addParam.visitTime"
type="date"
placeholder="拜访时间">
</el-date-picker>
</div>
<div class="times"><img src="@/assets/images/project/ico_4.png">
<el-date-picker class="w128" value-format="yyyy-MM-dd"
v-model="addParam.nextVisitTime"
......@@ -79,7 +86,7 @@
<span v-if="item.name">拜访对象:{{item.name||'--'}}</span>
<span v-if="showtype == 'gjdt' && item.companyName != ''">关联企业:{{item.companyName}}</span>
<span v-if="item.position">职位:{{item.position}}</span>
<span v-if="item.createTime">拜访时间:{{item.createTime.slice(0, 10)}}</span>
<span v-if="item.visitTime">拜访时间:{{item.visitTime.slice(0, 10)}}</span>
<span v-if="item.nextVisitTime">下次拜访时间:{{item.nextVisitTime.slice(0, 10)}}</span>
</div>
</div>
......@@ -110,7 +117,7 @@
<span v-if="item.projectName && showtype == 'projectgjdt'">关联项目:{{item.projectName||'--'}}</span>
<span v-if="item.visitPerson">拜访对象:{{item.visitPerson||'--'}}</span>
<span v-if="item.position">职位:{{item.position||'--'}}</span>
<span v-if="item.creatTime">拜访时间:{{item.creatTime}}</span>
<span v-if="item.visitTime">拜访时间:{{item.visitTime}}</span>
<span v-if="item.nextVisitTime">下次拜访时间:{{item.nextVisitTime || '--'}}</span>
</div>
</div>
......@@ -169,6 +176,7 @@
addParam:{
customerId:'', //客户id
visitMode:'',//拜访方式
visitTime:'',//拜访时间
nextVisitTime:'',//下次拜访时间
name:'',//拜访对象姓名
position:'',//拜访对象职务
......@@ -250,6 +258,7 @@
userId:this.$store.state.user.userId,
visitPerson:this.addParam.name,
position:this.addParam.position,
visitTime: this.addParam.visitTime,
nextVisitTime: this.addParam.nextVisitTime,
recordInfo:this.addParam.content,
visitWay:this.addParam.visitMode,
......@@ -317,6 +326,7 @@
this.recordlist = result.code == 200?result:[]
this.recordlist.rows.forEach(item=>{
item.createTime = this.gettime(item.createTime)
item.visitTime = this.gettime(item.visitTime)
item.nextVisitTime = this.gettime(item.nextVisitTime)
})
})
......@@ -365,6 +375,7 @@
this.addParam={
customerId:'', //客户id
visitMode:'',//拜访方式
visitTime:'',//拜访时间
nextVisitTime:'',//下次拜访时间
name:'',//拜访对象姓名
position:'',//拜访对象职务
......
......@@ -137,7 +137,39 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown @command="PlanTenderDatehandleCommand" trigger="click" placement="bottom-start" class="el-dropdown-land" ref="PlanTenderDateShowPopper" :hide-on-click="false" >
<span class="el-dropdown-link" :class="PlanTenderDateValue ? 'color_text' : ''" >
计划招标时间{{ PlanTenderDateValue ? " 1项" : ""}}
<i class="el-icon-caret-bottom"></i>
</span>
<div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item, i) in PlanTenderDateOptions" class="el-dropdown-land" :class=" PlanTenderDateValue && PlanTenderDateValue == item.value ? 'color_text': '' " :key="i" :command="item.value">
<div @mouseenter="hidePoper1">{{ item.label }}</div>
</el-dropdown-item>
<el-dropdown-item command="自定义" style="padding: 0; text-indent: 20px">
<div @mouseenter="mouseenter1">
<span :class="PlanTenderDateValue == '自定义' ? 'color_text' : ''">
自定义<i class="el-icon-arrow-right"></i>
</span>
<el-date-picker
v-if="PlanTenderDateShowPopper"
@change="changePlanTenderDate"
class="land_date_picker"
v-model="PlanTenderDate"
ref="datePicker1"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
</el-dropdown-item>
</el-dropdown-menu>
</div>
</el-dropdown>
<div class="select-popper">
<span :class="{ color_text: jskBidPlanDto.projectCapitalSource.length }">
资金来源{{jskBidPlanDto.projectCapitalSource.length? jskBidPlanDto.projectCapitalSource.length + "项": ""}}
......@@ -317,6 +349,43 @@ export default {
IssueTimeValue: "",
IssueTime: "",
IssueTimeShowPopper: false,
PlanTenderDateOptions: [
{
label: "不限",
value: "",
},
{
label: "今天",
value: "今天",
},
{
label: "近3日",
value: "近3日",
},
{
label: "近7日",
value: "近7日",
},
{
label: "近1个月",
value: "近1个月",
},
{
label: "近3个月",
value: "近3个月",
},
{
label: "近半年",
value: "近半年",
},
{
label: "近1年",
value: "近1年",
},
],
PlanTenderDateValue: "",
PlanTenderDate: "",
PlanTenderDateShowPopper: false,
addressList: [],
addressType: [],
......@@ -370,6 +439,8 @@ export default {
projectCapitalSource:[],
startIssueTime:'',
endIssueTime:'',
startPlanTenderDate:'',
endPlanTenderDate:'',
},
planTenderAmountShowPopper:false,
......@@ -528,7 +599,6 @@ export default {
delete params.keywordNot
}
api.jskBidPlanPage(params).then(res=>{
console.log(res);
if (res.code==200) {
this.tableData=res.data.list;
this.total=res.data.total;
......@@ -661,6 +731,114 @@ export default {
}
this.jskBidPlanDto = obj;
},
PlanTenderDatehandleCommand(command) {
var obj = JSON.parse(JSON.stringify(this.jskBidPlanDto));
if (command && command != "自定义") {
this.PlanTenderDateValue = command;
this.$refs.PlanTenderDateShowPopper.hide();
const datetime = new Date();
var startTime, endTime, Year, Month, Day;
Year = datetime.getFullYear();
Month = datetime.getMonth() + 1;
Day = datetime.getDate();
switch (command) {
case "今天":
startTime = Year + "-" + Month +"-" + Day;
endTime = Year + "-" + Month + "-" + Day;
break;
case "近3日":
endTime = Year + "-" + Month + "-" + Day;
if (Day > 3) {
startTime = Year + "-" + Month + "-" +(Day-3);
} else {
let newTime = datetime.getTime()-3*24*60*60*1000
Year = new Date(newTime).getFullYear();
Month = new Date(newTime).getMonth() + 1;
Day = new Date(newTime).getDate();
startTime = Year + "-" + Month +"-" + Day;
}
break;
case "近7日":
endTime = Year + "-" + Month + "-" + Day;
if (Day > 7) {
startTime = Year + "-" + Month + "-" +(Day-7);
} else {
let newTime = datetime.getTime()-7*24*60*60*1000
Year = new Date(newTime).getFullYear();
Month = new Date(newTime).getMonth() + 1;
Day = new Date(newTime).getDate();
startTime = Year + "-" + Month +"-" + Day;
}
break;
case "近1个月":
endTime = Year + "-" + Month + "-" + Day;
if (Month > 1) {
startTime = Year + "-" + (Month - 1) + "-1";
} else {
startTime = Year - 1 + "-" + (12 + Month - 1) + "-1";
}
break;
case "近3个月":
endTime = Year + "-" + Month + "-" + Day;
if (Month > 3) {
startTime = Year + "-" + (Month - 3) + "-1";
} else {
startTime = Year - 1 + "-" + (12 + Month - 3) + "-1";
}
break;
case "近半年":
endTime = Year + "-" + Month + "-" + Day;
if (Month > 6) {
startTime = Year + "-" + (Month - 6) + "-1";
} else {
startTime = Year - 1 + "-" + (12 + Month - 6) + "-1";
}
break;
case "近1年":
startTime = Year - 1 + "-" + Month + "-" + Day;
endTime = Year + "-" + Month + "-" + Day;
break;
case "自定义":
if (!this.PlanTenderDate) {
this.PlanTenderDateValue = "";
}
break;
}
if(startTime){
var start=startTime.split('-');
startTime=start.map((item)=>{
if(item.length==1){
return '0'+item
}else{
return item
}
})
startTime=startTime.join('-')
}
if(endTime){
var end=endTime.split('-');
endTime=end.map((item)=>{
if(item.length==1){
return '0'+item
}else{
return item
}
})
endTime=endTime.join('-')
}
obj.startPlanTenderDate = startTime;
obj.endPlanTenderDate = endTime;
} else if (command == "自定义") {
this.$refs.datePicker1.pickerVisible = true;
} else {
this.$refs.PlanTenderDateShowPopper.hide();
this.PlanTenderDateValue = "";
this.PlanTenderDate = "";
obj.startPlanTenderDate = "";
obj.endPlanTenderDate = "";
}
this.jskBidPlanDto = obj;
},
changeIssueTime(type) {
if(type=='bid'&&this.tenderDate){
this.tenderDateValue = "自定义";
......@@ -676,6 +854,21 @@ export default {
this.jskBidPlanDto = obj;
}
},
changePlanTenderDate(type) {
if(type=='bid'&&this.tenderDate){
this.tenderDateValue = "自定义";
var obj = JSON.parse(JSON.stringify(this.jskBidPlanDto));
obj.startTenderTime = this.tenderDate[0];
obj.endTenderTime = this.tenderDate[1];
this.jskBidPlanDto = obj;
}else if(this.PlanTenderDate) {
this.PlanTenderDateValue = "自定义";
var obj = JSON.parse(JSON.stringify(this.jskBidPlanDto));
obj.startPlanTenderDate = this.PlanTenderDate[0];
obj.endPlanTenderDate = this.PlanTenderDate[1];
this.jskBidPlanDto = obj;
}
},
hidePoper(type) {
if(type=='bid'&&this.$refs.tenderDatePicker){
this.$refs.tenderDatePicker.pickerVisible = false;
......@@ -683,6 +876,13 @@ export default {
this.$refs.datePicker.pickerVisible = false;
}
},
hidePoper1(type) {
if(type=='bid'&&this.$refs.tenderDatePicker){
this.$refs.tenderDatePicker.pickerVisible = false;
}else if(this.$refs.datePicker1){
this.$refs.datePicker1.pickerVisible = false;
}
},
mouseenter(type) {
if(type=='bid'){
this.tenderDateShowPopper = true;
......@@ -700,6 +900,23 @@ export default {
}
}
},
mouseenter1(type) {
if(type=='bid'){
this.tenderDateShowPopper = true;
if(this.tenderDateValue=="自定义"){
this.$nextTick(() => {
this.$refs.tenderDatePicker.pickerVisible = true;
});
}
}else{
this.PlanTenderDateShowPopper = true;
if(this.PlanTenderDateValue=="自定义"){
this.$nextTick(() => {
this.$refs.datePicker1.pickerVisible = true;
});
}
}
},
clearIssueTime(type) {
var obj = JSON.parse(JSON.stringify(this.jskBidPlanDto));
if(type=='bid'){
......@@ -715,6 +932,21 @@ export default {
}
this.jskBidPlanDto = obj;
},
clearPlanTenderDate(type) {
var obj = JSON.parse(JSON.stringify(this.jskBidPlanDto));
if(type=='bid'){
this.tenderDate = "";
this.tenderDateValue = "";
obj.startTenderTime = "";
obj.endTenderTime = "";
}else{
this.PlanTenderDate = "";
this.PlanTenderDateValue = "";
obj.startPlanTenderDate = "";
obj.endPlanTenderDate = "";
}
this.jskBidPlanDto = obj;
},
deleteDomicile() {
this.$refs.address.handleClear();
},
......
......@@ -18,5 +18,9 @@ public class CustomerSearchDto implements Serializable {
* 用户id
*/
private Long userId;
/**
* 客户状态 0:正常 1:历史
*/
private Integer status;
}
......@@ -40,9 +40,15 @@ public class CustomerFollowRecordListVo implements Serializable {
* 拜访方式(visit_mode_type)
*/
private String visitMode;
/**
* 拜访时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date visitTime;
/**
* 下次拜访时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date nextVisitTime;
/**
* 拜访对象姓名
......
......@@ -12,6 +12,7 @@ import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.core.redis.RedisCache;
import com.dsk.common.utils.DskOpenApiUtil;
import com.dsk.common.utils.EncodeIdUtil;
import com.dsk.common.utils.StringUtils;
import com.dsk.system.domain.customer.vo.CustomerStatusListVo;
import com.dsk.system.service.ICustomerService;
import org.apache.commons.collections4.CollectionUtils;
......@@ -224,6 +225,42 @@ public class EnterpriseService {
for (Object companyObj : list) {
Map<String, Object> companyMap = CommonUtils.assertAsMap(companyObj);
String uipId = MapUtils.getString(companyMap, "uipId");
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("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("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("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("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("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("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("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("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("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("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("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("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("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("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_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("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("guaranteeRatio",MapUtils.getDouble(companyMap, "guaranteeRatio")==null?null:String.format("%.2f", MapUtils.getDouble(companyMap, "guaranteeRatio")));
companyMap.put("claimStatus", 0);
for (CustomerStatusListVo vo : claimStatusList) {
if (uipId.equals(vo.getUipId())) {
......@@ -235,6 +272,14 @@ public class EnterpriseService {
return new TableDataInfo(list, MapUtils.getInteger(data, "totalCount", 0));
}
public static void main(String[] args) {
String str = String.format("%1$.2f", 0.0456);
System.out.println(str);
String format = String.format("%.2f", null);
System.out.println(format);
}
public R uipGroupData() throws Exception {
String redisKey = CacheConstants.DATA_UIPGROUPDATA;
......
......@@ -28,7 +28,7 @@ public interface CustomerMapper extends BaseMapper<Customer> {
List<CustomerStatusListVo> selectStatusList(@Param("uipIds") List<String> uipIds, @Param("userId") Long userId);
List<String> selectUipIdList(@Param("uipIds") List<String> uipIds, @Param("userId") Long userId);
// List<String> selectUipIdList(@Param("uipIds") List<String> uipIds, @Param("userId") Long userId);
}
......@@ -3,6 +3,8 @@ package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.customer.CustomerUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
......@@ -14,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerUserMapper extends BaseMapper<CustomerUser> {
CustomerUser selectByCustomerIdAndUserId(@Param("customerId") String customerId,@Param("userId") Long userId);
}
......@@ -29,6 +29,12 @@ public interface ICustomerService {
List<CustomerStatusListVo> selectStatusList(List<String> uipIds);
List<String> selectUipIdList(List<String> uipIds);
// List<String> selectUipIdList(List<String> uipIds);
Integer status(String companyName);
boolean cancelClaim(String companyName);
boolean historyClaim(String companyName);
}
......@@ -48,6 +48,7 @@ public class CustomerServiceImpl implements ICustomerService {
@Override
public List<CustomerListVo> selectList(CustomerSearchDto dto) {
dto.setUserId(SecurityUtils.getUserId());
dto.setStatus(ObjectUtils.isEmpty(dto.getStatus()) ? 0 : dto.getStatus());
return baseMapper.selectList(dto);
}
......@@ -119,9 +120,47 @@ public class CustomerServiceImpl implements ICustomerService {
}
// @Override
// public List<String> selectUipIdList(List<String> uipIds) {
// return baseMapper.selectUipIdList(uipIds, SecurityUtils.getUserId());
// }
@Override
public Integer status(String companyName) {
Customer cus = baseMapper.selectByCompanyNameAndUserId(companyName, SecurityUtils.getUserId());
if (ObjectUtils.isEmpty(cus)) {
return null;
}
CustomerUser customerUser = customerUserMapper.selectByCustomerIdAndUserId(cus.getCustomerId(), SecurityUtils.getUserId());
if (ObjectUtils.isEmpty(customerUser)) {
throw new ServiceException("数据错误!");
}
return customerUser.getStatus();
}
@Override
public boolean cancelClaim(String companyName) {
return updateClaimStatus(companyName, 1);
}
@Override
public List<String> selectUipIdList(List<String> uipIds) {
return baseMapper.selectUipIdList(uipIds, SecurityUtils.getUserId());
public boolean historyClaim(String companyName) {
return updateClaimStatus(companyName, 0);
}
//修改客户认领状态
private boolean updateClaimStatus(String companyName, Integer status) {
Customer cus = baseMapper.selectByCompanyNameAndUserId(companyName, SecurityUtils.getUserId());
if (ObjectUtils.isEmpty(cus)) {
throw new ServiceException("数据错误!");
}
CustomerUser customerUser = customerUserMapper.selectByCustomerIdAndUserId(cus.getCustomerId(), SecurityUtils.getUserId());
if (ObjectUtils.isEmpty(customerUser)) {
throw new ServiceException("数据错误!");
}
customerUser.setStatus(status);
return customerUserMapper.updateById(customerUser) == 1;
}
}
......@@ -5,6 +5,7 @@ import com.dsk.acc.openapi.client.util.CommonUtils;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.UrbanInvestmentPlatformDto;
import com.dsk.common.utils.DskOpenApiUtil;
import com.dsk.system.domain.customer.vo.CustomerStatusListVo;
import com.dsk.system.service.ICustomerService;
import com.dsk.system.service.UrbanInvestmentPlatformService;
import org.apache.commons.collections4.CollectionUtils;
......@@ -51,19 +52,32 @@ public class UrbanInvestmentPlatformServiceImpl implements UrbanInvestmentPlatfo
for (Object dataMap : list) {
uipIds.add(MapUtils.getString(CommonUtils.assertAsMap(dataMap), "uipId"));
}
List<String> claimStatusList = iCustomerService.selectUipIdList(uipIds);
// List<String> claimStatusList = iCustomerService.selectUipIdList(uipIds);
List<CustomerStatusListVo> customerStatusListVos = iCustomerService.selectStatusList(uipIds);
//按照城投企业id合并两个list
//按照城投企业id合并两个list
for (Object companyObj : list) {
Map<String, Object> companyMap = CommonUtils.assertAsMap(companyObj);
String uipId = MapUtils.getString(companyMap, "uipId","uipId");
if (CollectionUtils.isEmpty(claimStatusList)) {
String uipId = MapUtils.getString(companyMap, "uipId");
companyMap.put("claimStatus", 0);
} else if (claimStatusList.contains(uipId)) {
for (CustomerStatusListVo vo : customerStatusListVos) {
if (uipId.equals(vo.getUipId())) {
companyMap.put("claimStatus", 1);
} else {
companyMap.put("claimStatus", 0);
}
}
}
// for (Object companyObj : list) {
// Map<String, Object> companyMap = CommonUtils.assertAsMap(companyObj);
// String uipId = MapUtils.getString(companyMap, "uipId","uipId");
// if (CollectionUtils.isEmpty(claimStatusList)) {
// companyMap.put("claimStatus", 0);
// } else if (claimStatusList.contains(uipId)) {
// companyMap.put("claimStatus", 1);
// } else {
// companyMap.put("claimStatus", 0);
// }
// }
return BeanUtil.toBean(map, AjaxResult.class);
}
......
......@@ -26,7 +26,7 @@
left join (
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}
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>
order by ct.create_time desc
</select>
......@@ -52,22 +52,22 @@
ct.customer_id, ct.uip_id
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
where ctu.user_id = #{userId} and ct.uip_id in
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="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 ct.uip_id in
<foreach collection="uipIds" item="uipId" open="(" separator="," close=")">
#{uipId}
</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>-->
</mapper>
......@@ -2,6 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.system.mapper.CustomerUserMapper">
<select id="selectByCustomerIdAndUserId" resultType="com.dsk.system.domain.customer.CustomerUser">
select
id, customer_id, user_id, status, create_time, update_time
from customer_user
where customer_id = #{customerId} and user_id = #{userId}
</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