提交 afba6489 authored 作者: 000516's avatar 000516 提交者: Coding

1、修改多个计划 - 归属人;2、修改计划(web页面)-城+职都可以修改归属人;3、全量同步经销商

Merge Request: 1、修改多个计划 - 归属人;2、修改计划(web页面)-城+职都可以修改归属人;3、全量同步经销商 Created By: @李秋林 Accepted By: @李秋林 URL: https://g-pkkp8204.coding.net/p/promotion/d/promotion-service/git/merge/231?initial=true
......@@ -166,16 +166,24 @@ public class PromPlanCoreController {
return R.success();
}
@PutMapping("/update")
@PutMapping("/one")
public R putActivityPlan(@RequestBody ActivityPlanOperVo operVo){
if (Objects.isNull(operVo.getId())){
throw new ParamException(RCode.NEED_PARAM_ERROR);
}
if (!operVo.getOperNo().equals(operVo.getEmployeeNo()) && !manageEmployeeQueryService.isAuth(operVo.getOperNo())){
if (!manageEmployeeQueryService.isAuth(operVo.getOperNo())){
throw new ParamException(RCode.EMP_PRIVILEGE_ERROR);
}
promPlanCoreService.putActivityPlan(operVo);
return R.success();
}
@PutMapping("/more")
public R putActivityPlans(@RequestBody ActivityPlanOperVo operVo){
if (Objects.isNull(operVo.getEmployeeId()) || Collections.isEmpty(operVo.getPlanIds())){
throw new ParamException(RCode.NEED_PARAM_ERROR);
}
promPlanCoreService.putActivityPlans(operVo);
return R.success();
}
}
......@@ -34,4 +34,6 @@ public interface ActivityPlanInfoDao {
List<ActivityPlanInfoDto> findClockList(ActivityPlanInfoWrapper wrapper);
void updatePlanStatus(Long planId, PlanStatus planStatus);
void updateByIds(List<Long> planIds, ActivityPlanInfoDto planDto);
}
......@@ -93,6 +93,11 @@ public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
activityPlanInfoMapper.updatePlanStatus(planId,planStatus.getCode());
}
@Override
public void updateByIds(List<Long> planIds, ActivityPlanInfoDto planDto) {
activityPlanInfoMapper.updateByIds(planIds, planDto);
}
@Override
public void page(PageInfo pageInfo, ActivityPlanInfoWrapper wrapper) {
LambdaQueryWrapper<ActivityPlanInfoDo> qw = buildWrapper(wrapper);
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -36,6 +37,8 @@ public interface ActivityPlanInfoMapper extends BaseMapper<ActivityPlanInfoDo> {
void updatePlanStatus(@Param("id") Long planId, @Param("status") Integer status);
List<ActivityPlanInfoDo> findClockList(ActivityPlanInfoWrapper wrapper);
void updateByIds(@Param("ids") List<Long> planIds, @Param("planDto") ActivityPlanInfoDto planDto);
}
......
......@@ -8,6 +8,7 @@ import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* @author : liqiulin
......@@ -27,6 +28,7 @@ public class ActivityPlanOperVo {
/**
* 计划归属人
*/
private Integer employeeId;
private String employeeNo;
/**
......@@ -71,5 +73,5 @@ public class ActivityPlanOperVo {
* 杂费
*/
private BigDecimal incidentals;
private List<Long> planIds;
}
......@@ -29,4 +29,7 @@ public interface PromPlanCoreService {
void saveActivityPlan(ActivityPlanOperVo operVo);
void updatePlanStatus(Long planId, PlanStatus planStatus);
void putActivityPlans(ActivityPlanOperVo operVo);
}
......@@ -493,6 +493,16 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
}
ActivityPlanInfoDto planDto = new ActivityPlanInfoDto();
// 归属人改变
if (!operVo.getEmployeeId().equals(dto.getEmployeeId())){
ManageEmployeeInfoDto employeeInfoDto = manageEmployeeInfoDao.selectById(operVo.getEmployeeId());
planDto.setEmployeeId(employeeInfoDto.getId())
.setEmployeeNo(employeeInfoDto.getEmployeeNo())
.setEmployeeName(employeeInfoDto.getName())
.setOrgQcId(employeeInfoDto.getDeptQcId())
.setOrgName(employeeInfoDto.getDeptQcName());
}
planDto.setId(operVo.getId())
.setPattern(operVo.getPattern())
.setClockInTime(operVo.getClockInTime())
......@@ -542,6 +552,19 @@ public class PromPlanCoreServiceImpl implements PromPlanCoreService {
activityPlanInfoDao.updatePlanStatus(planId, planStatus);
}
@Override
public void putActivityPlans(ActivityPlanOperVo operVo) {
ManageEmployeeInfoDto employeeInfoDto = manageEmployeeInfoDao.selectById(operVo.getEmployeeId());
ActivityPlanInfoDto planDto = new ActivityPlanInfoDto();
planDto.setEmployeeId(employeeInfoDto.getId())
.setEmployeeName(employeeInfoDto.getName())
.setEmployeeNo(employeeInfoDto.getEmployeeNo())
.setOrgName(employeeInfoDto.getDeptQcName())
.setOrgQcId(employeeInfoDto.getDeptQcId())
.setModifyBy(operVo.getOperName());
activityPlanInfoDao.updateByIds(operVo.getPlanIds(),planDto);
}
/**
* 城市经理 - 修改计划
*/
......
......@@ -84,9 +84,8 @@ public class QinCeUtils {
*/
public Map<String, Object> queryOrgParam() {
Map<String, Object> params = new HashMap<>();
// DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
// params.put("modify_date", DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN));
params.put("modify_date", "");
DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
params.put("modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATE_PATTERN));
return params;
}
......@@ -99,9 +98,8 @@ public class QinCeUtils {
if (queryId) {
params.put("id", "");
}
// DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
// params.put("modify_date", DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN));
params.put("modify_date", "");
DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
params.put("modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATE_PATTERN));
return params;
}
......@@ -160,9 +158,10 @@ public class QinCeUtils {
params.put("page_number", pageNum);
// 记录状态。0:已删除,1:正常 params.put("status", "1");
// todo 全量数据同步后,再开启指定日期同步
DateTime dateTime = DateUtil.offsetHour(new Date(), -2);
params.put("after_create_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN));
//todo 全量数据同步后,再开启指定日期同步
// DateTime dateTime = DateUtil.offsetHour(new Date(), -2);
// params.put("after_create_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN));
params.put("after_create_date", "");
return params;
}
}
......@@ -176,4 +176,20 @@
</where>
limit 50
</select>
<update id="updateByIds">
update activity_plan_info
set employee_id = #{planDto.employeeId},
employee_name = #{planDto.employeeName},
employee_no = #{planDto.employeeNo},
org_qc_id = #{planDto.orgQcId},
org_name = #{planDto.orgName},
modify_by = #{planDto.modifyBy}
where is_delete = 1
and plan_status = 0
and id in
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论