Commit e713e8c0 by Administrator

Merge branch 'develop' into 'master'

Develop

See merge request 8timerv2/8timerapiv200!481
parents c82b1690 657b5d72
......@@ -164,6 +164,11 @@ public class CrmClientData extends Model<CrmClientData> {
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "协作(0:否 1:是)")
private Integer iscooperation;
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "协作人id")
private Integer[] ids;
......
......@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
......@@ -54,6 +55,7 @@ import cn.timer.api.dao.crm.CrmClientDataMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dto.crm.CrmCartogramDto;
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.Result;
import cn.timer.api.utils.ResultUtil;
......@@ -376,7 +378,7 @@ public class CrmController {
public Result<Object> addClient(@CurrentUser UserBean userBean, @RequestBody CrmClientData crmClientData) {
Integer empNum = getEmpNum(userBean);
Integer orgCode = getOrgCode(userBean);
crmClientData.setClientStatus(0);
crmClientData.setClientStatus(1);
crmClientData.setCreateUser(empNum);
SysRegion district = getSysRegion(crmClientData.getDistrictId());
// crmClientData.setZipCode(district.getZipCode());
......@@ -516,8 +518,9 @@ public class CrmController {
.eq(status != null && status > 0, CrmClientData::getClientStatus, status).eq(typei != null && typei > 0, CrmClientData::getClientType, typei)
.ge(StringUtils.isNotBlank(startCreateTime), CrmClientData::getCreateTime, startCreateTime)
.le(StringUtils.isNotBlank(endCreateTime), CrmClientData::getCreateTime, endCreateTime)
.ge(StringUtils.isNotBlank(startFollowTime), CrmClientData::getCreateTime, startFollowTime)
.le(StringUtils.isNotBlank(endFollowTime), CrmClientData::getCreateTime, endFollowTime).like(!StrUtil.isBlank(like), CrmClientData::getBelongUserName, like).or()
.ge(StringUtils.isNotBlank(startFollowTime), CrmClientData::getLastFollowTime, startFollowTime)
.le(StringUtils.isNotBlank(endFollowTime), CrmClientData::getLastFollowTime, endFollowTime).like(!StrUtil.isBlank(like), CrmClientData::getBelongUserName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like)
.orderByDesc(CrmClientData::getCreateTime));
......@@ -525,7 +528,7 @@ public class CrmController {
// 我协作的客户
private List<CrmClientData> getMyAssociateCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,
String like) {
String like,Integer typei,String startFollowTime, String endFollowTime) {
List<CrmClientAssociate> crmClientAssociates = CrmClientAssociate.builder().build().selectList(
new QueryWrapper<CrmClientAssociate>().lambda().eq(CrmClientAssociate::getAssociateId, empNum)
.eq(CrmClientAssociate::getOrgCode, orgCode).select(CrmClientAssociate::getCid));
......@@ -534,8 +537,11 @@ public class CrmController {
Integer cid = crmClientAssociate.getCid();
CrmClientData crmClientData = CrmClientData.builder().build()
.selectOne(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getId, cid)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status)
.eq(groupId != null && groupId >0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >0, CrmClientData::getClientStatus, status).eq(typei != null && typei > 0, CrmClientData::getClientType, typei)
.ge(StringUtils.isNotBlank(startFollowTime), CrmClientData::getLastFollowTime, startFollowTime)
.le(StringUtils.isNotBlank(endFollowTime), CrmClientData::getLastFollowTime, endFollowTime)
.like(!StrUtil.isBlank(like), CrmClientData::getClientName, like).or()
.like(!StrUtil.isBlank(like), CrmClientData::getClientCellphone, like));
if (crmClientData != null)
......@@ -546,20 +552,20 @@ public class CrmController {
// 我的全部客户
private List<CrmClientData> getMyTotalCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,
String like,Integer type) {
String like,Integer typei) {
return CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status, like,null,null,null,null,null),
getMyAssociateCilent(empNum, orgCode, groupId, status, like), true);
getMyAssociateCilent(empNum, orgCode, groupId, status, like,typei,null,null), true);
}
// 我关注的客户
private List<CrmClientData> getMyStarCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,Integer type) {
private List<CrmClientData> getMyStarCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,Integer typei) {
return getMyTotalCilent(empNum, orgCode, groupId, status, null,null).stream()
.filter(item -> item.getStar().equals(1)).collect(Collectors.toList());
}
// 七天未跟进的客户
private List<CrmClientData> getCilentFollowOvertime(Integer empNum, Integer orgCode, Integer groupId,
Integer status,Integer type) {
Integer status,Integer typei) {
return getMyTotalCilent(empNum, orgCode, groupId, status, null,null).stream()
.filter(item -> item.getLastFollowTime() != null
&& item.getLastFollowTime().before(DateUtil.offsetDay(new Date(), -7)))
......@@ -598,17 +604,17 @@ public class CrmController {
List<CrmClientData> crmClientDatas = null;
if (type == null || type == 0) { // 全部客户(去重)
List<CrmClientData> myClient = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,typei);
List<CrmClientData> myAsso = getMyAssociateCilent(empNum, orgCode, groupId, status, like);
List<CrmClientData> myAsso = getMyAssociateCilent(empNum, orgCode, groupId, status, like,typei,startFollowTime,endFollowTime);
crmClientDatas = CheckUtil.distinct(myClient, myAsso, true).stream()
.filter(CheckUtil.distinctByKey(CrmClientData::getId)).collect(Collectors.toList());
} else if (type == 1) // 我负责的客户
crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,type);
else if (type == 2) // 我协作的客户
crmClientDatas = getMyAssociateCilent(empNum, orgCode, groupId, status, like);
crmClientDatas = getMyAssociateCilent(empNum, orgCode, groupId, status, like,typei,startFollowTime,endFollowTime);
else if (type == 3) // 我关注的客户
crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status,type);
crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status,typei);
else if (type == 4) // 七天未跟进的客户
crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status,type);
crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status,typei);
else
return ResultUtil.error("查询失败");
// Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
......@@ -619,7 +625,30 @@ public class CrmController {
List<CrmClientData> result = getPageList(crmClientDatas, pageNumber, pageSize,
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, "查询成功");
}
......@@ -828,7 +857,7 @@ public class CrmController {
@RequestBody CrmClientContacts crmClientContacts) {
Integer cid = crmClientContacts.getCid();
if (crmClientContacts.getId() == null) {
if (crmClientContacts.getId() == null || crmClientContacts.getId().equals(0)) {
if (cid == null)
return ResultUtil.error("编辑失败,请传入客户id");
......
......@@ -281,8 +281,9 @@ public class ClockInController {
}else {
long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0,
endtime3 = 0,endtime3ks = 0,endtime3js = 0;
List<AttSchedule> ash = null;
if(attdate.getAttsch().size() > 0) {
List<AttSchedule> ash = attdate.getAttsch();
ash = attdate.getAttsch();
int y = 0;
clockt.setShifid(ash.get(y).getId());
shifid = ash.get(y).getId();//班次id
......@@ -537,6 +538,27 @@ public class ClockInController {
if(clockt.getShifid() != 0) {
boolean dddbdk = true;//
boolean dak2 = true;
//打卡无限制时 当前时间必须大于上班打卡时间 才能打下班卡
if(punchstart==0 && punchend==0 && (atttype == 2 || atttype == 4 || atttype == 6)) {
String xbdk = "";
if(atttype == 2) {
xbdk = String.valueOf(ash.get(0).getTime());
}else if(atttype == 4){
xbdk = String.valueOf(ash.get(2).getTime());
}else {
xbdk = String.valueOf(ash.get(4).getTime());
}
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(xbdk)));//当天应打的首次上班卡时间
Date sd2=df1.parse(current_time);//当前时间
if(sd2.before(sd1)) {//小于
dak2 = false;
}
}
if(!dak2) { dddbdk = false; }
if(dddbdk) {
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attdate.getAttsch().size() > 0 && clockt.getShifid() > 0){//有无班次
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, clockt.getShifid()));
......@@ -601,15 +623,15 @@ public class ClockInController {
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attdateyesterday = MethodCall(qyid,userid,yesterday);
List<AttSchedule> ash = attdateyesterday.getAttsch();
List<AttSchedule> ash1 = attdateyesterday.getAttsch();
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime1 = ash.get(1).getTime();
yesendtime1 = ash1.get(1).getTime();
}
if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime2 = ash.get(3).getTime();
yesendtime2 = ash1.get(3).getTime();
}
if(attdateyesterday.getAttsch().size() == 6) {
yesendtime3 = ash.get(5).getTime();
yesendtime3 = ash1.get(5).getTime();
}
}
......@@ -877,6 +899,11 @@ public class ClockInController {
status_ = 2;
}
}else {
msg = "当前时间必须大于上班打卡时间 才能打下班卡";
sbyf = 0;
status_ = 2;
}
}else {
msg = "当前是休息时间";
sbyf = 0;
status_ = 2;
......@@ -1617,8 +1644,9 @@ public class ClockInController {
}else {
long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0,
endtime3 = 0,endtime3ks = 0,endtime3js = 0;
List<AttSchedule> ash =null;
if(attdate.getAttsch().size() > 0) {
List<AttSchedule> ash = attdate.getAttsch();
ash = attdate.getAttsch();
int y = 0;
clockt.setShifid(ash.get(y).getId());
shifid = ash.get(y).getId();//班次id
......@@ -1893,7 +1921,27 @@ public class ClockInController {
}
if(clockt.getShifid() != 0) {
boolean dddbdk = true;//
boolean dak2 = true;
//打卡无限制时 当前时间必须大于上班打卡时间 才能打下班卡
if(punchstart==0 && punchend==0 && (atttype == 2 || atttype == 4 || atttype == 6)) {
String xbdk = "";
if(atttype == 2) {
xbdk = String.valueOf(ash.get(0).getTime());
}else if(atttype == 4){
xbdk = String.valueOf(ash.get(2).getTime());
}else {
xbdk = String.valueOf(ash.get(4).getTime());
}
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(xbdk)));//当天应打的首次上班卡时间
Date sd2=df1.parse(current_time);//当前时间
if(sd2.before(sd1)) {//小于
dak2 = false;
}
}
if(!dak2) { dddbdk = false; }
if(dddbdk) {
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attdate.getAttsch().size() > 0 && clockt.getShifid() > 0){//有无班次
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, clockt.getShifid()));
......@@ -1959,15 +2007,15 @@ public class ClockInController {
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attdateyesterday = MethodCall(qyid,userid,yesterday);
List<AttSchedule> ash = attdateyesterday.getAttsch();
List<AttSchedule> ash1 = attdateyesterday.getAttsch();
if(attdateyesterday.getAttsch().size() == 2 || attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime1 = ash.get(1).getTime();
yesendtime1 = ash1.get(1).getTime();
}
if(attdateyesterday.getAttsch().size() == 4 || attdateyesterday.getAttsch().size() == 6) {
yesendtime2 = ash.get(3).getTime();
yesendtime2 = ash1.get(3).getTime();
}
if(attdateyesterday.getAttsch().size() == 6) {
yesendtime3 = ash.get(5).getTime();
yesendtime3 = ash1.get(5).getTime();
}
}
......@@ -2237,6 +2285,11 @@ public class ClockInController {
status_ = 2;
}
}else {
msg = "当前时间必须大于上班打卡时间 才能打下班卡";
sbyf = 0;
status_ = 2;
}
}else {
msg = "当前是休息时间";
sbyf = 0;
status_ = 2;
......
......@@ -793,6 +793,10 @@ public class SpmkController {
if(mySummaryQueryDto.getSts() == null) {
mySummaryQueryDto.setSts(0);
}
//我发起的
if(mySummaryQueryDto.getType() == 0) {
mySummaryQueryDto.setSts(null);
}
// 缺-部门id 搜索
IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(page, mySummaryQueryDto);
......
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