提交 0de9ba6b authored 作者: 000516's avatar 000516 提交者: Coding

添加修改促销员活动模式入口;任务id与打卡id关联

发版功能 1. 添加数据异常类 2. 促销员创建任务后,任务id与打卡id关联 3. 管理后台 - 添加修改促销员活动模式接口 4. 定时任务-拉取勤策终端(包含已删除)
package com.wangxiaolu.promotion.controller.activity.employee;
import com.wangxiaolu.promotion.pojo.activity.employee.vo.ClockVo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.activity.employee.EmployeeCoreTemClockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author : liqiulin
* @date : 2024-07-17 19
* @describe : 管理员修改员工打卡信息
*/
@Slf4j
@RestController
@RequestMapping("/activity/employee/core/clock")
public class EmployeeCoreTemClockController {
@Autowired
EmployeeCoreTemClockService employeeCoreTemClockService;
// 修改员工打卡形式
@PutMapping("/update")
public R updateClockactivityPattern(@RequestBody ClockVo clockVo) {
TemporaryClockDto temporaryClockDto = new TemporaryClockDto();
temporaryClockDto.setId(clockVo.getId())
.setActivityPatternId(clockVo.getActivityPatternId())
.setActivityPattern(clockVo.getActivityPattern());
employeeCoreTemClockService.updateClockactivityPattern(temporaryClockDto);
return R.success();
}
}
......@@ -9,14 +9,15 @@ import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityRep
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityDataVo;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityMarketCellVo;
import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockCoreService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
......@@ -37,10 +38,14 @@ public class TemporaryActivityCoreController {
@Autowired
private TemporaryActivityClockQueryService tempActivityClockQueryService;
@Autowired
private TemporaryActivityClockCoreService tempActivityClockCoreService;
/**
* 促销员[今日活动]数据保存
* 返回活动生成id
*/
@Transactional(rollbackFor = Exception.class)
@PostMapping("/today/reported")
public R todayActivityDataReported(@RequestHeader("Authorization") String authorization, @RequestBody TemporaryActivityDataVo activityVo) {
TemporaryActivityReportedDto temActDto = new TemporaryActivityReportedDto();
......@@ -69,7 +74,14 @@ public class TemporaryActivityCoreController {
temActDto.setActivityPatternId(clockDto.getActivityPatternId());
temActDto.setActivityPattern(clockDto.getActivityPattern());
return R.success(tempActivityCoreService.activityDataReportedSave(temActDto));
long reportedId = tempActivityCoreService.activityDataReportedSave(temActDto);
TemporaryClockDto clockDtoUpdate = new TemporaryClockDto();
clockDtoUpdate.setId(clockDto.getId())
.setReportedId(reportedId);
tempActivityClockCoreService.updateById(clockDtoUpdate);
return R.success(reportedId);
}
/**
......
......@@ -57,7 +57,6 @@ public class TemporaryActivityQueryController {
/**
* 促销员[今日活动 - (出售列表中添加)出售单元]数据
* 数据暂存到redis中,当调用保存接口时再添加到数据库中
* 返回已保存的数据
*/
@GetMapping("/today/reported/market_cell")
public R todayActivityMarketCell(Integer temporaryId) {
......
......@@ -62,8 +62,6 @@ public class WeChatUserCoreController {
WxTemporaryInfoDto temporaryDto = new WxTemporaryInfoDto();
BeanUtils.copyProperties(wxTemporaryEnrollVo, temporaryDto);
return R.success(weChatUserCoreService.saveWxUserInfoTemporary(temporaryDto));
// System.out.println(JSONObject.toJSONString(temporaryDto));
// return R.success();
}
}
......@@ -28,6 +28,9 @@ public interface TemporaryActivityClockDao {
*/
TemporaryClockDto selectOne(TemporaryClockWrapper tcw);
TemporaryClockDto selectById(Long id);
/**
* 员工查询负责的促销员打卡信息(分页查询)
*/
......
......@@ -72,6 +72,12 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao
return transitionDto(clockDO);
}
@Override
public TemporaryClockDto selectById(Long id) {
TemporaryActivityClockDO clockDO = temporaryActivityClockMapper.selectById(id);
return transitionDto(clockDO);
}
@Override
public void employeePage(String employeeQcId, PageInfo pageInfo,TemporaryClockWrapper tcw) {
int skipNum = pageInfo.getSkipNum();
......
......@@ -21,7 +21,6 @@ public interface TemporaryActivityClockMapper extends BaseMapper<TemporaryActivi
List<TemporaryActivityClockDO> employeePageFirsd(@Param("employeeQcId") String employeeQcId, @Param("pageSize") int pageSize, @Param("skipNum") int skipNum, @Param("tcw") TemporaryClockWrapper tcw);
// List<TemporaryActivityClockDO> employeePage(@Param("employeeQcId") String employeeQcId, @Param("pageSize") int pageSize, @Param("maxId") Integer maxId);
Integer employeePageCount(@Param("employeeQcId") String employeeQcId, @Param("pageSize") int pageSize);
}
......
......@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.data.annotation.Transient;
/**
*
......@@ -32,6 +31,11 @@ public class TemporaryActivityClockDO implements Serializable {
*/
private String temporaryName;
/**
* 关联活动上报id
*/
private Long reportedId;
/**
* qince_clientele_store表qc_id
*/
......
package com.wangxiaolu.promotion.pojo.activity.employee.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
* @author : liqiulin
* @date : 2024-04-23 13
* @describe : 促销员打卡数据模型
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Accessors(chain = true)
public class ClockVo {
/**
* 打卡记录id
*/
Long id;
/**
* temporaryId
*/
Integer temporaryId;
// 活动模式Id
Integer activityPatternId;
// 活动模式
String activityPattern;
}
......@@ -31,6 +31,11 @@ public class TemporaryClockDto {
String temporaryName;
/**
* 关联活动上报id
*/
private Long reportedId;
// 店铺勤策id
// String storeQcId;
Long storeId;
......
package com.wangxiaolu.promotion.service.activity.employee;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
/**
* @author : liqiulin
* @date : 2024-07-18 13
* @describe :
*/
public interface EmployeeCoreTemClockService {
void updateClockactivityPattern(TemporaryClockDto temporaryClockDto);
}
package com.wangxiaolu.promotion.service.activity.employee.impl;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.employee.EmployeeCoreTemClockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Objects;
/**
* @author : liqiulin
* @date : 2024-07-18 13
* @describe :
*/
@Service
@Slf4j
public class EmployeeCoreTemClockServiceImpl implements EmployeeCoreTemClockService {
@Autowired
TemporaryActivityClockDao temporaryActivityClockDao;
@Autowired
TemporaryActivityReportedDao temporaryActivityReportedDao;
@Transactional(rollbackFor = Exception.class)
@Override
public void updateClockactivityPattern(TemporaryClockDto temporaryClockDto) {
TemporaryClockDto clockDto = temporaryActivityClockDao.selectById(temporaryClockDto.getId());
if (Objects.isNull(clockDto)){
throw new DataException(RCode.DATA_NOT_HAVE_ERROR);
}
temporaryActivityClockDao.updateById(temporaryClockDto);
TemporaryActivityReportedDto reportedDto = new TemporaryActivityReportedDto();
reportedDto.setId(clockDto.getReportedId())
.setActivityPatternId(temporaryClockDto.getActivityPatternId())
.setActivityPattern(temporaryClockDto.getActivityPattern());
temporaryActivityReportedDao.updateById(reportedDto);
}
}
......@@ -24,4 +24,6 @@ public interface TemporaryActivityClockCoreService {
void clockStoreCalDistance(String storeQcId, Long id, String clockCoordinates);
void updateClockPhoto(TemporaryClockDto dto);
void updateById(TemporaryClockDto clockDtoUpdate);
}
......@@ -93,6 +93,11 @@ public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityC
tempActivityPhotoDao.saveClockPhotoByUpdate(dto.getTemporaryId(),dto.getId(),dto.getBrevityClockType(),dto.getBrevityClockPhoto());
}
@Override
public void updateById(TemporaryClockDto clockDto) {
temporaryActivityClockDao.updateById(clockDto);
}
private void clockStoreCalDistanceByStoreQcId(String storeQcId, String clockCoordinates) {
// 查询组织架构参数、创建url
String[] clockCoordinateArr = clockCoordinates.split(",");
......
......@@ -3,7 +3,6 @@ package com.wangxiaolu.promotion.service.activity.temporary.impl;
import cn.hutool.core.date.DateUtil;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityPhotoDao;
import com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityPhotoDO;
import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryClockWrapper;
import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityPhotoDto;
......
......@@ -82,6 +82,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
.setProvince(promotionStoreDto.getProvince())
.setCity(promotionStoreDto.getCity());
// 返回生成的活动id
long reportedId = temporaryActivityReportedDao.activityDataSave(temActDto);
temActDto.setId(reportedId);
......
......@@ -34,13 +34,6 @@ public class WeChatUserCoreServiceImpl implements WeChatUserCoreService {
*/
@Override
public boolean saveWxUserInfoTemporary(WxTemporaryInfoDto temporaryDto) {
// 根据chargerQcId查询人员详情
// QinCeEmployeeDto qcEmpDto = qinCeEmployeeDao.selectOntByQcId(temporaryDto.getChargerQcId());
// if (Objects.isNull(qcEmpDto)){
// log.info("促销员注册,根据qc_id:{}查询负责人为空",temporaryDto.getChargerQcId());
// throw new ParamException(RCode.CHARGER_ID_ERROR,null);
// }
// temporaryDto.setChargerName(qcEmpDto.getEmpName());
int saveId = temporaryInfoDao.saveWxTemporaryInfo(temporaryDto);
log.info("微信-促销员[{}]:[{}]注册成功:{}", saveId, temporaryDto.getName(), JSONObject.toJSONString(temporaryDto));
return saveId > 0;
......
......@@ -129,7 +129,7 @@ public class QinCeUtils {
// 分页页码,默认1
params.put("page_number", pageNum);
// 记录状态。0:已删除(客户回收站中的终端数据),1:正常
params.put("status", "1");
// params.put("status", "1");
// after_modify_date:更新时间之后,查询更新时间之后的门店数据。格式:yyyy-MM-dd HH:mm:SS
DateTime dateTime = DateUtil.offsetDay(new Date(), -7);
params.put("after_modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN));
......
......@@ -16,6 +16,8 @@
<result property="clockProvince" column="clock_province" jdbcType="VARCHAR"/>
<result property="clockCity" column="clock_city" jdbcType="VARCHAR"/>
<result property="createDate" column="create_date" jdbcType="VARCHAR"/>
<result property="activityPatternId" column="activity_pattern_id" jdbcType="INTEGER"/>
<result property="activityPattern" column="activity_pattern" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -45,6 +47,8 @@
tc.clock_province,
tc.clock_city,
tc.create_date,
tc.activity_pattern_id,
tc.activity_pattern,
ti.dept_qc_org_name,
ti.charger_name
from temporary_info ti
......@@ -58,26 +62,6 @@
limit #{skipNum}, #{pageSize};
</select>
<select id="employeePage" resultMap="BaseResultMap">
select tc.id,
tc.temporary_name,
tc.create_date,
tc.store_name,
tc.clock_in_time,
tc.noon_clock_out_time,
tc.noon_clock_in_time,
tc.clock_out_time,
tc.clock_province,
tc.clock_city,
tc.create_date,
ti.dept_qc_org_name,
ti.charger_name
from temporary_info ti
inner join temporary_activity_clock tc on ti.id = tc.temporary_id
where tc.id &lt; #{maxId}
order by id desc limit #{pageSize};
</select>
<select id="employeePageCount" resultType="integer">
select count(*)
from temporary_info ti
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论