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

店铺计划转让

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