提交 ba1dcb65 authored 作者: 李秋林's avatar 李秋林

店铺计划转让

上级 17652ddc
......@@ -17,6 +17,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.Objects;
/**
* @author : liqiulin
......@@ -56,6 +57,19 @@ public class ActivityPlanRecordCoreController {
}
}
/**
* 活动店铺转让
*/
@PutMapping("/transfer")
public R transferActivityPlan(@RequestBody ActivityPlanVo activityPlanVo) {
if (Objects.isNull(activityPlanVo.getOriginalEmpId()) || Objects.isNull(activityPlanVo.getTransferEmpId())){
throw new ParamException(RCode.CHARGER_ID_ERROR);
}
activityPlanRecordCoreService.transferActivityPlan(activityPlanVo);
return R.success();
}
@DeleteMapping("/delete/{id}")
public R deleteActivityPlanById(@PathVariable Long id){
if (NumberUtils.isNull(id)){
......
......@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.manage.dao;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import java.util.List;
import java.util.Set;
......@@ -28,4 +29,6 @@ public interface EmployeeActivityPlanInfoDao {
EmployeeActivityPlanInfoDto selectOne(ActivityPlanInfoWrapper wrapper);
Set<String> findStoreNameByEmployeeId(Integer employeeId);
void transfer(Integer oriId, ManageEmployeeInfoDto tranUser);
}
......@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.manage.dao;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanRecordWrapper;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanRecordDto;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import java.util.List;
......@@ -20,4 +21,5 @@ public interface EmployeeActivityPlanRecordDao {
void deleteById(Long id);
void transfer(Integer oriId, ManageEmployeeInfoDto tranUser);
}
......@@ -11,6 +11,7 @@ import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -107,6 +108,11 @@ public class EmployeeActivityPlanInfoDaoImpl implements EmployeeActivityPlanInfo
}
@Override
public void transfer(Integer oriId, ManageEmployeeInfoDto tranUser) {
employeeActivityPlanInfoMapper.transfer(oriId, tranUser.getId(),tranUser.getEmployeeNo(),tranUser.getName());
}
private LambdaQueryWrapper<EmployeeActivityPlanInfoDO> buildWrapper(ActivityPlanInfoWrapper wrapper) {
LambdaQueryWrapper<EmployeeActivityPlanInfoDO> qw = new LambdaQueryWrapper<>();
if (Objects.nonNull(wrapper.getEmployeeId())) {
......
......@@ -11,6 +11,7 @@ import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanRecordWrappe
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanRecordDto;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -71,6 +72,11 @@ public class EmployeeActivityPlanRecordDaoImpl implements EmployeeActivityPlanRe
employeeActivityPlanRecordMapper.deleteByIdFake(id);
}
@Override
public void transfer(Integer oriId, ManageEmployeeInfoDto tranUser) {
employeeActivityPlanRecordMapper.updateByEmployeeId(oriId,tranUser.getId(),tranUser.getName());
}
private LambdaQueryWrapper<EmployeeActivityPlanRecordDO> buildWrapper(ActivityPlanRecordWrapper rWrapper){
LambdaQueryWrapper<EmployeeActivityPlanRecordDO> qw = new LambdaQueryWrapper<>();
if (Objects.nonNull(rWrapper.getId())){
......
......@@ -24,6 +24,8 @@ public interface EmployeeActivityPlanInfoMapper extends BaseMapper<EmployeeActiv
void deletebyActivityPlanRecordId(Long recordId);
Set<String> findStoreNameByEmployeeId(Integer employeeId);
void transfer(@Param("oriId") Integer oriId,@Param("id") Integer id,@Param("employeeNo") String employeeNo,@Param("employeeName") String name);
}
......
......@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.manage.mapper;
import com.wangxiaolu.promotion.domain.manage.mapper.entity.EmployeeActivityPlanRecordDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
......@@ -16,6 +17,8 @@ import org.springframework.stereotype.Repository;
public interface EmployeeActivityPlanRecordMapper extends BaseMapper<EmployeeActivityPlanRecordDO> {
void deleteByIdFake(Long id);
void updateByEmployeeId(@Param("oriId") Integer oriId, @Param("tranId") Integer id,@Param("tranName") String name);
}
......
......@@ -55,4 +55,7 @@ public class ActivityPlanVo {
*/
// private Date monthEndDate;
private Integer originalEmpId;
private Integer transferEmpId;
}
......@@ -12,4 +12,6 @@ public interface ActivityPlanRecordCoreService {
void saveActivityPlan(EmployeeActivityPlanRecordDto planDto, ActivityPlanVo activityPlanVo) throws Exception;
void deleteById(Long id);
void transferActivityPlan(ActivityPlanVo activityPlanVo);
}
......@@ -61,6 +61,19 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
employeeActivityPlanInfoDao.deletebyActivityPlanRecordId(id);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void transferActivityPlan(ActivityPlanVo activityPlanVo) {
ManageEmployeeInfoDto oriUser = manageEmployeeInfoDao.selectById(activityPlanVo.getOriginalEmpId());
ManageEmployeeInfoDto tranUser = manageEmployeeInfoDao.selectById(activityPlanVo.getTransferEmpId());
if (Objects.isNull(oriUser) || Objects.isNull(tranUser)){
throw new DataException(RCode.CHARGER_ID_ERROR);
}
employeeActivityPlanRecordDao.transfer(oriUser.getId(),tranUser);
employeeActivityPlanInfoDao.transfer(oriUser.getId(),tranUser);
}
private void saveActivityPlanInfo(ActivityPlanVo activityPlanVo, EmployeeActivityPlanRecordDto planDto) throws Exception {
// 下载
String filePath = "/home/" + planDto.getExcelFiledId();
......
......@@ -2,7 +2,7 @@ spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://bj-cdb-j8ppdy86.sql.tencentcdb.com:63569/promotion_dev?autoReconnect=true
# url: jdbc:mysql://bj-cdb-j8ppdy86.sql.tencentcdb.com:63569/promotion_dev?autoReconnect=true
url: jdbc:mysql://192.168.100.39:25301/promotion_dev?autoReconnect=true
username: root
password: Zt%68Dsuv&M
......
......@@ -58,4 +58,12 @@
and is_delete = 1;
</select>
<update id="transfer">
update employee_activity_plan_info
set employee_id = #{id},
employee_name = #{employeeName},
employee_no = #{employeeNo}
where employee_id = #{oriId}
and is_delete = 1;
</update>
</mapper>
......@@ -28,6 +28,17 @@
</sql>
<update id="deleteByIdFake">
update employee_activity_plan_record set is_delete = 0,delete_time = now() where id = #{id};
update employee_activity_plan_record
set is_delete = 0,
delete_time = now()
where id = #{id};
</update>
<update id="updateByEmployeeId">
update employee_activity_plan_record
set employee_id = #{tranId},
employee_name = #{tranName}
where employee_id = #{oriId}
and is_delete = 1;
</update>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论