Commit 07d6a9fd by leialin

Merge branch 'lal' into 'develop'

提交

See merge request 8timerv2/8timerapiv200!477
parents a3b909c1 4aa62ad0
...@@ -164,6 +164,11 @@ public class CrmClientData extends Model<CrmClientData> { ...@@ -164,6 +164,11 @@ public class CrmClientData extends Model<CrmClientData> {
@Transient @Transient
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "协作(0:否 1:是)")
private Integer iscooperation;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "协作人id") @ApiModelProperty(value = "协作人id")
private Integer[] ids; private Integer[] ids;
......
...@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; ...@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -54,6 +55,7 @@ import cn.timer.api.dao.crm.CrmClientDataMapper; ...@@ -54,6 +55,7 @@ import cn.timer.api.dao.crm.CrmClientDataMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dto.crm.CrmCartogramDto; import cn.timer.api.dto.crm.CrmCartogramDto;
import cn.timer.api.dto.crm.CrmClientDataImportVo; import cn.timer.api.dto.crm.CrmClientDataImportVo;
import cn.timer.api.dto.kqmk.DailyDetailsDto;
import cn.timer.api.utils.CheckUtil; import cn.timer.api.utils.CheckUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -376,7 +378,7 @@ public class CrmController { ...@@ -376,7 +378,7 @@ public class CrmController {
public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) { public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) {
Integer empNum = getEmpNum(userBean); Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean); Integer orgCode = getOrgCode(userBean);
crmClientData.setClientStatus(0); crmClientData.setClientStatus(1);
crmClientData.setCreateUser(empNum); crmClientData.setCreateUser(empNum);
SysRegion district = getSysRegion(crmClientData.getDistrictId()); SysRegion district = getSysRegion(crmClientData.getDistrictId());
// crmClientData.setZipCode(district.getZipCode()); // crmClientData.setZipCode(district.getZipCode());
...@@ -534,8 +536,8 @@ public class CrmController { ...@@ -534,8 +536,8 @@ public class CrmController {
Integer cid = crmClientAssociate.getCid(); Integer cid = crmClientAssociate.getCid();
CrmClientData crmClientData = CrmClientData.builder().build() CrmClientData crmClientData = CrmClientData.builder().build()
.selectOne(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getId, cid) .selectOne(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getId, cid)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId) .eq(groupId != null && groupId >0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status) .eq(status != null && status >0, CrmClientData::getClientStatus, status)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or() .like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like)); .like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
if (crmClientData != null) if (crmClientData != null)
...@@ -618,8 +620,31 @@ public class CrmController { ...@@ -618,8 +620,31 @@ public class CrmController {
List<CrmClientData> result = getPageList(crmClientDatas, pageNumber, pageSize, List<CrmClientData> result = getPageList(crmClientDatas, pageNumber, pageSize,
Comparator.comparing(CrmClientData::getCreateTime).reversed()); Comparator.comparing(CrmClientData::getCreateTime).reversed());
return ResultUtil.pageData(result, (long) crmClientDatas.size(), "查询成功"); List<CrmClientData> resultlist = new ArrayList<CrmClientData>();
for(CrmClientData crmd : result) {
CrmClientData crmdts = CrmClientData.builder().build();
BeanUtil.copyProperties(crmd, crmdts , "iscooperation");
List<CrmClientAssociate> crmClientAssociates = CrmClientAssociate.builder().build()
.selectList(new QueryWrapper<CrmClientAssociate>().lambda().eq(CrmClientAssociate::getCid, crmd.getId()));
if(crmClientAssociates.size() > 0) {
for (CrmClientAssociate crmClientAssociate : crmClientAssociates) {
Integer empNum1 = crmClientAssociate.getAssociateId();
if(userBean.getEmpNum().equals(empNum1)) {
crmdts.setIscooperation(1);
}else {
crmdts.setIscooperation(0);
}
}
}else {
crmdts.setIscooperation(0);
}
resultlist.add(crmdts);
}
return ResultUtil.pageData(resultlist, (long) crmClientDatas.size(), "查询成功");
// return ResultUtil.data(crmClientDatas, "查询成功"); // return ResultUtil.data(crmClientDatas, "查询成功");
} }
......
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