Commit af903d1b authored by huangjie's avatar huangjie

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

parents 555b35cf 86f83368
......@@ -125,6 +125,8 @@ public class CustomerController extends BaseController {
}
}
/**
* 编辑客户
*/
......@@ -190,4 +192,32 @@ public class CustomerController extends BaseController {
success.put("successCount", successCount);
return success;
}
/**
* 客户状态
*/
@GetMapping("/status/{customerId}")
@RepeatSubmit
public AjaxResult status(@PathVariable String companyName) {
return AjaxResult.success(baseService.status(companyName));
}
/**
* 取消认领
*/
@PutMapping("/cancelClaim/{customerId}")
@RepeatSubmit
public AjaxResult cancelClaim(@PathVariable String customerId) {
return toAjax(baseService.cancelClaim(customerId));
}
/**
* 历史认领
*/
@PutMapping("/historyClaim/{customerId}")
@RepeatSubmit
public AjaxResult historyClaim(@PathVariable String customerId) {
return toAjax(baseService.historyClaim(customerId));
}
}
......@@ -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;
}
......@@ -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);
}
......@@ -31,4 +31,10 @@ public interface ICustomerService {
List<String> selectUipIdList(List<String> uipIds);
Integer status(String companyName);
boolean cancelClaim(String customerId);
boolean historyClaim(String customerId);
}
......@@ -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);
}
......@@ -124,4 +125,38 @@ public class CustomerServiceImpl implements ICustomerService {
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 customerId) {
return updateClaimStatus(customerId, 1);
}
@Override
public boolean historyClaim(String customerId) {
return updateClaimStatus(customerId, 0);
}
//修改客户认领状态
private boolean updateClaimStatus(String customerId, Integer status) {
CustomerUser customerUser = customerUserMapper.selectByCustomerIdAndUserId(customerId, SecurityUtils.getUserId());
if (ObjectUtils.isEmpty(customerUser)) {
throw new ServiceException("数据错误!");
}
customerUser.setStatus(status);
return customerUserMapper.updateById(customerUser) == 1;
}
}
......@@ -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>
......
......@@ -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