Commit f2b279f1 by 徐高华

核销文案

parent ea7c429b
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.moment; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.moment;
import java.io.Serializable ; import java.io.Serializable ;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* *
...@@ -72,8 +73,16 @@ public class QwMomentPlanDTO implements Serializable{ ...@@ -72,8 +73,16 @@ public class QwMomentPlanDTO implements Serializable{
private String qwJobid; private String qwJobid;
/**完成率*/ /**完成率*/
private Integer execRate; private Integer execRate;
// 选择的导购id列表
private List<String> selectClerkIdList ;
public List<String> getSelectClerkIdList() {
return selectClerkIdList;
}
public void setSelectClerkIdList(List<String> selectClerkIdList) {
this.selectClerkIdList = selectClerkIdList;
}
public Long getPlanId() { public Long getPlanId() {
return planId; return planId;
......
...@@ -16,6 +16,6 @@ public interface QwMomentPlanAttendService { ...@@ -16,6 +16,6 @@ public interface QwMomentPlanAttendService {
* @param enterpriseId * @param enterpriseId
* @param planId * @param planId
*/ */
void saveClerk(String enterpriseId, List<String> clerkIdList , Long planId) ; void saveClerk(String enterpriseId, Long planId , List<String> clerkIdList) ;
} }
...@@ -35,8 +35,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService ...@@ -35,8 +35,8 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
return null; return null;
} }
@Override
public void saveClerk(String enterpriseId,Long planId , List<String> clerkIdList) { public void saveClerk(String enterpriseId, Long planId , List<String> clerkIdList) {
List<String> existClerkIdList = this.qwMomentPlanAttendMapper.listExistClerkIds(planId,clerkIdList) ; List<String> existClerkIdList = this.qwMomentPlanAttendMapper.listExistClerkIds(planId,clerkIdList) ;
if(CollectionUtils.isNotEmpty(existClerkIdList)) { if(CollectionUtils.isNotEmpty(existClerkIdList)) {
clerkIdList = clerkIdList.stream().filter(o->!existClerkIdList.contains(o)).collect(Collectors.toList()); clerkIdList = clerkIdList.stream().filter(o->!existClerkIdList.contains(o)).collect(Collectors.toList());
......
...@@ -50,10 +50,12 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -50,10 +50,12 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
if(plan.getPublishType()==1) { if(plan.getPublishType()==1) {
plan.setPublishTime(now); plan.setPublishTime(now);
} }
boolean createFlag = false ;
plan.setBeginDate(plan.getPublishTime()); plan.setBeginDate(plan.getPublishTime());
Date endTime = DateUtil.addDay(plan.getBeginDate(), plan.getExpireDays()); Date endTime = DateUtil.addDay(plan.getBeginDate(), plan.getExpireDays());
plan.setEndDate(endTime); plan.setEndDate(endTime);
if(null == planId) { if(null == planId) {
createFlag = true ;
planId = UniqueIdUtils.uniqueLong(); planId = UniqueIdUtils.uniqueLong();
dto.setPlanId(planId); dto.setPlanId(planId);
plan.setPlanId(planId); plan.setPlanId(planId);
...@@ -66,13 +68,13 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService { ...@@ -66,13 +68,13 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
// 参与导购 // 参与导购
if(dto.getPlanClerkType()==1) { if(dto.getPlanClerkType()==1) {
if (createFlag) { if (createFlag) {
this.qwMomentPlanAttendService.saveClerk(enterpriseId, dto.getSelectClerkIdList(), planId); this.qwMomentPlanAttendService.saveClerk(enterpriseId, planId,dto.getSelectClerkIdList());
} else { } else {
List<String> oldList = this.qwMomentPlanAttendMapper.listClerk(planId,0).stream().map(o -> o.getClerkId()).collect(Collectors.toList()); List<String> oldList = this.qwMomentPlanAttendMapper.listClerk(planId,0).stream().map(o -> o.getClerkId()).collect(Collectors.toList());
List<String> newList = dto.getSelectClerkIdList(); List<String> newList = dto.getSelectClerkIdList();
List<String> addList = newList.stream().filter(o -> !oldList.contains(o)).distinct().collect(Collectors.toList()); List<String> addList = newList.stream().filter(o -> !oldList.contains(o)).distinct().collect(Collectors.toList());
List<String> delList = oldList.stream().filter(o -> !newList.contains(o)).distinct().collect(Collectors.toList()); List<String> delList = oldList.stream().filter(o -> !newList.contains(o)).distinct().collect(Collectors.toList());
this.qwMomentPlanAttendService.saveClerk(enterpriseId, addList, planId); this.qwMomentPlanAttendService.saveClerk(enterpriseId, planId , addList);
if (CollectionUtils.isNotEmpty(delList)) { if (CollectionUtils.isNotEmpty(delList)) {
this.qwMomentPlanAttendMapper.delClerks(planId, delList); this.qwMomentPlanAttendMapper.delClerks(planId, delList);
} }
......
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