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

1、在链路中心操作促销账号;2、促销计划收入系统;3、登录token与链路中心打通

Merge Request: 1、在链路中心操作促销账号;2、促销计划收入系统;3、登录token与链路中心打通 Created By: @李秋林 Accepted By: @李秋林 URL: https://g-pkkp8204.coding.net/p/promotion/d/promotion-service/git/merge/209?initial=true
...@@ -4,19 +4,29 @@ ...@@ -4,19 +4,29 @@
mvn package -DskipTests mvn package -DskipTests
docker stop promotion-service docker stop promotion-service && docker rm promotion-service
docker rm promotion-service docker rmi promotion-service
docker rmi
docker build -t promotion-service:0.2.0 .
docker build -t promotion-service:latest . Live启动:
docker run -d -p 8011:8011 --name promotion-service \ docker run -d -p 8011:8011 --name promotion-service \
-v /var/logs/promotion-service/:/var/logs/promotion-service/ \ -v /var/logs/promotion-service/:/var/logs/promotion-service/ \
-v /var/logs/xxl_job/:/var/logs/xxl_job/ \ -v /var/logs/xxl_job/:/var/logs/xxl_job/ \
-v /root/promotion/planv2/:/root/promotion/planv2/ \
--restart=always \ --restart=always \
--network host \ --network host \
promotion-service:latest promotion-service:latest
QA启动:
docker run -d -p 8011:8011 --name promotion-service-020 \
-v /var/logs/promotion-service/:/var/logs/promotion-service/ \
-v /var/logs/xxl_job/:/var/logs/xxl_job/ \
-v /root/promotion/planv2/:/root/promotion/planv2/ \
--restart=always \
--network host \
promotion-service:0.2.0 \
--spring.profiles.active=qa
\ No newline at end of file
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
<parent> <parent>
<groupId>com.wangxiaolu</groupId> <groupId>com.wangxiaolu</groupId>
<artifactId>wangxiaolu-promotion-parent</artifactId> <artifactId>wangxiaolu-promotion-parent</artifactId>
<version>0.0.2</version> <version>0.0.3</version>
</parent> </parent>
<groupId>com.wangxiaolu</groupId> <groupId>com.wangxiaolu</groupId>
<artifactId>wangxiaolu-promotion-service</artifactId> <artifactId>wangxiaolu-promotion-service</artifactId>
<version>0.1.12</version> <version>0.2.0</version>
<name>wangxiaolu-promotion-service</name> <name>wangxiaolu-promotion-service</name>
<description>promotion-service</description> <description>promotion-service</description>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<dependency> <dependency>
<groupId>com.wangxiaolu</groupId> <groupId>com.wangxiaolu</groupId>
<artifactId>wangxiaolu-promotion-common</artifactId> <artifactId>wangxiaolu-promotion-common</artifactId>
<version>0.0.2</version> <version>0.0.3</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>spring-cloud-gateway-server</artifactId> <artifactId>spring-cloud-gateway-server</artifactId>
...@@ -239,6 +239,19 @@ ...@@ -239,6 +239,19 @@
<artifactId>java-uuid-generator</artifactId> <artifactId>java-uuid-generator</artifactId>
<version>${java-uuid-generator.version}</version> <version>${java-uuid-generator.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>${aliyun.oss.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>sts20150401</artifactId>
<version>${aliyun.sts.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.wangxiaolu.promotion.controller.activity.manage.tem; package com.wangxiaolu.promotion.controller.activity.manage.tem;
import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus; import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ApproveVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ApproveVo;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode; import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.manage.EmployeeCoreTemActivityService; import com.wangxiaolu.promotion.service.activity.manage.EmployeeCoreTemActivityService;
import com.wangxiaolu.promotion.service.activity.manage.EmployeeCoreTemClockService;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanCoreService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
...@@ -22,7 +26,11 @@ import org.springframework.web.bind.annotation.*; ...@@ -22,7 +26,11 @@ import org.springframework.web.bind.annotation.*;
public class EmployeeCoreTemActivityController { public class EmployeeCoreTemActivityController {
@Autowired @Autowired
EmployeeCoreTemActivityService employeeCoreTemActivityService; private EmployeeCoreTemActivityService employeeCoreTemActivityService;
@Autowired
private EmployeeCoreTemClockService employeeCoreTemClockService;
@Autowired
private PromPlanCoreService promPlanCoreService;
/** /**
* 管理员审批上报活动数据 * 管理员审批上报活动数据
...@@ -39,9 +47,15 @@ public class EmployeeCoreTemActivityController { ...@@ -39,9 +47,15 @@ public class EmployeeCoreTemActivityController {
/** /**
* 管理员删除活动记录 * 管理员删除活动记录
*/ */
@Transactional(rollbackFor = Exception.class)
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
public R deleteActivityById(@PathVariable("id") long id){ public R deleteActivityById(@PathVariable("id") long id){
employeeCoreTemActivityService.deleteById(id); employeeCoreTemActivityService.deleteById(id);
// 删除打卡记录
Long planId = employeeCoreTemClockService.deleteClockByReportedId(id);
// 把计划状态改为未执行
promPlanCoreService.updatePlanStatus(planId, PlanStatus.NOT_EXECUTION);
return R.success(); return R.success();
} }
......
...@@ -2,12 +2,15 @@ package com.wangxiaolu.promotion.controller.activity.manage.tem; ...@@ -2,12 +2,15 @@ package com.wangxiaolu.promotion.controller.activity.manage.tem;
import com.wangxiaolu.promotion.common.redis.RedisKeys; import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache; import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ClockVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ClockVo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.activity.manage.EmployeeCoreTemClockService; import com.wangxiaolu.promotion.service.activity.manage.EmployeeCoreTemClockService;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanCoreService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
...@@ -21,7 +24,9 @@ import org.springframework.web.bind.annotation.*; ...@@ -21,7 +24,9 @@ import org.springframework.web.bind.annotation.*;
public class EmployeeCoreTemClockController { public class EmployeeCoreTemClockController {
@Autowired @Autowired
EmployeeCoreTemClockService employeeCoreTemClockService; private EmployeeCoreTemClockService employeeCoreTemClockService;
@Autowired
private PromPlanCoreService promPlanCoreService;
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
...@@ -37,9 +42,14 @@ public class EmployeeCoreTemClockController { ...@@ -37,9 +42,14 @@ public class EmployeeCoreTemClockController {
return R.success(); return R.success();
} }
@Transactional(rollbackFor = Exception.class)
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
public R deleteClockById(@PathVariable("id") long id){ public R deleteClockById(@PathVariable("id") long id){
employeeCoreTemClockService.deleteClockById(id); // 删除打卡记录
Long planId = employeeCoreTemClockService.deleteClockById(id);
// 把计划状态改为未执行
promPlanCoreService.updatePlanStatus(planId, PlanStatus.NOT_EXECUTION);
return R.success(); return R.success();
} }
......
...@@ -25,7 +25,6 @@ public class EmployeeQueryTemActivityController { ...@@ -25,7 +25,6 @@ public class EmployeeQueryTemActivityController {
* *
* @param loginQcId 员工 * @param loginQcId 员工
* @return 活动数据 * @return 活动数据
* @RequestHeader("loginQcId") String loginQcId
*/ */
@PostMapping("/page") @PostMapping("/page")
public R findActivitys(String loginQcId, @RequestBody PageInfo pageInfo) { public R findActivitys(String loginQcId, @RequestBody PageInfo pageInfo) {
......
...@@ -24,8 +24,8 @@ public class EmployeeQueryTemClockController { ...@@ -24,8 +24,8 @@ public class EmployeeQueryTemClockController {
* 查询员工打卡记录 * 查询员工打卡记录
*/ */
@PostMapping("/page") @PostMapping("/page")
public R findClockList(@RequestHeader("loginQcId") String loginQcId, @RequestBody PageInfo pageInfo) { public R findClockList(@RequestBody PageInfo pageInfo) {
employeeQueryTemClockService.findClockList(loginQcId, pageInfo); employeeQueryTemClockService.findClockList("", pageInfo);
return R.success(pageInfo); return R.success(pageInfo);
} }
......
...@@ -23,7 +23,6 @@ public class EmployeeQueryTemporaryInfoController { ...@@ -23,7 +23,6 @@ public class EmployeeQueryTemporaryInfoController {
/** /**
* 查询负责的促销员列表 * 查询负责的促销员列表
* @RequestHeader("loginQcId") String loginQcId,
*/ */
@PostMapping("/page") @PostMapping("/page")
public R findTemporaryInfoPage(@RequestBody PageInfo pageInfo) { public R findTemporaryInfoPage(@RequestBody PageInfo pageInfo) {
......
...@@ -29,25 +29,25 @@ public class PromotionStoreCoreController { ...@@ -29,25 +29,25 @@ public class PromotionStoreCoreController {
@Autowired @Autowired
RedisCache redisCache; RedisCache redisCache;
@PostMapping("/save") // @PostMapping("/save")
public R saveStore(@RequestHeader("Authorization") String authorization, @RequestBody PromotionStoreDto promotionStoreDto) { // public R saveStore(@RequestHeader("Authorization") String authorization, @RequestBody PromotionStoreDto promotionStoreDto) {
promotionStoreDto.verify(); // promotionStoreDto.verify();
// 是否重复提交 // // 是否重复提交
repetitiveSaveStore(authorization); // repetitiveSaveStore(authorization);
//
// 在缓存中查询 // // 在缓存中查询
JSONObject userJson = redisCache.getToJson(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + authorization); // JSONObject userJson = redisCache.getToJson(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + authorization);
//
promotionStoreDto.setTemporaryId(userJson.getInteger("id")); // promotionStoreDto.setTemporaryId(userJson.getInteger("id"));
promotionStoreDto.setTemporaryName(userJson.getString("name")); // promotionStoreDto.setTemporaryName(userJson.getString("name"));
promotionStoreDto.setDeptQcId(userJson.getString("deptQcId")); // promotionStoreDto.setDeptQcId(userJson.getString("deptQcId"));
promotionStoreDto.setDeptQcOrgName(userJson.getString("deptQcOrgName")); // promotionStoreDto.setDeptQcOrgName(userJson.getString("deptQcOrgName"));
promotionStoreDto.setChargerQcId(userJson.getString("chargerQcId")); // promotionStoreDto.setChargerQcId(userJson.getString("chargerQcId"));
promotionStoreDto.setChargerName(userJson.getString("chargerName")); // promotionStoreDto.setChargerName(userJson.getString("chargerName"));
//
promotionStoreCoreService.saveStore(promotionStoreDto); // promotionStoreCoreService.saveStore(promotionStoreDto);
return R.success(); // return R.success();
} // }
private void repetitiveSaveStore(String authorization) { private void repetitiveSaveStore(String authorization) {
String recordKey = RedisKeys.TemporaryKeys.TEMPORARY_SAVE_STORE_REPETITIVE.getKey() + authorization; String recordKey = RedisKeys.TemporaryKeys.TEMPORARY_SAVE_STORE_REPETITIVE.getKey() + authorization;
......
...@@ -45,8 +45,8 @@ public class TemporaryActivityClockCoreController { ...@@ -45,8 +45,8 @@ public class TemporaryActivityClockCoreController {
clockVo.validate(); clockVo.validate();
Integer clockType = clockVo.getClockType(); Integer clockType = clockVo.getClockType();
boolean isClockIn = ClockType.TEMPORARY_CLOCK_IN.equals(clockType); boolean isClockIn = ClockType.TEMPORARY_CLOCK_IN.equals(clockType);
// 上班卡必需有店铺id // 上班卡必需有促销计划ID
if (isClockIn && (Objects.isNull(clockVo.getStoreId()) || clockVo.getStoreId() <= 0)) { if (isClockIn && (Objects.isNull(clockVo.getPlanId()) || clockVo.getPlanId() <= 0)) {
throw new ParamException(RCode.NOT_CLOCK_STORE_ERROR, null); throw new ParamException(RCode.NOT_CLOCK_STORE_ERROR, null);
} }
// 非上班卡必需有打卡记录ID // 非上班卡必需有打卡记录ID
...@@ -72,7 +72,8 @@ public class TemporaryActivityClockCoreController { ...@@ -72,7 +72,8 @@ public class TemporaryActivityClockCoreController {
} else if (ClockType.TEMPORARY_CLOCK_OUT.equals(clockType)) { } else if (ClockType.TEMPORARY_CLOCK_OUT.equals(clockType)) {
builderClockOutData(clockVo, dto, clockTime); builderClockOutData(clockVo, dto, clockTime);
} }
tempActivityClockCoreService.clockInTodayActivity(dto, clockType); // tempActivityClockCoreService.clockInTodayActivity(dto, clockType);
tempActivityClockCoreService.clockInTodayPlan(dto, clockType);
return R.success(); return R.success();
} }
...@@ -116,14 +117,9 @@ public class TemporaryActivityClockCoreController { ...@@ -116,14 +117,9 @@ public class TemporaryActivityClockCoreController {
// 上班打卡 // 上班打卡
private void builderClockInData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) { private void builderClockInData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) {
// if (!DateUtils.parseTime(new Date(), ClockType.TEMPORARY_CLOCK_IN_BEGIN_TIME, ClockType.TEMPORARY_CLOCK_IN_END_TIME)) { clockDto.setPlanId(clockVo.getPlanId())
// throw new ParamException(RCode.CLOCK_DETAIL_TIME_ERROR, null); // .setStoreId(clockVo.getStoreId())
// } // .setStoreName(clockVo.getStoreName())
clockDto.setTemporaryId(clockVo.getTemporaryId())
.setTemporaryName(clockVo.getTemporaryName())
.setStoreId(clockVo.getStoreId())
.setStoreName(clockVo.getStoreName())
.setClockInAddress(clockVo.getClockAddress()) .setClockInAddress(clockVo.getClockAddress())
.setClockInCoordinates(clockVo.getClockCoordinates()) .setClockInCoordinates(clockVo.getClockCoordinates())
.setClockInPhoto(clockVo.getClockPhoto()) .setClockInPhoto(clockVo.getClockPhoto())
...@@ -132,9 +128,6 @@ public class TemporaryActivityClockCoreController { ...@@ -132,9 +128,6 @@ public class TemporaryActivityClockCoreController {
// 午休下班卡 // 午休下班卡
private void builderNoonClockOutData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) { private void builderNoonClockOutData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) {
// if (!DateUtils.parseTime(new Date(), ClockType.TEMPORARY_NOON_CLOCK_OUT_BEGIN_TIME, ClockType.TEMPORARY_NOON_CLOCK_OUT_END_TIME)) {
// throw new ParamException(RCode.CLOCK_DETAIL_TIME_ERROR, null);
// }
clockDto.setId(clockVo.getId()) clockDto.setId(clockVo.getId())
.setNoonClockOutAddress(clockVo.getClockAddress()) .setNoonClockOutAddress(clockVo.getClockAddress())
.setNoonClockOutCoordinates(clockVo.getClockCoordinates()) .setNoonClockOutCoordinates(clockVo.getClockCoordinates())
...@@ -145,9 +138,6 @@ public class TemporaryActivityClockCoreController { ...@@ -145,9 +138,6 @@ public class TemporaryActivityClockCoreController {
// 午休上班卡 // 午休上班卡
private void builderNoonClockInData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) { private void builderNoonClockInData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) {
// if (!DateUtils.parseTime(new Date(), ClockType.TEMPORARY_NOON_CLOCK_IN_BEGIN_TIME, ClockType.TEMPORARY_NOON_CLOCK_IN_END_TIME)) {
// throw new ParamException(RCode.CLOCK_DETAIL_TIME_ERROR, null);
// }
clockDto.setId(clockVo.getId()) clockDto.setId(clockVo.getId())
.setNoonClockInAddress(clockVo.getClockAddress()) .setNoonClockInAddress(clockVo.getClockAddress())
.setNoonClockInCoordinates(clockVo.getClockCoordinates()) .setNoonClockInCoordinates(clockVo.getClockCoordinates())
...@@ -157,9 +147,6 @@ public class TemporaryActivityClockCoreController { ...@@ -157,9 +147,6 @@ public class TemporaryActivityClockCoreController {
// 下班卡 // 下班卡
private void builderClockOutData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) { private void builderClockOutData(TemporaryClockVo clockVo, TemporaryClockDto clockDto, Date dateTime) {
// if (!DateUtils.parseTime(new Date(), ClockType.TEMPORARY_CLOCK_OUT_BEGIN_TIME, ClockType.TEMPORARY_CLOCK_OUT_END_TIME)) {
// throw new ParamException(RCode.CLOCK_DETAIL_TIME_ERROR, null);
// }
clockDto.setId(clockVo.getId()) clockDto.setId(clockVo.getId())
.setClockOutAddress(clockVo.getClockAddress()) .setClockOutAddress(clockVo.getClockAddress())
.setClockOutCoordinates(clockVo.getClockCoordinates()) .setClockOutCoordinates(clockVo.getClockCoordinates())
......
...@@ -8,9 +8,11 @@ import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCloc ...@@ -8,9 +8,11 @@ import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCloc
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.Objects; import java.util.Objects;
/** /**
...@@ -33,7 +35,7 @@ public class TemporaryActivityClockQueryController { ...@@ -33,7 +35,7 @@ public class TemporaryActivityClockQueryController {
@GetMapping("/{temporary_id}") @GetMapping("/{temporary_id}")
public R findTodayTemporaryClockByTemId(@PathVariable("temporary_id") Integer temporaryId) { public R findTodayTemporaryClockByTemId(@PathVariable("temporary_id") Integer temporaryId) {
if (Objects.isNull(temporaryId) || temporaryId < 1){ if (Objects.isNull(temporaryId) || temporaryId < 1){
throw new DataException(RCode.DATA_NOT_HAVE_ERROR,null); throw new DataException(RCode.DATA_NOT_HAVE_ERROR);
} }
TemporaryClockDto clockDto = temporaryActivityClockQueryService.findTodayTemporaryClockByTemId(temporaryId); TemporaryClockDto clockDto = temporaryActivityClockQueryService.findTodayTemporaryClockByTemId(temporaryId);
...@@ -50,7 +52,7 @@ public class TemporaryActivityClockQueryController { ...@@ -50,7 +52,7 @@ public class TemporaryActivityClockQueryController {
@GetMapping("/date") @GetMapping("/date")
public R findTemporaryClockByTemIdAndDate(Integer temporaryId, String createDate) { public R findTemporaryClockByTemIdAndDate(Integer temporaryId, String createDate) {
if (Objects.isNull(temporaryId) || temporaryId < 1 || StringUtils.isBlank(createDate)){ if (Objects.isNull(temporaryId) || temporaryId < 1 || StringUtils.isBlank(createDate)){
throw new DataException(RCode.DATA_NOT_HAVE_ERROR,null); throw new DataException(RCode.DATA_NOT_HAVE_ERROR);
} }
TemporaryClockDto clockDto = temporaryActivityClockQueryService.findTemporaryClockByTemIdAndDate(temporaryId, createDate); TemporaryClockDto clockDto = temporaryActivityClockQueryService.findTemporaryClockByTemIdAndDate(temporaryId, createDate);
...@@ -63,7 +65,7 @@ public class TemporaryActivityClockQueryController { ...@@ -63,7 +65,7 @@ public class TemporaryActivityClockQueryController {
@GetMapping("/id") @GetMapping("/id")
public R findTemporaryClockByTemIdAndDate(Long id) { public R findTemporaryClockByTemIdAndDate(Long id) {
if (Objects.isNull(id) || id < 1){ if (Objects.isNull(id) || id < 1){
throw new DataException(RCode.DATA_NOT_HAVE_ERROR,null); throw new DataException(RCode.DATA_NOT_HAVE_ERROR);
} }
TemporaryClockDto clockDto = temporaryActivityClockQueryService.findById(id); TemporaryClockDto clockDto = temporaryActivityClockQueryService.findById(id);
return R.success(clockDto); return R.success(clockDto);
......
package com.wangxiaolu.promotion.controller.activity.temporary; package com.wangxiaolu.promotion.controller.activity.temporary;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus; import com.wangxiaolu.promotion.enums.activity.TemActApproveStatus;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
...@@ -14,10 +12,12 @@ import com.wangxiaolu.promotion.result.basedata.RCode; ...@@ -14,10 +12,12 @@ import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockCoreService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockCoreService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockQueryService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityCoreService;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityQueryService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Objects; import java.util.Objects;
...@@ -31,13 +31,12 @@ import java.util.Objects; ...@@ -31,13 +31,12 @@ import java.util.Objects;
@RestController @RestController
@RequestMapping("/activity/temporary/core") @RequestMapping("/activity/temporary/core")
public class TemporaryActivityCoreController { public class TemporaryActivityCoreController {
@Autowired
private RedisCache redisCache;
@Autowired @Autowired
private TemporaryActivityCoreService tempActivityCoreService; private TemporaryActivityCoreService tempActivityCoreService;
@Autowired @Autowired
private TemporaryActivityClockQueryService tempActivityClockQueryService; private TemporaryActivityClockQueryService tempActivityClockQueryService;
@Autowired
private TemporaryActivityQueryService temporaryActivityQueryService;
@Autowired @Autowired
private TemporaryActivityClockCoreService tempActivityClockCoreService; private TemporaryActivityClockCoreService tempActivityClockCoreService;
...@@ -70,12 +69,12 @@ public class TemporaryActivityCoreController { ...@@ -70,12 +69,12 @@ public class TemporaryActivityCoreController {
temActDto.setApproveStatus(TemActApproveStatus.SUBMITTED) temActDto.setApproveStatus(TemActApproveStatus.SUBMITTED)
.setDealerName(clockDto.getDealerName()) .setDealerName(clockDto.getDealerName())
.setLineName(clockDto.getLineName()) .setLineName(clockDto.getLineName())
.setPlanId(clockDto.getPlanId())
.setStoreName(clockDto.getStoreName()) .setStoreName(clockDto.getStoreName())
.setDeptQcId(clockDto.getDeptQcId()) .setDeptQcId(clockDto.getDeptQcId())
.setDeptQcOrgName(clockDto.getDeptQcOrgName()) .setDeptQcOrgName(clockDto.getDeptQcOrgName())
.setApproverId(clockDto.getChargerQcId()) .setManageId(clockDto.getChargerId())
.setApproveName(clockDto.getChargerName()) .setManageName(clockDto.getChargerName())
.setActivityPatternId(clockDto.getActivityPatternId())
.setActivityPattern(clockDto.getActivityPattern()) .setActivityPattern(clockDto.getActivityPattern())
.setProvince(clockDto.getClockProvince()) .setProvince(clockDto.getClockProvince())
.setCity(clockDto.getClockCity()); .setCity(clockDto.getClockCity());
...@@ -126,6 +125,18 @@ public class TemporaryActivityCoreController { ...@@ -126,6 +125,18 @@ public class TemporaryActivityCoreController {
*/ */
@PutMapping("/reported/approve/submit/{id}") @PutMapping("/reported/approve/submit/{id}")
public R activityReportedSubmit(@PathVariable("id") Long id) { public R activityReportedSubmit(@PathVariable("id") Long id) {
TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(id);
if (activityReportedDto.getApproveStatus().equals(TemActApproveStatus.APPROVED)){
return R.success();
}
if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR);
}
tempActivityCoreService.activityReportedSubmit(id); tempActivityCoreService.activityReportedSubmit(id);
return R.success(); return R.success();
} }
......
...@@ -3,12 +3,10 @@ package com.wangxiaolu.promotion.controller.activity.temporary; ...@@ -3,12 +3,10 @@ package com.wangxiaolu.promotion.controller.activity.temporary;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityPlanVo; import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityPlanVo;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityPlanQueryService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityPlanQueryService;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanQueryService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author : liqiulin * @author : liqiulin
...@@ -22,6 +20,8 @@ public class TemporaryActivityPlanQueryController { ...@@ -22,6 +20,8 @@ public class TemporaryActivityPlanQueryController {
@Autowired @Autowired
TemporaryActivityPlanQueryService temporaryActivityPlanQueryService; TemporaryActivityPlanQueryService temporaryActivityPlanQueryService;
@Autowired
PromPlanQueryService promPlanQueryService;
/** /**
* 获取当月、当前城市/ALL(全国)的门店计划列表 * 获取当月、当前城市/ALL(全国)的门店计划列表
...@@ -32,5 +32,13 @@ public class TemporaryActivityPlanQueryController { ...@@ -32,5 +32,13 @@ public class TemporaryActivityPlanQueryController {
return R.success(temporaryActivityPlanQueryService.findClockStoreList(temporaryActivityPlanVo)); return R.success(temporaryActivityPlanQueryService.findClockStoreList(temporaryActivityPlanVo));
} }
/**
* 小程序端促销员查询促销计划
*/
@GetMapping("/plans")
public R findActivityPlanInfo(TemporaryActivityPlanVo temporaryActivityPlanVo){
return R.success(promPlanQueryService.findClockList(temporaryActivityPlanVo));
}
} }
...@@ -84,15 +84,16 @@ public class TemporaryActivityQueryController { ...@@ -84,15 +84,16 @@ public class TemporaryActivityQueryController {
*/ */
@GetMapping("/today/approved_verify/{id}") @GetMapping("/today/approved_verify/{id}")
public R findActivityApprovedVerify(@PathVariable("id") Long activityId){ public R findActivityApprovedVerify(@PathVariable("id") Long activityId){
TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(activityId); // TemporaryActivityReportedDto activityReportedDto = temporaryActivityQueryService.findTemporaryActivityById(activityId);
//
if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){ // if (CollectionUtils.isEmpty(activityReportedDto.getTgscPhotoInfos()) || activityReportedDto.getTgscPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR); // throw new DataException(RCode.NOT_TGSH_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){ // }else if (CollectionUtils.isEmpty(activityReportedDto.getTghdPhotoInfos()) || activityReportedDto.getTghdPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR); // throw new DataException(RCode.NOT_TGHD_PHOTO_ERROR);
}else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){ // }else if (CollectionUtils.isEmpty(activityReportedDto.getTgcjPhotoInfos()) || activityReportedDto.getTgcjPhotoInfos().size() < 4){
throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR); // throw new DataException(RCode.NOT_TGCJ_PHOTO_ERROR);
} // }
return R.success(); // return R.success();
return R.fail();
} }
} }
package com.wangxiaolu.promotion.controller.activity.manage.activityplan; package com.wangxiaolu.promotion.controller.activityplan;
import com.wangxiaolu.promotion.common.redis.RedisKeys; import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache; import com.wangxiaolu.promotion.common.redis.service.RedisCache;
......
package com.wangxiaolu.promotion.controller.activity.manage.activityplan; package com.wangxiaolu.promotion.controller.activityplan;
import com.wangxiaolu.promotion.pojo.PageInfo; import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo;
......
package com.wangxiaolu.promotion.controller.activity.manage.activityplan; package com.wangxiaolu.promotion.controller.activityplan;
import com.wangxiaolu.promotion.common.util.NumberUtils; import com.wangxiaolu.promotion.common.util.NumberUtils;
import com.wangxiaolu.promotion.exception.DataException; import com.wangxiaolu.promotion.exception.DataException;
......
package com.wangxiaolu.promotion.controller.activity.manage.activityplan; package com.wangxiaolu.promotion.controller.activityplan;
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;
......
package com.wangxiaolu.promotion.controller.activity.manage.activityplan; package com.wangxiaolu.promotion.controller.activityplan;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.activity.manage.ActivityTypeQueryService; import com.wangxiaolu.promotion.service.activity.manage.ActivityTypeQueryService;
......
package com.wangxiaolu.promotion.controller.activityplanv2;
import com.wangxiaolu.promotion.common.excel.FileUtils;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanVo;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo;
import com.wangxiaolu.promotion.pojo.activity.planv2.vo.ActivityPlanOperVo;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanCoreService;
import com.wangxiaolu.promotion.service.user.ManageEmployeeQueryService;
import io.jsonwebtoken.lang.Collections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Objects;
/**
* @author : liqiulin
* @date : 2025-01-07 13
* @describe :
*/
@RestController
@RequestMapping("/plan/v2/core")
public class PromPlanCoreController {
@Autowired
private PromPlanCoreService promPlanCoreService;
@Autowired
private ManageEmployeeQueryService manageEmployeeQueryService;
/**
* 城市经理 - 上传计划(新增)
* 当月只能上传次月的新增(当月需要新增需要交由职能角色上传)
*/
@PostMapping("/self/upload")
public R selfPlan(@RequestBody ActivityPlanVo activityPlanVo) {
// 判断当前账号是否是城市经理
boolean isSelf = manageEmployeeQueryService.isOneSelf(activityPlanVo.getEmployeeNo());
if (!isSelf) {
throw new DataException(RCode.EMP_PRIVILEGE_ERROR);
}else {
ManageEmployeeInfoDto one = manageEmployeeQueryService.findOne(new ManageEmployeeVo().setEmployeeNo(activityPlanVo.getEmployeeNo()));
activityPlanVo.setEmployeeId(one.getId())
.setEmployeeName(one.getName())
.setDeptQcId(one.getDeptQcId())
.setDeptQcName(one.getDeptQcName());
}
try {
String[] urlArr = activityPlanVo.getExcelUrl().split("/");
String fileId = urlArr[urlArr.length - 1];
String filePath = "/root/promotion/planv2/" + fileId;
FileUtils.downloadExcel(activityPlanVo.getExcelUrl(), filePath);
activityPlanVo.setExcelId(fileId);
Map<String, Object> map = promPlanCoreService.selfPlanUp(activityPlanVo, filePath);
return R.success(map);
} catch (DataException e) {
return new R(e.getCode(), e.getMsg(), null);
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
/**
* 职能角色 - 上传计划(新增)
*/
@PostMapping("/auth/upload")
public R authPlan(@RequestBody ActivityPlanVo activityPlanVo) {
boolean isAuth = manageEmployeeQueryService.isAuth(activityPlanVo.getEmployeeNo());
if (!isAuth) {
throw new DataException(RCode.EMP_PRIVILEGE_ERROR);
}else {
ManageEmployeeInfoDto one = manageEmployeeQueryService.findOne(new ManageEmployeeVo().setEmployeeNo(activityPlanVo.getEmployeeNo()));
activityPlanVo.setEmployeeId(one.getId())
.setEmployeeName(one.getName())
.setDeptQcId(one.getDeptQcId())
.setDeptQcName(one.getDeptQcName());
}
try {
String[] urlArr = activityPlanVo.getExcelUrl().split("/");
String fileId = urlArr[urlArr.length - 1];
String filePath = "/root/promotion/planv2/" + fileId;
FileUtils.downloadExcel(activityPlanVo.getExcelUrl(), filePath);
activityPlanVo.setExcelId(fileId);
Map<String, Object> map = promPlanCoreService.authPlanUp(activityPlanVo, filePath);
return R.success(map);
} catch (DataException e) {
return new R(e.getCode(), e.getMsg(), null);
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
/**
* 确认上传(根据任一UUID)
*/
@GetMapping("/upload/{uuid}")
public R selfPlanAf(@PathVariable("uuid") String planUuid){
promPlanCoreService.selfPlanAf(planUuid);
return R.success();
}
/**
* 促销计划修改
*/
@PutMapping("/put")
public R planPut(@RequestBody ActivityPlanVo activityPlanVo) {
// 判断当前账号是否正常
ManageEmployeeInfoDto one = manageEmployeeQueryService.findOne(new ManageEmployeeVo().setEmployeeNo(activityPlanVo.getEmployeeNo()));
if (Objects.isNull(one)) {
throw new DataException(RCode.EMP_PRIVILEGE_ERROR);
}
activityPlanVo.setEmployeeId(one.getId())
.setEmployeeName(one.getName())
.setDeptQcId(one.getDeptQcId())
.setDeptQcName(one.getDeptQcName());
try {
String[] urlArr = activityPlanVo.getExcelUrl().split("/");
String fileId = urlArr[urlArr.length - 1];
String filePath = "/root/promotion/planv2/" + fileId;
FileUtils.downloadExcel(activityPlanVo.getExcelUrl(), filePath);
activityPlanVo.setExcelId(fileId);
Map<String, Object> map = promPlanCoreService.selfPlanPut(activityPlanVo, filePath);
return R.success(map);
} catch (DataException e) {
return new R(e.getCode(), e.getMsg(), null);
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
/**
* 删除计划 计划日期大于今日可直接删除,如果计划日期是今日则必需是10点之前,包含过去日期不可删除
*/
@DeleteMapping("/delete")
public R deletePlan(@RequestBody ActivityPlanVo activityPlanVo){
if (Collections.isEmpty(activityPlanVo.getPlanIds())){
throw new ParamException(RCode.NEED_PARAM_ERROR);
}
// 判断当前账号是否是职能角色
String employeeNo = activityPlanVo.getEmployeeNo();
boolean isAuth = manageEmployeeQueryService.isAuth(employeeNo);
if (isAuth) {
employeeNo = "";
}
promPlanCoreService.deletePlan(activityPlanVo.getPlanIds(), employeeNo);
return R.success();
}
@PostMapping("/save")
public R saveWebActivityPlan(@RequestBody ActivityPlanOperVo operVo){
boolean oneSelf = manageEmployeeQueryService.isOneSelf(operVo.getEmployeeNo());
if (!oneSelf){
throw new ParamException(RCode.ACTIVITY_PLAN_EMPLOYEE_ERROR);
}
promPlanCoreService.saveActivityPlan(operVo);
return R.success();
}
@PutMapping("/update")
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())){
throw new ParamException(RCode.EMP_PRIVILEGE_ERROR);
}
promPlanCoreService.putActivityPlan(operVo);
return R.success();
}
}
package com.wangxiaolu.promotion.controller.user.employee; package com.wangxiaolu.promotion.controller.activityplanv2;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo; import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.user.WangxlEmployeeQueryService; import com.wangxiaolu.promotion.service.activityplanv2.PromPlanQueryService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -12,21 +11,19 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -12,21 +11,19 @@ import org.springframework.web.bind.annotation.RestController;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-05-28 19 * @date : 2025-02-06 16
* @describe : 王小卤员工登录接口 * @describe :
*/ */
@RestController @RestController
@RequestMapping("/user/employee") @RequestMapping("/plan/v2/query")
public class WangxlEmployeeLoginController { public class PromPlanQueryController {
@Autowired @Autowired
WangxlEmployeeQueryService wangxlEmployeeQueryService; private PromPlanQueryService promPlanQueryService;
@PostMapping("/login") @PostMapping("/page")
public R wangxlEmployeelogin(@RequestBody UserLoginParam userLoginParam) { public R queryPage(@RequestBody PageInfo pageInfo){
userLoginParam.validate(); promPlanQueryService.queryPage(pageInfo);
LoginVo loginVo = wangxlEmployeeQueryService.employeeLoginVerify(userLoginParam); return R.success(pageInfo);
return R.success(loginVo);
} }
} }
package com.wangxiaolu.promotion.controller.user.employee;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.user.ManageEmployeeCoreService;
import com.wangxiaolu.promotion.service.user.ManageEmployeeQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Objects;
/**
* @author : liqiulin
* @date : 2025-01-13 13
* @describe :
*/
@RestController
@RequestMapping("/user/employee/core")
public class ManageEmployeeCoreController {
@Autowired
ManageEmployeeQueryService manageEmployeeQueryService;
@Autowired
ManageEmployeeCoreService manageEmployeeCoreService;
/**
* 操作业务员账号
* 开通、关闭、修改权限
*/
@PostMapping ("/account")
public R openEmployeeAccount(@RequestBody UserLoginParam param) {
param.valLoginName();
if (Objects.isNull(param.getPrivilegeId())) {
return R.fail(RCode.EMP_PRIVILEGE_ERROR);
}
// 开通新账号、修改账号(账号信息、权限)
boolean hasEmp = manageEmployeeQueryService.hasByEmpNo(param.getLoginName());
if (hasEmp) {
manageEmployeeCoreService.putAccount(param);
}else {
manageEmployeeCoreService.openAccount(param);
}
return R.success();
}
}
...@@ -2,6 +2,8 @@ package com.wangxiaolu.promotion.controller.user.employee; ...@@ -2,6 +2,8 @@ package com.wangxiaolu.promotion.controller.user.employee;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto; import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.user.ManageEmployeeQueryService; import com.wangxiaolu.promotion.service.user.ManageEmployeeQueryService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,22 +17,35 @@ import java.util.List; ...@@ -15,22 +17,35 @@ import java.util.List;
* @describe : 王小卤员工登录接口 * @describe : 王小卤员工登录接口
*/ */
@RestController @RestController
@RequestMapping("/user/employee/query") @RequestMapping("/user/employee")
public class ManageEmployeeQueryController { public class ManageEmployeeQueryController {
@Autowired @Autowired
ManageEmployeeQueryService manageEmployeeQueryService; ManageEmployeeQueryService manageEmployeeQueryService;
@PostMapping("/one") @PostMapping("/login")
public R wangxlEmployeelogin(@RequestBody UserLoginParam userLoginParam) {
userLoginParam.validate();
LoginVo loginVo = manageEmployeeQueryService.employeeLoginVerify(userLoginParam);
return R.success(loginVo);
}
@PostMapping("/query/one")
public R findOne(@RequestBody ManageEmployeeVo manageEmployeeVo){ public R findOne(@RequestBody ManageEmployeeVo manageEmployeeVo){
ManageEmployeeInfoDto one = manageEmployeeQueryService.findOne(manageEmployeeVo); ManageEmployeeInfoDto one = manageEmployeeQueryService.findOne(manageEmployeeVo);
return R.success(one); return R.success(one);
} }
@PostMapping("/list") /**
* 查询员工列表
* 后台页面查询促销员列表使用
*/
@PostMapping("/query/list")
public R findList(@RequestBody ManageEmployeeVo manageEmployeeVo){ public R findList(@RequestBody ManageEmployeeVo manageEmployeeVo){
List<ManageEmployeeInfoDto> dtos = manageEmployeeQueryService.findList(manageEmployeeVo); List<ManageEmployeeInfoDto> dtos = manageEmployeeQueryService.findList(manageEmployeeVo);
return R.success(dtos); return R.success(dtos);
} }
} }
...@@ -4,10 +4,7 @@ import com.wangxiaolu.promotion.pojo.user.vo.ClienteleStoreQueryVo; ...@@ -4,10 +4,7 @@ import com.wangxiaolu.promotion.pojo.user.vo.ClienteleStoreQueryVo;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.service.user.QinCeClienteleDataQueryService; import com.wangxiaolu.promotion.service.user.QinCeClienteleDataQueryService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author : liqiulin * @author : liqiulin
......
...@@ -28,7 +28,7 @@ public class QinCeDepartmentQueryController { ...@@ -28,7 +28,7 @@ public class QinCeDepartmentQueryController {
/** /**
* 查询部门列表 * 查询部门列表
* 仅限注册时使用 * 注册促销员、后台页面查询战区列表时使用
*/ */
@PostMapping("/enroll/list") @PostMapping("/enroll/list")
public R getDeptList(@RequestBody QinceOrgQueryVo qinceOrgQueryVo){ public R getDeptList(@RequestBody QinceOrgQueryVo qinceOrgQueryVo){
......
package com.wangxiaolu.promotion.controller.activity.manage; package com.wangxiaolu.promotion.controller.user.tem;
import com.wangxiaolu.promotion.service.activity.manage.ActivityTypeQueryService; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.utils.TencentUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -8,18 +9,22 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -8,18 +9,22 @@ import org.springframework.web.bind.annotation.RestController;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-09-10 13 * @date : 2025-03-07 13
* @describe : * @describe :
*/ */
@RestController @RestController
@RequestMapping("/activity/employee/xxl_job") @RequestMapping("/wechat/miniapp/")
public class XxlJobController { public class MiappInfoController {
@Autowired @Autowired
private ActivityTypeQueryService activityTypeQueryService; private TencentUtils tencentUtils;
@GetMapping("/activity_type_pattern") /**
public void activityTypePattern(){ * 获取小程序 - 小卤通信息
activityTypeQueryService.patternToRedis(); * @return
*/
@GetMapping("/xlt")
public R getXLT() {
return R.success(tencentUtils.getXltMini());
} }
} }
package com.wangxiaolu.promotion.controller.user.tem; package com.wangxiaolu.promotion.controller.user.tem;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.common.redis.RedisKeys; import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache; import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.DataUtils;
import com.wangxiaolu.promotion.common.util.EnvUtil;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto; import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.WxTemporaryEnrollVo; import com.wangxiaolu.promotion.pojo.user.vo.WxTemporaryEnrollVo;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.result.basedata.RCode; import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.wechat.WeChatUserCoreService; import com.wangxiaolu.promotion.service.wechat.WeChatUserCoreService;
import com.wangxiaolu.promotion.common.util.DataUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -31,9 +31,11 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -31,9 +31,11 @@ import org.springframework.web.bind.annotation.RestController;
public class TemporaryInfoCoreController { public class TemporaryInfoCoreController {
@Autowired @Autowired
WeChatUserCoreService weChatUserCoreService; private WeChatUserCoreService weChatUserCoreService;
@Autowired
private RedisCache redisCache;
@Autowired @Autowired
RedisCache redisCache; private EnvUtil envUtil;
/** /**
* 促销员注册信息 * 促销员注册信息
...@@ -53,12 +55,14 @@ public class TemporaryInfoCoreController { ...@@ -53,12 +55,14 @@ public class TemporaryInfoCoreController {
/** /**
* 手机号-验证码 校验 * 手机号-验证码 校验
*/ */
String redisKey = RedisKeys.UserKeys.PHONE_VER_CODE.getKey() + wxTemporaryEnrollVo.getPhone(); if (envUtil.isLive()) {
String phoneCodeOld = redisCache.get(redisKey); String redisKey = RedisKeys.UserKeys.PHONE_VER_CODE.getKey() + wxTemporaryEnrollVo.getPhone();
if (StringUtils.isBlank(phoneCodeOld) || !phoneCodeOld.equals(wxTemporaryEnrollVo.getPhoneCode())) { String phoneCodeOld = redisCache.get(redisKey);
throw new ParamException(RCode.TENCENT_SMS_PHONE_CODE_ERROR, null); if (StringUtils.isBlank(phoneCodeOld) || !phoneCodeOld.equals(wxTemporaryEnrollVo.getPhoneCode())) {
throw new ParamException(RCode.TENCENT_SMS_PHONE_CODE_ERROR, null);
}
redisCache.removeKey(redisKey);
} }
redisCache.removeKey(redisKey);
WxTemporaryInfoDto temporaryDto = new WxTemporaryInfoDto(); WxTemporaryInfoDto temporaryDto = new WxTemporaryInfoDto();
BeanUtils.copyProperties(wxTemporaryEnrollVo, temporaryDto); BeanUtils.copyProperties(wxTemporaryEnrollVo, temporaryDto);
......
package com.wangxiaolu.promotion.controller.user.tem; package com.wangxiaolu.promotion.controller.user.tem;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache; import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.DataUtils; import com.wangxiaolu.promotion.common.util.DataUtils;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
...@@ -13,9 +11,10 @@ import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService; ...@@ -13,9 +11,10 @@ import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Objects; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* @author : liqiulin * @author : liqiulin
...@@ -25,7 +24,7 @@ import java.util.Objects; ...@@ -25,7 +24,7 @@ import java.util.Objects;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/user/wechat/query") @RequestMapping("/user/wechat/query")
public class temporaryInfoQueryController { public class TemporaryInfoQueryController {
@Autowired @Autowired
private WeChatUserQueryService weChatUserQueryService; private WeChatUserQueryService weChatUserQueryService;
...@@ -37,7 +36,7 @@ public class temporaryInfoQueryController { ...@@ -37,7 +36,7 @@ public class temporaryInfoQueryController {
* *
* @return 非null则登录成功 * @return 非null则登录成功
*/ */
@PostMapping("/temporary/login/phone_openid") // @PostMapping("/temporary/login/phone_openid")
public R temporaryLoginByPhoneAndOpenId(@RequestBody WxTemporaryLoginVo wxTemporaryLoginVo) { public R temporaryLoginByPhoneAndOpenId(@RequestBody WxTemporaryLoginVo wxTemporaryLoginVo) {
phontAndOpenIdVerify(wxTemporaryLoginVo); phontAndOpenIdVerify(wxTemporaryLoginVo);
if (!DataUtils.phonePattern(wxTemporaryLoginVo.getPhone())) { if (!DataUtils.phonePattern(wxTemporaryLoginVo.getPhone())) {
...@@ -47,19 +46,29 @@ public class temporaryInfoQueryController { ...@@ -47,19 +46,29 @@ public class temporaryInfoQueryController {
return R.success(loginVo); return R.success(loginVo);
} }
@PostMapping("/temporary/login/phone_openid")
public R temporaryLogin(@RequestBody WxTemporaryLoginVo wxTemporaryLoginVo) {
phontAndOpenIdVerify(wxTemporaryLoginVo);
if (!DataUtils.phonePattern(wxTemporaryLoginVo.getPhone())) {
throw new ParamException(RCode.PHONE_PARAM_ERROR, null);
}
LoginVo loginVo = weChatUserQueryService.temporaryLoginByPhone(wxTemporaryLoginVo.getPhone());
return R.success(loginVo);
}
/** /**
* 促销员信息查询 * 促销员信息查询
*/ */
@PostMapping("/temporary/phone_openid") // @PostMapping("/temporary/phone_openid")
public R getTemporaryInfoByOpenIdAndPhone(@RequestHeader("Authorization") String authorization, @RequestBody WxTemporaryLoginVo wxTemporaryLoginVo) { // public R getTemporaryInfoByOpenIdAndPhone(@RequestHeader("Authorization") String authorization, @RequestBody WxTemporaryLoginVo wxTemporaryLoginVo) {
// 在缓存中查询 // // 在缓存中查询
JSONObject userJson = redisCache.getToJson(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + authorization); // JSONObject userJson = redisCache.getToJson(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + authorization);
if (Objects.isNull(userJson)) { // if (Objects.isNull(userJson)) {
throw new ParamException(RCode.NOT_LOGIN_ERROR, null); // throw new ParamException(RCode.NOT_LOGIN_ERROR, null);
} // }
return R.success(userJson); // return R.success(userJson);
} // }
private void phontAndOpenIdVerify(WxTemporaryLoginVo wxTemporaryLoginVo) { private void phontAndOpenIdVerify(WxTemporaryLoginVo wxTemporaryLoginVo) {
if (StringUtils.isBlank(wxTemporaryLoginVo.getOpenId()) || StringUtils.isBlank(wxTemporaryLoginVo.getPhone())) { if (StringUtils.isBlank(wxTemporaryLoginVo.getOpenId()) || StringUtils.isBlank(wxTemporaryLoginVo.getPhone())) {
......
package com.wangxiaolu.promotion.controller.yun;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.wangxiaolu.promotion.result.basedata.R;
import com.wangxiaolu.promotion.utils.AliyunUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
/**
* @author : liqiulin
* @date : 2025-02-06 13
* @describe :
*/
@Slf4j
@RestController
@RequestMapping("/user/aliyun/")
public class AliyunGetToken {
@Autowired
private AliyunUtils aliyunUtils;
@GetMapping("/signature")
public R getSignature() {
try {
return R.success(aliyunUtils.getSignature());
}catch (JsonProcessingException e){
return R.fail();
}
}
@GetMapping("/sts_token")
public R getStsToken() {
try {
JSONObject stsToken = aliyunUtils.getStsToken();
return R.success(stsToken);
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
}
package com.wangxiaolu.promotion.controller.user; package com.wangxiaolu.promotion.controller.yun;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.result.basedata.R; import com.wangxiaolu.promotion.result.basedata.R;
......
...@@ -19,4 +19,13 @@ public interface ManageEmployeeInfoDao { ...@@ -19,4 +19,13 @@ public interface ManageEmployeeInfoDao {
List<ManageEmployeeInfoDto> selectList(ManageEmployeeWrapper ewrap); List<ManageEmployeeInfoDto> selectList(ManageEmployeeWrapper ewrap);
void openAccount(String employeeNo, Integer privilegeId);
boolean hasByEmpNo(String employeeNo);
void updateAccount(String employeeNo, Integer privilegeId, String status);
boolean isOneSelf(String employeeNo);
boolean isAuth(String employeeNo);
} }
...@@ -17,6 +17,7 @@ public interface TemporaryActivityPhotoDao { ...@@ -17,6 +17,7 @@ public interface TemporaryActivityPhotoDao {
* 保存活动上报照片list * 保存活动上报照片list
*/ */
void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls); void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls, List<String> changeUrls);
void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls);
/** /**
* 保存促销员上下班打卡图片 * 保存促销员上下班打卡图片
...@@ -37,4 +38,6 @@ public interface TemporaryActivityPhotoDao { ...@@ -37,4 +38,6 @@ public interface TemporaryActivityPhotoDao {
Map<Long, Map<Integer, String>> findClockPhotoGroupByClockIds(List<Long> clockIds); Map<Long, Map<Integer, String>> findClockPhotoGroupByClockIds(List<Long> clockIds);
Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Integer temporaryId, Long reportedId); Map<Integer, List<TemporaryActivityPhotoDto>> findReportedInfoGroup(Integer temporaryId, Long reportedId);
void deleteList(Long reportedId, int type);
} }
...@@ -12,6 +12,7 @@ import com.wangxiaolu.promotion.result.basedata.RCode; ...@@ -12,6 +12,7 @@ import com.wangxiaolu.promotion.result.basedata.RCode;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -64,6 +65,52 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao { ...@@ -64,6 +65,52 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao {
return transitionDtos(dos); return transitionDtos(dos);
} }
@Transactional(rollbackFor = Exception.class)
@Override
public void openAccount(String employeeNo, Integer privilegeId) {
ManageEmployeeInfoDO eDo = new ManageEmployeeInfoDO();
eDo.setEmployeeNo(employeeNo);
manageEmployeeInfoMapper.insertOne(eDo);
addPrivilege(eDo.getId(),privilegeId);
}
@Override
public boolean hasByEmpNo(String employeeNo) {
Integer id = manageEmployeeInfoMapper.hasByEmpNo(employeeNo);
return Objects.nonNull(id);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void updateAccount(String employeeNo, Integer privilegeId, String status) {
manageEmployeeInfoMapper.updateByEmployeeNo(employeeNo,status);
updatePrivilege(employeeNo,privilegeId);
}
@Override
public boolean isOneSelf(String employeeNo) {
return manageEmployeeInfoMapper.isOneSelf(employeeNo);
}
@Override
public boolean isAuth(String employeeNo) {
return manageEmployeeInfoMapper.isAuth(employeeNo);
}
/**
* 增加权限
*/
private void addPrivilege(Integer empId, Integer privilegeId) {
manageEmployeeInfoMapper.addPrivilege(empId,privilegeId);
}
/**
* 修改权限
*/
private void updatePrivilege(String employeeNo, Integer privilegeId) {
manageEmployeeInfoMapper.updatePrivilege(employeeNo,privilegeId);
}
private LambdaQueryWrapper<ManageEmployeeInfoDO> builderOneWrapper(ManageEmployeeWrapper ewrap){ private LambdaQueryWrapper<ManageEmployeeInfoDO> builderOneWrapper(ManageEmployeeWrapper ewrap){
LambdaQueryWrapper<ManageEmployeeInfoDO> qw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ManageEmployeeInfoDO> qw = new LambdaQueryWrapper<>();
if (Objects.nonNull(ewrap.getId())){ if (Objects.nonNull(ewrap.getId())){
...@@ -75,6 +122,7 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao { ...@@ -75,6 +122,7 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao {
if (Objects.nonNull(ewrap.getEmployeeNo())){ if (Objects.nonNull(ewrap.getEmployeeNo())){
qw.eq(ManageEmployeeInfoDO::getEmployeeNo,ewrap.getEmployeeNo()); qw.eq(ManageEmployeeInfoDO::getEmployeeNo,ewrap.getEmployeeNo());
} }
qw.eq(ManageEmployeeInfoDO::getStatus,"0");
return qw; return qw;
} }
...@@ -89,6 +137,7 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao { ...@@ -89,6 +137,7 @@ public class ManageEmployeeInfoInfoDaoImpl implements ManageEmployeeInfoDao {
if (!CollectionUtils.isEmpty(ewrap.getEmployeeNos())){ if (!CollectionUtils.isEmpty(ewrap.getEmployeeNos())){
qw.in(ManageEmployeeInfoDO::getEmployeeNo,ewrap.getEmployeeNos()); qw.in(ManageEmployeeInfoDO::getEmployeeNo,ewrap.getEmployeeNos());
} }
qw.eq(ManageEmployeeInfoDO::getStatus,"0");
return qw; return qw;
} }
......
...@@ -8,8 +8,10 @@ import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao; ...@@ -8,8 +8,10 @@ import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao;
import com.wangxiaolu.promotion.domain.activity.mapper.TemporaryActivityClockMapper; import com.wangxiaolu.promotion.domain.activity.mapper.TemporaryActivityClockMapper;
import com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityClockDO; import com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityClockDO;
import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryClockWrapper; import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryClockWrapper;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.PageInfo; import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -41,7 +43,7 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao ...@@ -41,7 +43,7 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao
LambdaQueryWrapper<TemporaryActivityClockDO> qw = buildWrapper(tcw); LambdaQueryWrapper<TemporaryActivityClockDO> qw = buildWrapper(tcw);
Integer count = temporaryActivityClockMapper.selectCount(qw); Integer count = temporaryActivityClockMapper.selectCount(qw);
if (count > 0) { if (count > 0) {
return; throw new DataException(RCode.CLOCK_DETAIL_ERROR);
} }
TemporaryActivityClockDO clockDo = new TemporaryActivityClockDO(); TemporaryActivityClockDO clockDo = new TemporaryActivityClockDO();
...@@ -133,8 +135,11 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao ...@@ -133,8 +135,11 @@ public class TemporaryActivityClockDaoImpl implements TemporaryActivityClockDao
if (StringUtils.isNotBlank(tcw.getDeptQcId())){ if (StringUtils.isNotBlank(tcw.getDeptQcId())){
qw.eq(TemporaryActivityClockDO::getDeptQcId, tcw.getDeptQcId()); qw.eq(TemporaryActivityClockDO::getDeptQcId, tcw.getDeptQcId());
} }
if (StringUtils.isNotBlank(tcw.getChargerQcId())){ // if (StringUtils.isNotBlank(tcw.getChargerQcId())){
qw.eq(TemporaryActivityClockDO::getChargerQcId, tcw.getChargerQcId()); // qw.eq(TemporaryActivityClockDO::getChargerQcId, tcw.getChargerQcId());
// }
if (Objects.nonNull(tcw.getChargerId())){
qw.eq(TemporaryActivityClockDO::getChargerId, tcw.getChargerId());
} }
qw.eq(TemporaryActivityClockDO::getIsDelete, StatusType.VALID.getType()); qw.eq(TemporaryActivityClockDO::getIsDelete, StatusType.VALID.getType());
......
...@@ -63,6 +63,24 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao ...@@ -63,6 +63,24 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
} }
} }
@Override
public void saveReportedList(Integer temporaryId, Long reportedId, Integer photoType, List<String> urls) {
List<TemporaryActivityPhotoDO> dos = new ArrayList<>();
for (String url : urls) {
String[] uArr = url.split("/");
String uId = uArr[uArr.length - 1];
TemporaryActivityPhotoDO photoDo = new TemporaryActivityPhotoDO()
.setTemporaryId(temporaryId)
.setReportedId(reportedId)
.setType(photoType)
.setPhotoUrl(url)
.setPhotoFiledId(uId);
dos.add(photoDo);
}
temporaryActivityPhotoMapper.insertList(dos);
temporaryActivityPhotoMapper.updateListIsDelete(reportedId,photoType,dos);
}
/** /**
* 保存促销员上下班打卡图片 * 保存促销员上下班打卡图片
*/ */
...@@ -111,6 +129,11 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao ...@@ -111,6 +129,11 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
return groupPhoto; return groupPhoto;
} }
@Override
public void deleteList(Long reportedId, int type) {
temporaryActivityPhotoMapper.deletebyReportedId(reportedId,type);
}
/** /**
* 活动上报图片查询 * 活动上报图片查询
...@@ -172,8 +195,6 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao ...@@ -172,8 +195,6 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
if (!Objects.isNull(pw.getReportedId())) { if (!Objects.isNull(pw.getReportedId())) {
wq.eq(TemporaryActivityPhotoDO::getReportedId,pw.getReportedId()); wq.eq(TemporaryActivityPhotoDO::getReportedId,pw.getReportedId());
} }
return wq; return wq;
} }
......
...@@ -2,7 +2,6 @@ package com.wangxiaolu.promotion.domain.activity.dao.impl; ...@@ -2,7 +2,6 @@ package com.wangxiaolu.promotion.domain.activity.dao.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.druid.util.StringUtils; import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wangxiaolu.promotion.common.enums.StatusType; import com.wangxiaolu.promotion.common.enums.StatusType;
...@@ -52,7 +51,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport ...@@ -52,7 +51,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport
} }
/** /**
* 分查询数据 * 分查询数据
*/ */
@Override @Override
public void findPage(TemporaryActivityWrapper taw, PageInfo pageInfo) { public void findPage(TemporaryActivityWrapper taw, PageInfo pageInfo) {
...@@ -105,8 +104,11 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport ...@@ -105,8 +104,11 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport
if (!StringUtils.isEmpty(tw.getApproveStatus())) { if (!StringUtils.isEmpty(tw.getApproveStatus())) {
queryWrapper.eq(TemporaryActivityReportedDO::getApproveStatus, tw.getApproveStatus()); queryWrapper.eq(TemporaryActivityReportedDO::getApproveStatus, tw.getApproveStatus());
} }
if (!StringUtils.isEmpty(tw.getApproverId())) { // if (!StringUtils.isEmpty(tw.getApproverId())) {
queryWrapper.eq(TemporaryActivityReportedDO::getApproverId, tw.getApproverId()); // queryWrapper.eq(TemporaryActivityReportedDO::getApproverId, tw.getApproverId());
// }
if (Objects.nonNull(tw.getManageId())) {
queryWrapper.eq(TemporaryActivityReportedDO::getManageId, tw.getManageId());
} }
if (!StringUtils.isEmpty(tw.getDeptQcId())) { if (!StringUtils.isEmpty(tw.getDeptQcId())) {
queryWrapper.eq(TemporaryActivityReportedDO::getDeptQcId, tw.getDeptQcId()); queryWrapper.eq(TemporaryActivityReportedDO::getDeptQcId, tw.getDeptQcId());
...@@ -123,7 +125,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport ...@@ -123,7 +125,7 @@ public class TemporaryActivityReportedDaoImpl implements TemporaryActivityReport
if (!StringUtils.isEmpty(tw.getCity())) { if (!StringUtils.isEmpty(tw.getCity())) {
queryWrapper.eq(TemporaryActivityReportedDO::getCity, tw.getCity()); queryWrapper.eq(TemporaryActivityReportedDO::getCity, tw.getCity());
} }
if (Objects.nonNull(tw.getCreateDateStart()) && Objects.nonNull(tw.getCreateDateEnd())) { if (tw.rangeDate()) {
queryWrapper.between(TemporaryActivityReportedDO::getCreateTime, tw.getCreateDateStart(), tw.getCreateDateEnd()); queryWrapper.between(TemporaryActivityReportedDO::getCreateTime, tw.getCreateDateStart(), tw.getCreateDateEnd());
} }
if (!StringUtils.isEmpty(tw.getStoreNameLike())){ if (!StringUtils.isEmpty(tw.getStoreNameLike())){
......
...@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.activity.mapper; ...@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.activity.mapper;
import com.wangxiaolu.promotion.domain.activity.mapper.entity.ManageEmployeeInfoDO; import com.wangxiaolu.promotion.domain.activity.mapper.entity.ManageEmployeeInfoDO;
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,19 @@ import org.springframework.stereotype.Repository; ...@@ -16,6 +17,19 @@ import org.springframework.stereotype.Repository;
public interface ManageEmployeeInfoMapper extends BaseMapper<ManageEmployeeInfoDO> { public interface ManageEmployeeInfoMapper extends BaseMapper<ManageEmployeeInfoDO> {
ManageEmployeeInfoDO selectToLogin(String employeeNo); ManageEmployeeInfoDO selectToLogin(String employeeNo);
void insertOne(ManageEmployeeInfoDO eDo);
void addPrivilege(@Param("empId") Integer empId,@Param("privilegeId") Integer privilegeId);
Integer hasByEmpNo(String employeeNo);
void updateByEmployeeNo(@Param("employeeNo") String employeeNo,@Param("status") String status);
void updatePrivilege(@Param("employeeNo") String employeeNo,@Param("privilegeId") Integer privilegeId);
boolean isOneSelf(@Param("employeeNo") String employeeNo);
boolean isAuth(@Param("employeeNo") String employeeNo);
} }
......
...@@ -3,8 +3,11 @@ package com.wangxiaolu.promotion.domain.activity.mapper; ...@@ -3,8 +3,11 @@ package com.wangxiaolu.promotion.domain.activity.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityPhotoDO; import com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityPhotoDO;
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;
import java.util.List;
/** /**
* @author a02200059 * @author a02200059
* @description 针对表【temporary_activity_photo】的数据库操作Mapper * @description 针对表【temporary_activity_photo】的数据库操作Mapper
...@@ -15,6 +18,12 @@ import org.springframework.stereotype.Repository; ...@@ -15,6 +18,12 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface TemporaryActivityPhotoMapper extends BaseMapper<TemporaryActivityPhotoDO> { public interface TemporaryActivityPhotoMapper extends BaseMapper<TemporaryActivityPhotoDO> {
void updateIsDelete(Long reportedId, String photoFiledId); void updateIsDelete(Long reportedId, String photoFiledId);
void insertList(@Param("dos") List<TemporaryActivityPhotoDO> dos);
void updateListIsDelete(@Param("reportedId") Long reportedId,@Param("photoType") Integer photoType,@Param("dos") List<TemporaryActivityPhotoDO> dos);
void deletebyReportedId(@Param("reportedId") Long reportedId,@Param("photoType") int type);
} }
......
...@@ -52,6 +52,10 @@ public class ManageEmployeeInfoDO implements Serializable { ...@@ -52,6 +52,10 @@ public class ManageEmployeeInfoDO implements Serializable {
* 部门信息-勤策部门名称 * 部门信息-勤策部门名称
*/ */
private String deptQcName; private String deptQcName;
/**
* 0正常 1停用
*/
private String status;
/** /**
* 备注,不过超过100字 * 备注,不过超过100字
......
...@@ -42,9 +42,9 @@ public class TemporaryActivityClockDO implements Serializable { ...@@ -42,9 +42,9 @@ public class TemporaryActivityClockDO implements Serializable {
private String dealerName; private String dealerName;
/** /**
* qince_clientele_store表qc_id * activity_plan_info表id
*/ */
private String storeQcId; private Long planId;
private Long storeId; private Long storeId;
...@@ -60,7 +60,8 @@ public class TemporaryActivityClockDO implements Serializable { ...@@ -60,7 +60,8 @@ public class TemporaryActivityClockDO implements Serializable {
private String deptQcOrgName; private String deptQcOrgName;
private String chargerQcId; // private String chargerQcId;
private Integer chargerId;
private String chargerName; private String chargerName;
......
...@@ -37,10 +37,14 @@ public class TemporaryActivityReportedDO implements Serializable { ...@@ -37,10 +37,14 @@ public class TemporaryActivityReportedDO implements Serializable {
/** /**
* 关联—活动店铺id * 关联—活动店铺id
*/ */
private String storeQcId; // private String storeQcId;
private Long storeId; // private Long storeId;
/**
* activity_plan_info表id
*/
private Long planId;
private String lineName; private String lineName;
/** /**
...@@ -76,16 +80,25 @@ public class TemporaryActivityReportedDO implements Serializable { ...@@ -76,16 +80,25 @@ public class TemporaryActivityReportedDO implements Serializable {
private String deptQcId; private String deptQcId;
private String deptQcOrgName; private String deptQcOrgName;
// /**
// * 关联—审核人员qc_id
// */
// private String approverId;
//
// /**
// * 关联—审核人员姓名
// */
// private String approveName;
/** /**
* 关联—审核人员qc_id * 管理员id
*
*/ */
private String approverId; private Integer manageId;
/** /**
* 关联—审核人员姓名 * 管理员姓名
*/ */
private String approveName; private String manageName;
/** /**
* 审批状态(审批中、审批通过、退回……) * 审批状态(审批中、审批通过、退回……)
* 关联enum类 TemActApproveStatus * 关联enum类 TemActApproveStatus
......
...@@ -26,4 +26,5 @@ public class ManageEmployeeWrapper { ...@@ -26,4 +26,5 @@ public class ManageEmployeeWrapper {
private Set<String> employeeNos; private Set<String> employeeNos;
private boolean hasDeptQcId; private boolean hasDeptQcId;
private boolean statusIsNull;
} }
package com.wangxiaolu.promotion.domain.activity.wrapperQo; package com.wangxiaolu.promotion.domain.activity.wrapperQo;
import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -53,7 +54,10 @@ public class TemporaryActivityWrapper { ...@@ -53,7 +54,10 @@ public class TemporaryActivityWrapper {
* 关联—审核人员(负责人)的战区、user * 关联—审核人员(负责人)的战区、user
*/ */
private String deptQcId; private String deptQcId;
private String approverId;
// private String approverId;
private Integer manageId;
/** /**
* 不查询的审批状态(审批中、审批通过、退回……) * 不查询的审批状态(审批中、审批通过、退回……)
...@@ -62,4 +66,14 @@ public class TemporaryActivityWrapper { ...@@ -62,4 +66,14 @@ public class TemporaryActivityWrapper {
private String notApproveStatus; private String notApproveStatus;
private String storeNameLike; private String storeNameLike;
public Date getCreateDateEnd() {
String format = DateUtil.format(this.createDateEnd, "yyyy-MM-dd 23:59:59");
this.createDateEnd = DateUtil.parse(format);
return this.createDateEnd;
}
public boolean rangeDate(){
return this.createDateStart != null && this.createDateEnd != null;
}
} }
...@@ -50,5 +50,5 @@ public class TemporaryClockWrapper { ...@@ -50,5 +50,5 @@ public class TemporaryClockWrapper {
private String createDateEnd; private String createDateEnd;
private String nameLike; private String nameLike;
private String deptQcId; private String deptQcId;
private String chargerQcId; private Integer chargerId;
} }
package com.wangxiaolu.promotion.domain.activityplanv2.dao;
import com.alibaba.fastjson.JSONArray;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import java.util.Date;
import java.util.List;
/**
* @author : liqiulin
* @date : 2025-02-06 11
* @describe :
*/
public interface ActivityPlanInfoDao {
void saveList(JSONArray table, Long recordId);
void page(PageInfo pageInfo, ActivityPlanInfoWrapper wrapper);
ActivityPlanInfoDto selectPlan(String storeCode, Date date);
void deleteByPlanIds(List<Long> planIds, String employeeNo);
void updateList(JSONArray table, Long recordId);
ActivityPlanInfoDto selectById(Long id);
void updateById(ActivityPlanInfoDto planDto);
void save(ActivityPlanInfoDto planDto);
List<ActivityPlanInfoDto> findClockList(ActivityPlanInfoWrapper wrapper);
void updatePlanStatus(Long planId, PlanStatus planStatus);
}
package com.wangxiaolu.promotion.domain.activityplanv2.dao;
import com.alibaba.fastjson.JSONObject;
/**
* @author : liqiulin
* @date : 2025-02-06 11
* @describe :
*/
public interface ActivityPlanRecordDao {
Long save(JSONObject record);
}
package com.wangxiaolu.promotion.domain.activityplanv2.dao.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wangxiaolu.promotion.common.enums.StatusType;
import com.wangxiaolu.promotion.common.util.BeanUtils;
import com.wangxiaolu.promotion.domain.activityplanv2.dao.ActivityPlanInfoDao;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.ActivityPlanInfoMapper;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfoDo;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.exceptions.PersistenceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalTime;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author : liqiulin
* @date : 2025-02-06 11
* @describe :
*/
@Service
public class ActivityPlanInfoDaoImpl implements ActivityPlanInfoDao {
@Autowired
private ActivityPlanInfoMapper activityPlanInfoMapper;
@Override
public void saveList(JSONArray table, Long recordId) {
try {
activityPlanInfoMapper.saveList(table, recordId);
} catch (PersistenceException e) {
throw new DataException(RCode.ACTIVITY_PLAN_REPETITION_ERROR);
}
}
@Override
public void updateList(JSONArray table, Long recordId) {
try {
// 将table中的数据转换为ActivityPlanInfoDo
for (int i = 0; i < table.size(); i++) {
ActivityPlanInfoDo pdo = table.getObject(i, ActivityPlanInfoDo.class);
activityPlanInfoMapper.updateOne(pdo, recordId);
}
} catch (PersistenceException e) {
throw new DataException(RCode.ACTIVITY_PLAN_REPETITION_ERROR);
}
}
@Override
public ActivityPlanInfoDto selectById(Long id) {
ActivityPlanInfoDo activityPlanInfoDo = activityPlanInfoMapper.selectById(id);
return BeanUtils.transitionDto(activityPlanInfoDo, ActivityPlanInfoDto.class);
}
@Override
public void updateById(ActivityPlanInfoDto planDto) {
ActivityPlanInfoDo planDo = BeanUtils.transitionDto(planDto, ActivityPlanInfoDo.class);
activityPlanInfoMapper.updateById(planDo);
}
@Override
public void save(ActivityPlanInfoDto planDto) {
try {
ActivityPlanInfoDo planDo = new ActivityPlanInfoDo();
BeanUtils.copyProperties(planDto, planDo);
activityPlanInfoMapper.insert(planDo);
} catch (PersistenceException e) {
throw new DataException(RCode.ACTIVITY_PLAN_REPETITION_ERROR);
}
}
@Override
public List<ActivityPlanInfoDto> findClockList(ActivityPlanInfoWrapper wrapper) {
List<ActivityPlanInfoDo> activityPlanInfoDos = activityPlanInfoMapper.findClockList(wrapper);
return BeanUtils.transitionDtos(activityPlanInfoDos, ActivityPlanInfoDto.class);
}
@Override
public void updatePlanStatus(Long planId, PlanStatus planStatus) {
activityPlanInfoMapper.updatePlanStatus(planId,planStatus.getCode());
}
@Override
public void page(PageInfo pageInfo, ActivityPlanInfoWrapper wrapper) {
LambdaQueryWrapper<ActivityPlanInfoDo> qw = buildWrapper(wrapper);
Page<ActivityPlanInfoDo> page = new Page<>(pageInfo.getPageNum(), pageInfo.getPageSize());
Page<ActivityPlanInfoDo> doPage = activityPlanInfoMapper.selectPage(page, qw);
pageInfo.pageCovert(doPage);
pageInfo.setRecords(doPage.getRecords());
}
@Override
public ActivityPlanInfoDto selectPlan(String storeCode, Date date) {
ActivityPlanInfoDo activityPlanInfoDo = activityPlanInfoMapper.selectPlan(storeCode, date);
return BeanUtils.transitionDto(activityPlanInfoDo, ActivityPlanInfoDto.class);
}
@Override
public void deleteByPlanIds(List<Long> planIds, String employeeNo) {
// 判断ID中是否包含之前数据、非个人数据
Integer count = activityPlanInfoMapper.selectNotDelCount(planIds,employeeNo);
if (count > 0 ) {
throw new DataException(RCode.ACTIVITY_PLAN_NOT_SELF_DELETE);
}
Integer countToday = activityPlanInfoMapper.selectTodayCount(planIds);
// 今日数据存在时,判断当前时间是否在今日10点前
if (countToday > 0 && (LocalTime.now().getHour() >= 10)) {
throw new DataException(RCode.ACTIVITY_PLAN_NOT_DELETE);
}
activityPlanInfoMapper.updateIsDelete(planIds);
}
private LambdaQueryWrapper<ActivityPlanInfoDo> buildWrapper(ActivityPlanInfoWrapper wrapper) {
LambdaQueryWrapper<ActivityPlanInfoDo> qw = new LambdaQueryWrapper<>();
if (wrapper.rangeDate()){
qw.between(ActivityPlanInfoDo::getDate, wrapper.getActivityStartDate(), wrapper.getActivityEndDate());
}
if (Objects.nonNull(wrapper.getActivityDate())){
qw.eq(ActivityPlanInfoDo::getDate, wrapper.getActivityDate());
}
if (Objects.nonNull(wrapper.getEmployeeId())) {
qw.eq(ActivityPlanInfoDo::getEmployeeId, wrapper.getEmployeeId());
}
if (StringUtils.isNotBlank(wrapper.getProvince())) {
qw.eq(ActivityPlanInfoDo::getProvince, wrapper.getProvince());
}
if (StringUtils.isNotBlank(wrapper.getCity())) {
qw.eq(ActivityPlanInfoDo::getCity, wrapper.getCity());
}
if (StringUtils.isNotBlank(wrapper.getArea())) {
qw.eq(ActivityPlanInfoDo::getArea, wrapper.getArea());
}
if (StringUtils.isNotBlank(wrapper.getDealerId())) {
qw.eq(ActivityPlanInfoDo::getDealerId, wrapper.getDealerId());
}
if (Objects.nonNull(wrapper.getPlanStatus())) {
qw.eq(ActivityPlanInfoDo::getPlanStatus, wrapper.getPlanStatus().getCode());
}
if (StringUtils.isNotBlank(wrapper.getOrgQcId())){
qw.eq(ActivityPlanInfoDo::getOrgQcId, wrapper.getOrgQcId());
}
if (StringUtils.isNotBlank(wrapper.getStoreNameLike())) {
qw.like(ActivityPlanInfoDo::getStoreName, wrapper.getStoreNameLike());
}
qw.eq(ActivityPlanInfoDo::getIsDelete, StatusType.VALID.getType());
qw.orderByDesc(ActivityPlanInfoDo::getDate)
.orderByAsc(ActivityPlanInfoDo::getPlanStatus)
.orderByDesc(ActivityPlanInfoDo::getClockInTime);
if (Objects.nonNull(wrapper.getLimitNum())){
qw.last(" limit "+wrapper.getLimitNum());
}
return qw;
}
}
package com.wangxiaolu.promotion.domain.activityplanv2.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.domain.activityplanv2.dao.ActivityPlanRecordDao;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.ActivityPlanRecordMapper;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanRecordDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author : liqiulin
* @date : 2025-02-06 11
* @describe :
*/
@Service
public class ActivityPlanRecordDaoImpl implements ActivityPlanRecordDao {
@Autowired
private ActivityPlanRecordMapper activityPlanRecordMapper;
@Override
public Long save(JSONObject record) {
ActivityPlanRecordDo activityPlanRecordDo = JSONObject.parseObject(record.toJSONString(), ActivityPlanRecordDo.class);
activityPlanRecordMapper.insert(activityPlanRecordDo);
return activityPlanRecordDo.getId();
}
}
package com.wangxiaolu.promotion.domain.activityplanv2.mapper;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* @author a02200059
* @description 针对表【activity_plan_info(活动计划列表)】的数据库操作Mapper
* @createDate 2025-01-21 14:41:08
* @Entity com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanInfo
*/
@Mapper
@Repository
public interface ActivityPlanInfoMapper extends BaseMapper<ActivityPlanInfoDo> {
void saveList(@Param("table") JSONArray table,@Param("recordId") Long recordId);
ActivityPlanInfoDo selectPlan(String storeCode, Date date);
void updateIsDelete(List<Long> planIds);
Integer selectNotDelCount(@Param("planIds") List<Long> planIds,@Param("employeeNo") String employeeNo);
void updateOne(@Param("pDo") ActivityPlanInfoDo pDo,@Param("recordId") Long recordId);
Integer selectTodayCount(List<Long> planIds);
void updatePlanStatus(@Param("id") Long planId, @Param("status") Integer status);
List<ActivityPlanInfoDo> findClockList(ActivityPlanInfoWrapper wrapper);
}
package com.wangxiaolu.promotion.domain.activityplanv2.mapper;
import com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanRecordDo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* @author a02200059
* @description 针对表【activity_plan_record(活动计划店铺excel导入记录)】的数据库操作Mapper
* @createDate 2025-02-05 11:51:57
* @Entity com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity.ActivityPlanRecord
*/
@Mapper
@Repository
public interface ActivityPlanRecordMapper extends BaseMapper<ActivityPlanRecordDo> {
}
package com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;
/**
* 活动计划列表
* @TableName activity_plan_info
*/
@TableName(value ="activity_plan_info")
@Data
public class ActivityPlanInfoDo implements Serializable {
/**
* 主键id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 活动计划表上传记录id
*/
private Long planFileId;
/**
* promotion_manage_employee表id
*/
private Integer employeeId;
/**
* 姓名
*/
private String employeeName;
/**
* 员工工号
*/
private String employeeNo;
/**
* 年份
*/
private Integer year;
/**
* 月份
*/
private Integer month;
/**
* 日期
*/
private Date date;
/**
* 系统名称
*/
private String lineName;
/**
* 门店名称
*/
private String storeName;
/**
* 门店编码
*/
private String storeCode;
/**
* 战区-勤策ID
*/
private String orgQcId;
/**
* 战区名称
*/
private String orgName;
/**
* 活动模式id
*/
private Integer patternId;
/**
* 活动模式
*/
private String pattern;
/**
* 经销商编码
*/
private String dealerId;
/**
* 经销商名称
*/
private String dealerName;
/**
* 是否双T门店
*/
private String bothT;
/**
* 门店所属行政区域-省份名称,如:北京市、江苏省
*/
private String province;
/**
* 门店所属行政区域-城市名称,如:南京市
*/
private String city;
/**
* 门店所属行政区域-区县名称,如:鼓楼区
*/
private String area;
/**
* 门店所在地址
*/
private String addr;
/**
* 上班时间
*/
private LocalDateTime clockInTime;
/**
* 下班时间
*/
private LocalDateTime clockOutTime;
/**
* 工资
*/
private BigDecimal salary;
/**
* 杂费
*/
private BigDecimal incidentals;
/**
* 是否执行:1:执行;0:未执行;
*/
private Integer planStatus;
/**
*
*/
private Date createTime;
/**
*
*/
private Date modifyTime;
/**
* 1:有效;0:删除;
*/
private Integer isDelete;
/**
* 创建人
*/
private String createBy;
/**
* 最近修改人
*/
private String modifyBy;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.wangxiaolu.promotion.domain.activityplanv2.mapper.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 活动计划店铺excel导入记录
* @TableName activity_plan_record
*/
@TableName(value ="activity_plan_record")
@Data
public class ActivityPlanRecordDo implements Serializable {
/**
* 主键id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* promotion_manage_employee表id
*/
private Integer employeeId;
/**
* 姓名
*/
private String employeeName;
/**
* 员工工号
*/
private String employeeNo;
/**
* 文件http地址
*/
private String excelUrl;
/**
* 文件ID(云存储中的id)
*/
private String excelFiledId;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date modifyTime;
/**
* 1:有效;0:删除;
*/
private Integer isDelete;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.wangxiaolu.promotion.domain.manage.wrapperQo; package com.wangxiaolu.promotion.domain.manage.wrapperQo;
import cn.hutool.core.date.DateUtil;
import com.wangxiaolu.promotion.common.enums.StatusType; import com.wangxiaolu.promotion.common.enums.StatusType;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -45,11 +47,23 @@ public class ActivityPlanInfoWrapper { ...@@ -45,11 +47,23 @@ public class ActivityPlanInfoWrapper {
*/ */
private Date activityStartDate; private Date activityStartDate;
/**
* 活动结束日期
*/
private Date activityEndDate;
/**
* 省
*/
private String province;
/** /**
* 城市 * 城市
*/ */
private String city; private String city;
private String area;
/** /**
* 经销商编码 * 经销商编码
*/ */
...@@ -61,6 +75,12 @@ public class ActivityPlanInfoWrapper { ...@@ -61,6 +75,12 @@ public class ActivityPlanInfoWrapper {
private String storeName; private String storeName;
private String storeNameLike; private String storeNameLike;
private String qinceStoreCode; private String qinceStoreCode;
private String StoreCode;
/**
* 部门勤策编码
*/
private String orgQcId;
/** /**
* 经销商名称 * 经销商名称
...@@ -70,7 +90,13 @@ public class ActivityPlanInfoWrapper { ...@@ -70,7 +90,13 @@ public class ActivityPlanInfoWrapper {
/** /**
* 活动状态 * 活动状态
*/ */
private StatusType activityStatus; private StatusType activityStatus;
/**
* 活动计划状态
* 是否执行:1:执行;0:未执行;
*/
private PlanStatus planStatus;
private List<Long> ids; private List<Long> ids;
...@@ -83,4 +109,17 @@ public class ActivityPlanInfoWrapper { ...@@ -83,4 +109,17 @@ public class ActivityPlanInfoWrapper {
*/ */
private Integer activityPatternId; private Integer activityPatternId;
private String activityPattern; private String activityPattern;
private Date activityDate;
private Integer limitNum;
public Date getActivityEndDate() {
String format = DateUtil.format(this.activityEndDate, "yyyy-MM-dd 23:59:59");
return DateUtil.parse(format);
}
public boolean rangeDate() {
return this.activityStartDate != null && this.activityEndDate != null;
}
} }
...@@ -24,4 +24,7 @@ public interface QinCeEmployeeDao { ...@@ -24,4 +24,7 @@ public interface QinCeEmployeeDao {
QinCeEmployeeDto selectOntByQcId(String qcId); QinCeEmployeeDto selectOntByQcId(String qcId);
List<QinCeEmployeeDto> getEmployeeList(EmployeeWrapper ew); List<QinCeEmployeeDto> getEmployeeList(EmployeeWrapper ew);
QinCeEmployeeDto getEmployeeOne(EmployeeWrapper ew);
Integer count(EmployeeWrapper ew);
} }
...@@ -26,4 +26,6 @@ public interface TemporaryInfoDao { ...@@ -26,4 +26,6 @@ public interface TemporaryInfoDao {
void findPage(TemporaryWrapper tw, PageInfo pageInfo); void findPage(TemporaryWrapper tw, PageInfo pageInfo);
void updateById(WxTemporaryInfoDto temporaryDto); void updateById(WxTemporaryInfoDto temporaryDto);
WxTemporaryInfoDto selectByPhone(String phone);
} }
...@@ -52,6 +52,7 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao { ...@@ -52,6 +52,7 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
qinCeShopDO.setDealersName(dealers.get(0).getString("dealer_name")); qinCeShopDO.setDealersName(dealers.get(0).getString("dealer_name"));
qinCeShopDO.setDealerId(dealers.get(0).getString("dealer_code")); qinCeShopDO.setDealerId(dealers.get(0).getString("dealer_code"));
} }
qinCeShopDO.setExt();
qw.eq(QinCeClienteleStoreDO::getQcId, qinCeShopDO.getQcId()); qw.eq(QinCeClienteleStoreDO::getQcId, qinCeShopDO.getQcId());
QinCeClienteleStoreDO doExist = qinCeClienteleStoreMapper.selectOne(qw); QinCeClienteleStoreDO doExist = qinCeClienteleStoreMapper.selectOne(qw);
...@@ -81,9 +82,13 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao { ...@@ -81,9 +82,13 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
LambdaQueryWrapper<QinCeClienteleStoreDO> qw = builderQueryWrapper(storeWrapper); LambdaQueryWrapper<QinCeClienteleStoreDO> qw = builderQueryWrapper(storeWrapper);
// 指定字段查询 // 指定字段查询
qw.select(QinCeClienteleStoreDO::getQcId, qw.select(QinCeClienteleStoreDO::getQcId,
QinCeClienteleStoreDO::getStoreCode,
QinCeClienteleStoreDO::getStoreName, QinCeClienteleStoreDO::getStoreName,
QinCeClienteleStoreDO::getDealerId,
QinCeClienteleStoreDO::getDealersName,
QinCeClienteleStoreDO::getLineName,
QinCeClienteleStoreDO::getStoreAddr) QinCeClienteleStoreDO::getStoreAddr)
.last(" limit 100"); .last(" limit 50");
List<QinCeClienteleStoreDO> qinCeClienteleStoreDOS = qinCeClienteleStoreMapper.selectList(qw); List<QinCeClienteleStoreDO> qinCeClienteleStoreDOS = qinCeClienteleStoreMapper.selectList(qw);
List<QinCeClienteleStoreDto> storeDtos = transitionDtos(qinCeClienteleStoreDOS); List<QinCeClienteleStoreDto> storeDtos = transitionDtos(qinCeClienteleStoreDOS);
...@@ -96,9 +101,14 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao { ...@@ -96,9 +101,14 @@ public class QinCeClienteleStoreDaoImpl implements QinCeClienteleStoreDao {
// 指定字段查询 // 指定字段查询
qw.select(QinCeClienteleStoreDO::getQcId, qw.select(QinCeClienteleStoreDO::getQcId,
QinCeClienteleStoreDO::getStoreName, QinCeClienteleStoreDO::getStoreName,
QinCeClienteleStoreDO::getStoreAddr,
QinCeClienteleStoreDO::getDealersName, QinCeClienteleStoreDO::getDealersName,
QinCeClienteleStoreDO::getDealerId); QinCeClienteleStoreDO::getDealerId,
QinCeClienteleStoreDO::getLineName,
QinCeClienteleStoreDO::getStoreMssProvince,
QinCeClienteleStoreDO::getStoreMssCity,
QinCeClienteleStoreDO::getStoreMssArea,
QinCeClienteleStoreDO::getStoreAddr
);
QinCeClienteleStoreDO qinCeClienteleStoreDO = qinCeClienteleStoreMapper.selectOne(qw); QinCeClienteleStoreDO qinCeClienteleStoreDO = qinCeClienteleStoreMapper.selectOne(qw);
return transitionDto(qinCeClienteleStoreDO); return transitionDto(qinCeClienteleStoreDO);
......
...@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.user.dao.impl; ...@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.domain.user.dao.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wangxiaolu.promotion.common.enums.StatusType;
import com.wangxiaolu.promotion.domain.user.dao.QinCeEmployeeDao; import com.wangxiaolu.promotion.domain.user.dao.QinCeEmployeeDao;
import com.wangxiaolu.promotion.domain.user.mapper.QinceEmployeeMapper; import com.wangxiaolu.promotion.domain.user.mapper.QinceEmployeeMapper;
import com.wangxiaolu.promotion.domain.user.mapper.entity.QinCeDepartmentDO; import com.wangxiaolu.promotion.domain.user.mapper.entity.QinCeDepartmentDO;
...@@ -75,18 +76,34 @@ public class QinCeEmployeeDaoImpl implements QinCeEmployeeDao { ...@@ -75,18 +76,34 @@ public class QinCeEmployeeDaoImpl implements QinCeEmployeeDao {
return transitionDtos(qinCeEmployeeDOS); return transitionDtos(qinCeEmployeeDOS);
} }
@Override
public QinCeEmployeeDto getEmployeeOne(EmployeeWrapper ew) {
LambdaQueryWrapper<QinCeEmployeeDO> qw = buildWrapper(ew);
QinCeEmployeeDO qinCeEmployeeDO = qinceEmployeeMapper.selectOne(qw);
return transitionDto(qinCeEmployeeDO);
}
@Override
public Integer count(EmployeeWrapper ew) {
LambdaQueryWrapper<QinCeEmployeeDO> qw = buildWrapper(ew);
return qinceEmployeeMapper.selectCount(qw);
}
private LambdaQueryWrapper<QinCeEmployeeDO> buildWrapper(EmployeeWrapper ew){ private LambdaQueryWrapper<QinCeEmployeeDO> buildWrapper(EmployeeWrapper ew){
LambdaQueryWrapper<QinCeEmployeeDO> qw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<QinCeEmployeeDO> qw = new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(ew.getWaiqin365OrgId())){ if (StringUtils.isNotBlank(ew.getWaiqin365OrgId())){
qw.eq(QinCeEmployeeDO::getWaiqin365OrgId,ew.getWaiqin365OrgId()); qw.eq(QinCeEmployeeDO::getWaiqin365OrgId,ew.getWaiqin365OrgId());
} }
if (StringUtils.isNotBlank(ew.getEmpCode())){
qw.eq(QinCeEmployeeDO::getEmpCode,ew.getEmpCode());
}
if (StringUtils.isNotBlank(ew.getEmpName())){ if (StringUtils.isNotBlank(ew.getEmpName())){
qw.like(QinCeEmployeeDO::getEmpName,ew.getEmpName()); qw.like(QinCeEmployeeDO::getEmpName,ew.getEmpName());
} }
if (StringUtils.isNotBlank(ew.getQcId())){ if (StringUtils.isNotBlank(ew.getQcId())){
qw.eq(QinCeEmployeeDO::getQcId,ew.getQcId()); qw.eq(QinCeEmployeeDO::getQcId,ew.getQcId());
} }
qw.eq(QinCeEmployeeDO::getEmpStatus,1); qw.eq(QinCeEmployeeDO::getEmpStatus, StatusType.VALID.getType());
qw.last("limit 50"); qw.last("limit 50");
return qw; return qw;
} }
......
...@@ -86,6 +86,14 @@ public class TemporaryInfoDaoImpl implements TemporaryInfoDao { ...@@ -86,6 +86,14 @@ public class TemporaryInfoDaoImpl implements TemporaryInfoDao {
temporaryInfoMapper.updateById(entity); temporaryInfoMapper.updateById(entity);
} }
@Override
public WxTemporaryInfoDto selectByPhone(String phone) {
TemporaryWrapper tw = new TemporaryWrapper().setPhone(phone);
LambdaQueryWrapper<TemporaryInfoDO> doqwer = buildQueryList(tw);
TemporaryInfoDO temDo = temporaryInfoMapper.selectOne(doqwer);
return transitionDto(temDo);
}
private LambdaQueryWrapper<TemporaryInfoDO> buildQueryList(TemporaryWrapper tw) { private LambdaQueryWrapper<TemporaryInfoDO> buildQueryList(TemporaryWrapper tw) {
LambdaQueryWrapper<TemporaryInfoDO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TemporaryInfoDO> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(tw.getOpenId())) { if (StringUtils.isNotBlank(tw.getOpenId())) {
......
...@@ -5,13 +5,12 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -5,13 +5,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.util.List;
/** /**
* 勤策-客户管理-终端 * 勤策-客户管理-终端
* @TableName qc_clientele_shop * @TableName qc_clientele_shop
...@@ -78,12 +77,6 @@ public class QinCeClienteleStoreDO implements Serializable { ...@@ -78,12 +77,6 @@ public class QinCeClienteleStoreDO implements Serializable {
@JsonProperty("store_dept_waiqin365_id") @JsonProperty("store_dept_waiqin365_id")
private String storeDeptWaiqin365Id; private String storeDeptWaiqin365Id;
/**
* 门店所属部门,来源第三方系统的唯一标识和部门信息中org_id对应
*/
@JsonProperty("store_dept_id")
private String storeDeptId;
/** /**
* 门店部门名称 * 门店部门名称
*/ */
...@@ -192,6 +185,15 @@ public class QinCeClienteleStoreDO implements Serializable { ...@@ -192,6 +185,15 @@ public class QinCeClienteleStoreDO implements Serializable {
@JsonProperty("store_approval_status") @JsonProperty("store_approval_status")
private String storeApprovalStatus; private String storeApprovalStatus;
/**
* 系统名称
*/
private String lineName;
/**
* 是否双T门店
*/
private String bothT;
/** /**
* 经销商名称 * 经销商名称
*/ */
...@@ -202,6 +204,14 @@ public class QinCeClienteleStoreDO implements Serializable { ...@@ -202,6 +204,14 @@ public class QinCeClienteleStoreDO implements Serializable {
@JsonProperty("dealers") @JsonProperty("dealers")
private List<JSONObject> dealers; private List<JSONObject> dealers;
/**
* "store_ext_key": "系统名称",
* "store_ext_value": "永辉超市"
*/
@TableField(exist = false)
@JsonProperty("exts")
private List<Exts> exts;
/** /**
* 门店删除状态。0:删除,1:正常 * 门店删除状态。0:删除,1:正常
*/ */
...@@ -216,4 +226,23 @@ public class QinCeClienteleStoreDO implements Serializable { ...@@ -216,4 +226,23 @@ public class QinCeClienteleStoreDO implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Data
public class Exts{
@JsonProperty("store_ext_key")
private String storeExtKey;
@JsonProperty("store_ext_value")
private String storeExtValue;
}
public void setExt() {
for (Exts e : exts) {
if ("系统名称".equals(e.getStoreExtKey())) {
this.lineName = e.getStoreExtValue();
}
if ("是否双T门店".equals(e.getStoreExtKey())) {
this.bothT = e.getStoreExtValue();
}
}
}
} }
\ No newline at end of file
...@@ -24,6 +24,7 @@ public class EmployeeWrapper { ...@@ -24,6 +24,7 @@ public class EmployeeWrapper {
private String waiqin365OrgId; private String waiqin365OrgId;
private String qcId; private String qcId;
private String empName; private String empName;
private String empCode;
/** /**
* 员工账号状态。0:销户,1:正常,2:停用 * 员工账号状态。0:销户,1:正常,2:停用
......
package com.wangxiaolu.promotion.enums.plan;
/**
* @author : liqiulin
* @date : 2025-02-14 13
* @describe :
*/
public enum OperationType {
/**
* up:新增
* put:修改
*/
UP("UP", "新增"),
PUT("PUT", "修改");
private final String code;
private final String desc;
OperationType(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
}
package com.wangxiaolu.promotion.enums.plan;
/**
* @author : liqiulin
* @date : 2025-02-12 17
* @describe :
*/
public enum PlanStatus {
/**
* 是否执行:1:执行;0:未执行;
*/
EXECUTION(1, "执行"),
NOT_EXECUTION(0, "未执行");
private final Integer code;
private final String desc;
PlanStatus(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
}
...@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor; ...@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author : liqiulin * @author : liqiulin
...@@ -35,27 +36,13 @@ public class ActivityPlanVo { ...@@ -35,27 +36,13 @@ public class ActivityPlanVo {
* 文件http地址 * 文件http地址
*/ */
private String excelUrl; private String excelUrl;
/**
* 活动月份YYYY-MM
*/
// private String activityMonth;
/** private String excelId;
* 月份第几周
*/
// private Integer monthWeekNumber;
/**
* 月结束日期
*/
// private Date monthStartDate;
/**
* 月结束日期
*/
// private Date monthEndDate;
private Integer originalEmpId; private Integer originalEmpId;
private Integer transferEmpId; private Integer transferEmpId;
private Long planId;
private List<Long> planIds;
} }
package com.wangxiaolu.promotion.pojo.activity.planv2.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;
/**
* 活动计划
*/
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Data
public class ActivityPlanInfoDto implements Serializable {
/**
* 主键id
*/
private Long id;
/**
* 活动计划表上传记录id
*/
private Long planFileId;
/**
* promotion_manage_employee表id
*/
private Integer employeeId;
/**
* 姓名
*/
private String employeeName;
/**
* 员工工号
*/
private String employeeNo;
/**
* 年份
*/
private Integer year;
/**
* 月份
*/
private Integer month;
/**
* 日期
*/
private Date date;
/**
* 系统名称
*/
private String lineName;
/**
* 门店名称
*/
private String storeName;
/**
* 门店编码
*/
private String storeCode;
/**
* 战区-勤策ID
*/
private String orgQcId;
/**
* 战区名称
*/
private String orgName;
/**
* 活动模式id
*/
private Integer patternId;
/**
* 活动模式
*/
private String pattern;
/**
* 经销商编码
*/
private String dealerId;
/**
* 经销商名称
*/
private String dealerName;
/**
* 是否双T门店
*/
private String bothT;
/**
* 门店所属行政区域-省份名称,如:北京市、江苏省
*/
private String province;
/**
* 门店所属行政区域-城市名称,如:南京市
*/
private String city;
/**
* 门店所属行政区域-区县名称,如:鼓楼区
*/
private String area;
/**
* 门店所在地址
*/
private String addr;
/**
* 上班时间
*/
private LocalDateTime clockInTime;
/**
* 下班时间
*/
private LocalDateTime clockOutTime;
/**
* 工资
*/
private BigDecimal salary;
/**
* 杂费
*/
private BigDecimal incidentals;
/**
* 是否执行:1:执行;0:未执行;
*/
private Integer planStatus;
private Integer index;
private Date createTime;
/**
* 当前行错误,不可保存
* 错误信息
*/
private String errorMsg;
/**
* 操作人
*/
// private Long createId;
private String createBy;
private String modifyBy;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
public void setErrorMsg(String errorMsg) {
if (Objects.isNull(this.errorMsg)) {
this.errorMsg = errorMsg;
} else {
this.errorMsg += errorMsg;
}
}
}
\ No newline at end of file
package com.wangxiaolu.promotion.pojo.activity.planv2.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 活动计划店铺excel导入记录
*/
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Data
public class ActivityPlanRecordDto implements Serializable {
/**
* 主键id
*/
private Long id;
/**
* promotion_manage_employee表id
*/
private Integer employeeId;
/**
* 姓名
*/
private String employeeName;
/**
* 员工工号
*/
private String employeeNo;
/**
* 文件http地址
*/
private String excelUrl;
/**
* 文件ID(云存储中的id)
*/
private String excelFiledId;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date modifyTime;
/**
* 1:有效;0:删除;
*/
private Integer isDelete;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.wangxiaolu.promotion.pojo.activity.planv2.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author : liqiulin
* @date : 2025-02-17 13
* @describe :
*/
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Data
public class ActivityPlanOperVo {
/**
* 主键id
*/
private Long id;
/**
* 计划归属人
*/
private String employeeNo;
/**
* 操作人
*/
// private Long operId;
private String operName;
private String operNo;
/**
* 日期
*/
private Date date;
/**
* 门店编码
*/
private String storeCode;
/**
* 活动模式
*/
private String pattern;
/**
* 上班时间
*/
private LocalDateTime clockInTime;
/**
* 下班时间
*/
private LocalDateTime clockOutTime;
/**
* 工资
*/
private BigDecimal salary;
/**
* 杂费
*/
private BigDecimal incidentals;
}
...@@ -35,7 +35,10 @@ public class TemporaryActivityReportedDto { ...@@ -35,7 +35,10 @@ public class TemporaryActivityReportedDto {
private String temporaryName; private String temporaryName;
private String dealerName; private String dealerName;
/**
* activity_plan_info表id
*/
private Long planId;
/** /**
* 关联—活动店铺id * 关联—活动店铺id
*/ */
...@@ -76,16 +79,26 @@ public class TemporaryActivityReportedDto { ...@@ -76,16 +79,26 @@ public class TemporaryActivityReportedDto {
private String deptQcId; private String deptQcId;
private String deptQcOrgName; private String deptQcOrgName;
/** // /**
* 关联—审核人员qc_id // * 关联—审核人员qc_id
// *
// */
// private String approverId;
//
// /**
// * 关联—审核人员姓名
// */
// private String approveName;
/**
* 管理员id
* *
*/ */
private String approverId; private Integer manageId;
/** /**
* 关联—审核人员姓名 * 管理员姓名
*/ */
private String approveName; private String manageName;
/** /**
* 审批状态(审批中、审批通过、退回……) * 审批状态(审批中、审批通过、退回……)
......
...@@ -31,6 +31,8 @@ public class TemporaryClockDto { ...@@ -31,6 +31,8 @@ public class TemporaryClockDto {
String temporaryName; String temporaryName;
Long planId;
/** /**
* 关联活动上报id * 关联活动上报id
*/ */
...@@ -52,7 +54,9 @@ public class TemporaryClockDto { ...@@ -52,7 +54,9 @@ public class TemporaryClockDto {
String deptQcOrgName; String deptQcOrgName;
String chargerQcId; // String chargerQcId;
Integer chargerId;
String chargerName; String chargerName;
......
...@@ -26,8 +26,15 @@ public class TemporaryActivityPlanVo { ...@@ -26,8 +26,15 @@ public class TemporaryActivityPlanVo {
*/ */
private String city; private String city;
/**
* 区
*/
private String area;
/** /**
* 店铺名称 * 店铺名称
*/ */
private String storeName; private String storeName;
private String storeNameLike;
} }
...@@ -43,6 +43,11 @@ public class TemporaryClockVo { ...@@ -43,6 +43,11 @@ public class TemporaryClockVo {
String temporaryName; String temporaryName;
/**
* 促销计划ID
*/
Long planId;
// 店铺id - 活动计划中的id // 店铺id - 活动计划中的id
Long storeId; Long storeId;
......
...@@ -15,15 +15,14 @@ import lombok.experimental.Accessors; ...@@ -15,15 +15,14 @@ import lombok.experimental.Accessors;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class QinCeClienteleStoreDto { public class QinCeClienteleStoreDto {
/**
* 勤策的门店唯一ID
*/
private String qcId; private String qcId;
private String storeCode;
private String storeName; private String storeName;
private String storeAddr;
private String dealersName; private String dealersName;
private String dealerId; private String dealerId;
private String lineName;
private String storeMssProvince;
private String storeMssCity;
private String storeMssArea;
private String storeAddr;
} }
...@@ -23,6 +23,8 @@ public class ClienteleStoreQueryVo { ...@@ -23,6 +23,8 @@ public class ClienteleStoreQueryVo {
*/ */
private String storeNameVague; private String storeNameVague;
private String storeCode;
/** /**
* 默认查询有效数据 * 默认查询有效数据
* 门店删除状态。0:删除,1:正常:store_status = 1 * 门店删除状态。0:删除,1:正常:store_status = 1
......
...@@ -8,8 +8,6 @@ import lombok.NoArgsConstructor; ...@@ -8,8 +8,6 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.validation.constraints.NotBlank;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-03-28 18 * @date : 2024-03-28 18
...@@ -24,8 +22,25 @@ public class UserLoginParam { ...@@ -24,8 +22,25 @@ public class UserLoginParam {
String loginName; String loginName;
String password; String password;
/**
* 1, 'oneself', '个人权限'
* 2, 'admin', '超管权限'
*/
Integer privilegeId;
/**
* 0正常 1停用
*/
private String status;
public void validate(){ public void validate(){
if (StringUtils.isBlank(loginName) || StringUtils.isBlank(password)){ if (StringUtils.isAnyBlank(loginName,password)){
throw new ParamException(RCode.LOGIN_PARAM_ERROR,null);
}
}
public void valLoginName(){
if (StringUtils.isBlank(loginName)){
throw new ParamException(RCode.LOGIN_PARAM_ERROR,null); throw new ParamException(RCode.LOGIN_PARAM_ERROR,null);
} }
} }
......
...@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.service.activity.manage; ...@@ -3,6 +3,7 @@ package com.wangxiaolu.promotion.service.activity.manage;
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.activity.manage.vo.ActivityPlanInfoVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityPlanVo;
/** /**
* @author : liqiulin * @author : liqiulin
......
...@@ -10,5 +10,7 @@ import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; ...@@ -10,5 +10,7 @@ import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
public interface EmployeeCoreTemClockService { public interface EmployeeCoreTemClockService {
void updateClockactivityPattern(TemporaryClockDto temporaryClockDto); void updateClockactivityPattern(TemporaryClockDto temporaryClockDto);
void deleteClockById(long id); Long deleteClockById(long id);
Long deleteClockByReportedId(long reportedId);
} }
...@@ -6,6 +6,7 @@ import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper; ...@@ -6,6 +6,7 @@ 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.activity.manage.vo.ActivityPlanInfoVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanInfoVo;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityPlanVo;
import com.wangxiaolu.promotion.service.activity.manage.ActivityPlanInfoQueryService; import com.wangxiaolu.promotion.service.activity.manage.ActivityPlanInfoQueryService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package com.wangxiaolu.promotion.service.activity.manage.impl; package com.wangxiaolu.promotion.service.activity.manage.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.wangxiaolu.promotion.common.excel.FileUtils;
import com.wangxiaolu.promotion.common.excel.ReadExcelUtils; import com.wangxiaolu.promotion.common.excel.ReadExcelUtils;
import com.wangxiaolu.promotion.common.redis.RedisKeys; import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache; import com.wangxiaolu.promotion.common.redis.service.RedisCache;
...@@ -82,7 +83,7 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore ...@@ -82,7 +83,7 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
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();
downloadExcel(activityPlanVo.getExcelUrl(), filePath); FileUtils.downloadExcel(activityPlanVo.getExcelUrl(), filePath);
// 读取 // 读取
List<EmployeeActivityPlanInfoDto> planInfoDtos = readSheet0(filePath, activityPlanVo, planDto); List<EmployeeActivityPlanInfoDto> planInfoDtos = readSheet0(filePath, activityPlanVo, planDto);
...@@ -90,21 +91,21 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore ...@@ -90,21 +91,21 @@ public class ActivityPlanRecordCoreServiceImpl implements ActivityPlanRecordCore
employeeActivityPlanInfoDao.saveList(planInfoDtos); employeeActivityPlanInfoDao.saveList(planInfoDtos);
} }
private void downloadExcel(String urlStr, String filePath) throws Exception { // private void downloadExcel(String urlStr, String filePath) throws Exception {
// 保存文件 // // 保存文件
URL url = new URL(urlStr); // URL url = new URL(urlStr);
URLConnection urlConnection = url.openConnection(); // URLConnection urlConnection = url.openConnection();
InputStream inputStream = urlConnection.getInputStream(); // InputStream inputStream = urlConnection.getInputStream();
FileOutputStream fileOutputStream = new FileOutputStream(filePath); // FileOutputStream fileOutputStream = new FileOutputStream(filePath);
// 调大小 // // 调大小
byte[] buffer = new byte[102400]; // byte[] buffer = new byte[102400];
int bytesRead; // int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) { // while ((bytesRead = inputStream.read(buffer)) != -1) {
fileOutputStream.write(buffer, 0, bytesRead); // fileOutputStream.write(buffer, 0, bytesRead);
} // }
fileOutputStream.close(); // fileOutputStream.close();
inputStream.close(); // inputStream.close();
} // }
private List<EmployeeActivityPlanInfoDto> readSheet0(String filePath, ActivityPlanVo activityPlanVo, EmployeeActivityPlanRecordDto planDto) throws Exception { private List<EmployeeActivityPlanInfoDto> readSheet0(String filePath, ActivityPlanVo activityPlanVo, EmployeeActivityPlanRecordDto planDto) throws Exception {
// 1、解析表格数据 // 1、解析表格数据
......
...@@ -63,7 +63,6 @@ public class EmployeeCoreTemActivityServiceImpl implements EmployeeCoreTemActivi ...@@ -63,7 +63,6 @@ public class EmployeeCoreTemActivityServiceImpl implements EmployeeCoreTemActivi
tempActivityLogDao.save(reportedDto.getTemporaryId(), reportedDto.getTemporaryName(), logType, temActDto.getId(), temActDto); tempActivityLogDao.save(reportedDto.getTemporaryId(), reportedDto.getTemporaryName(), logType, temActDto.getId(), temActDto);
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void deleteById(long id) { public void deleteById(long id) {
// 查询记录判断是否存在 // 查询记录判断是否存在
......
...@@ -4,6 +4,7 @@ import com.wangxiaolu.promotion.common.enums.StatusType; ...@@ -4,6 +4,7 @@ import com.wangxiaolu.promotion.common.enums.StatusType;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityClockDao;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityPhotoDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityPhotoDao;
import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao; import com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityReportedDao;
import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryClockWrapper;
import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryPhotoWrapper; import com.wangxiaolu.promotion.domain.activity.wrapperQo.TemporaryPhotoWrapper;
import com.wangxiaolu.promotion.exception.DataException; import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryActivityReportedDto;
...@@ -53,13 +54,28 @@ public class EmployeeCoreTemClockServiceImpl implements EmployeeCoreTemClockServ ...@@ -53,13 +54,28 @@ public class EmployeeCoreTemClockServiceImpl implements EmployeeCoreTemClockServ
} }
@Override @Override
public void deleteClockById(long id) { public Long deleteClockById(long id) {
// 查询打卡记录并删除 // 查询打卡记录并删除
TemporaryClockDto clockDto = temporaryActivityClockDao.selectById(id); TemporaryClockDto clockDto = temporaryActivityClockDao.selectById(id);
if (Objects.isNull(clockDto)){ if (Objects.isNull(clockDto)){
throw new DataException(RCode.CLOCK_DATA_NOT_HAVE_ERROR); throw new DataException(RCode.CLOCK_DATA_NOT_HAVE_ERROR);
} }
return deleteClock(clockDto);
}
@Override
public Long deleteClockByReportedId(long reportedId) {
// 查询打卡记录并删除
TemporaryClockWrapper tcw = new TemporaryClockWrapper();
tcw.setReportedId(reportedId);
TemporaryClockDto clockDto = temporaryActivityClockDao.selectOne(tcw);
if (Objects.isNull(clockDto)){
throw new DataException(RCode.CLOCK_DATA_NOT_HAVE_ERROR);
}
return deleteClock(clockDto);
}
private Long deleteClock(TemporaryClockDto clockDto){
TemporaryClockDto updateClockDto = new TemporaryClockDto(); TemporaryClockDto updateClockDto = new TemporaryClockDto();
updateClockDto.setId(clockDto.getId()).setIsDelete(StatusType.INVALID.getType()); updateClockDto.setId(clockDto.getId()).setIsDelete(StatusType.INVALID.getType());
temporaryActivityClockDao.updateById(updateClockDto); temporaryActivityClockDao.updateById(updateClockDto);
...@@ -69,6 +85,7 @@ public class EmployeeCoreTemClockServiceImpl implements EmployeeCoreTemClockServ ...@@ -69,6 +85,7 @@ public class EmployeeCoreTemClockServiceImpl implements EmployeeCoreTemClockServ
tpw.setTemporaryId(clockDto.getTemporaryId()) tpw.setTemporaryId(clockDto.getTemporaryId())
.setClockId(clockDto.getId()); .setClockId(clockDto.getId());
temporaryActivityPhotoDao.updateStatus(tpw,StatusType.INVALID.getType()); temporaryActivityPhotoDao.updateStatus(tpw,StatusType.INVALID.getType());
return clockDto.getPlanId();
} }
} }
...@@ -26,4 +26,6 @@ public interface TemporaryActivityClockCoreService { ...@@ -26,4 +26,6 @@ public interface TemporaryActivityClockCoreService {
void updateClockPhoto(TemporaryClockDto dto); void updateClockPhoto(TemporaryClockDto dto);
void updateById(TemporaryClockDto clockDtoUpdate); void updateById(TemporaryClockDto clockDtoUpdate);
void clockInTodayPlan(TemporaryClockDto dto, Integer clockType);
} }
...@@ -10,12 +10,16 @@ import com.wangxiaolu.promotion.domain.manage.dao.EmployeeActivityPlanInfoDao; ...@@ -10,12 +10,16 @@ import com.wangxiaolu.promotion.domain.manage.dao.EmployeeActivityPlanInfoDao;
import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType; import com.wangxiaolu.promotion.enums.activity.ActivityPhotoType;
import com.wangxiaolu.promotion.enums.activity.ClockType; import com.wangxiaolu.promotion.enums.activity.ClockType;
import com.wangxiaolu.promotion.enums.activity.LogType; import com.wangxiaolu.promotion.enums.activity.LogType;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.exception.ParamException; import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanInfoDto; import com.wangxiaolu.promotion.pojo.activity.manage.dto.EmployeeActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto; import com.wangxiaolu.promotion.pojo.activity.temporary.dto.TemporaryClockDto;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto; import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode; import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockCoreService; import com.wangxiaolu.promotion.service.activity.temporary.TemporaryActivityClockCoreService;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanCoreService;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanQueryService;
import com.wangxiaolu.promotion.utils.OkHttp; import com.wangxiaolu.promotion.utils.OkHttp;
import com.wangxiaolu.promotion.utils.QinCeUtils; import com.wangxiaolu.promotion.utils.QinCeUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -38,7 +42,7 @@ import java.util.Objects; ...@@ -38,7 +42,7 @@ import java.util.Objects;
public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityClockCoreService { public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityClockCoreService {
@Autowired @Autowired
QinCeUtils qinCeUtils; private QinCeUtils qinCeUtils;
@Autowired @Autowired
private TemporaryActivityClockDao temporaryActivityClockDao; private TemporaryActivityClockDao temporaryActivityClockDao;
@Autowired @Autowired
...@@ -49,34 +53,38 @@ public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityC ...@@ -49,34 +53,38 @@ public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityC
private ManageEmployeeInfoDao manageEmployeeInfoDao; private ManageEmployeeInfoDao manageEmployeeInfoDao;
@Autowired @Autowired
private TemporaryActivityLogDao tempActivityLogDao; private TemporaryActivityLogDao tempActivityLogDao;
@Autowired
private PromPlanQueryService promPlanQueryService;
@Autowired
private PromPlanCoreService promPlanCoreService;
/** /**
* 促销员当日打卡信息保存 * 促销员当日打卡信息保存
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void clockInTodayActivity(TemporaryClockDto dto, Integer clockType) { public void clockInTodayActivity(TemporaryClockDto dto, Integer clockType) {
if (Objects.isNull(dto.getId())) { // if (Objects.isNull(dto.getId())) {
// 补充信息 // // 补充信息
EmployeeActivityPlanInfoDto planInfoDto = employeeActivityPlanInfoDao.selectById(dto.getStoreId()); // EmployeeActivityPlanInfoDto planInfoDto = employeeActivityPlanInfoDao.selectById(dto.getStoreId());
ManageEmployeeInfoDto employeeDto = manageEmployeeInfoDao.selectById(planInfoDto.getEmployeeId()); // ManageEmployeeInfoDto employeeDto = manageEmployeeInfoDao.selectById(planInfoDto.getEmployeeId());
//
dto.setLineName(planInfoDto.getLineName()) // dto.setLineName(planInfoDto.getLineName())
.setDeptQcId(employeeDto.getDeptQcId()) // .setDeptQcId(employeeDto.getDeptQcId())
.setDeptQcOrgName(employeeDto.getDeptQcName()) // .setDeptQcOrgName(employeeDto.getDeptQcName())
.setChargerQcId(employeeDto.getQcId()) // .setChargerQcId(employeeDto.getQcId())
.setChargerName(employeeDto.getName()) // .setChargerName(employeeDto.getName())
.setActivityPatternId(planInfoDto.getActivityPatternId()) // .setActivityPatternId(planInfoDto.getActivityPatternId())
.setActivityPattern(planInfoDto.getActivityPattern()) // .setActivityPattern(planInfoDto.getActivityPattern())
.setDealerName(planInfoDto.getDealerName()) // .setDealerName(planInfoDto.getDealerName())
.setQinceStoreCode(planInfoDto.getQinceStoreCode()); // .setQinceStoreCode(planInfoDto.getQinceStoreCode());
temporaryActivityClockDao.save(dto); // temporaryActivityClockDao.save(dto);
} else { // } else {
temporaryActivityClockDao.updateById(dto); // temporaryActivityClockDao.updateById(dto);
} // }
// 根据ID保存图片 // // 根据ID保存图片
saveClockPhoto(dto, clockType); // saveClockPhoto(dto, clockType);
// 日志保存 // // 日志保存
tempActivityLogDao.save(dto.getTemporaryId(), dto.getTemporaryName(), LogType.t_1, dto.getId(), dto); // tempActivityLogDao.save(dto.getTemporaryId(), dto.getTemporaryName(), LogType.t_1, dto.getId(), dto);
} }
/** /**
...@@ -115,6 +123,37 @@ public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityC ...@@ -115,6 +123,37 @@ public class TemporaryActivityClockCoreServiceImpl implements TemporaryActivityC
temporaryActivityClockDao.updateById(clockDto); temporaryActivityClockDao.updateById(clockDto);
} }
@Transactional(rollbackFor = Exception.class)
@Override
public void clockInTodayPlan(TemporaryClockDto dto, Integer clockType) {
if (Objects.isNull(dto.getId())) {
ActivityPlanInfoDto planInfo = promPlanQueryService.selectById(dto.getPlanId());
if (Objects.isNull(planInfo) || (planInfo.getPlanStatus().equals(PlanStatus.EXECUTION.getCode()) && planInfo.getPattern().equals("单点CP"))){
throw new ParamException(RCode.NOT_CLOCK_STORE_ERROR);
}
ManageEmployeeInfoDto employeeDto = manageEmployeeInfoDao.selectById(planInfo.getEmployeeId());
dto.setLineName(planInfo.getLineName())
.setDeptQcId(employeeDto.getDeptQcId())
.setDeptQcOrgName(employeeDto.getDeptQcName())
.setChargerId(employeeDto.getId())
.setChargerName(employeeDto.getName())
.setActivityPattern(planInfo.getPattern())
.setDealerName(planInfo.getDealerName())
.setStoreName(planInfo.getStoreName())
.setQinceStoreCode(planInfo.getStoreCode());
// 保存打卡记录
temporaryActivityClockDao.save(dto);
// 促销计划状态修改
promPlanCoreService.updatePlanStatus(dto.getPlanId(), PlanStatus.EXECUTION);
} else {
temporaryActivityClockDao.updateById(dto);
}
// 根据ID保存图片
saveClockPhoto(dto, clockType);
// 日志保存
// tempActivityLogDao.save(dto.getTemporaryId(), dto.getTemporaryName(), LogType.t_1, dto.getId(), dto);
}
private void clockStoreCalDistanceByStoreQcId(String storeQcId, String clockCoordinates) { private void clockStoreCalDistanceByStoreQcId(String storeQcId, String clockCoordinates) {
// 查询组织架构参数、创建url // 查询组织架构参数、创建url
String[] clockCoordinateArr = clockCoordinates.split(","); String[] clockCoordinateArr = clockCoordinates.split(",");
......
...@@ -64,13 +64,12 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -64,13 +64,12 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
* *
* @return 生成id * @return 生成id
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public long activityDataReportedSave(TemporaryActivityReportedDto temActDto) { public long activityDataReportedSave(TemporaryActivityReportedDto temActDto) {
// 判断是否已存在保存数据 // 判断是否已存在保存数据
TemporaryActivityReportedDto haveDate = temporaryActivityReportedDao.findOneByCurrentDate(temActDto.getTemporaryId()); TemporaryActivityReportedDto haveDate = temporaryActivityReportedDao.findOneByCurrentDate(temActDto.getTemporaryId());
if (Objects.nonNull(haveDate)) { if (Objects.nonNull(haveDate)) {
throw new FlowException(RCode.DATA_HAVE_ERROR, null); throw new FlowException(RCode.DATA_HAVE_ERROR);
} }
// 返回生成的活动id // 返回生成的活动id
...@@ -78,18 +77,14 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -78,18 +77,14 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
temActDto.setId(reportedId); temActDto.setId(reportedId);
// 保存图片 // 保存图片
saveActivityPhoto(temActDto); saveActivityPhotoV2(temActDto);
// 售卖单元新增保存 // 售卖单元新增保存
// String key = temMarketCellRedisKey(temActDto.getTemporaryId()); // String key = temMarketCellRedisKey(temActDto.getTemporaryId());
// temporaryActivityMarketCellDao.saveList(reportedId,redisCache.getToJsonArray(key)); // temporaryActivityMarketCellDao.saveList(reportedId,redisCache.getToJsonArray(key));
/**
* 日志保存
*/
tempActivityLogDao.save(temActDto.getTemporaryId(), temActDto.getTemporaryName(), LogType.t_2, temActDto.getId(), temActDto);
// redisCache.removeKey(key); // redisCache.removeKey(key);
// tempActivityLogDao.save(temActDto.getTemporaryId(), temActDto.getTemporaryName(), LogType.t_2, temActDto.getId(), temActDto);
return reportedId; return reportedId;
} }
...@@ -101,7 +96,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -101,7 +96,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
@Override @Override
public void activityDataReportedUpdate(TemporaryActivityReportedDto temActDto) { public void activityDataReportedUpdate(TemporaryActivityReportedDto temActDto) {
// 图片增量保存 // 图片增量保存
saveActivityPhoto(temActDto); saveActivityPhotoV2(temActDto);
temporaryActivityReportedDao.updateById(temActDto); temporaryActivityReportedDao.updateById(temActDto);
// 售卖单元新增保存 // 售卖单元新增保存
...@@ -109,7 +104,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -109,7 +104,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
// temporaryActivityMarketCellDao.saveList(temActDto.getId(),redisCache.getToJsonArray(key)); // temporaryActivityMarketCellDao.saveList(temActDto.getId(),redisCache.getToJsonArray(key));
// redisCache.removeKey(key); // redisCache.removeKey(key);
// 日志保存 // 日志保存
tempActivityLogDao.save(temActDto.getTemporaryId(), temActDto.getTemporaryName(), LogType.t_2, temActDto.getId(), temActDto); // tempActivityLogDao.save(temActDto.getTemporaryId(), temActDto.getTemporaryName(), LogType.t_2, temActDto.getId(), temActDto);
} }
/** /**
...@@ -136,7 +131,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -136,7 +131,7 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
temporaryActivityReportedDao.updateById(updateDto); temporaryActivityReportedDao.updateById(updateDto);
// 日志保存 // 日志保存
tempActivityLogDao.save(reportedDto.getTemporaryId(), reportedDto.getTemporaryName(), LogType.t_3, updateDto.getId(), updateDto); // tempActivityLogDao.save(reportedDto.getTemporaryId(), reportedDto.getTemporaryName(), LogType.t_3, updateDto.getId(), updateDto);
} }
@Override @Override
...@@ -238,26 +233,55 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe ...@@ -238,26 +233,55 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
* *
* @param temActDto 活动提交数据 * @param temActDto 活动提交数据
*/ */
private void saveActivityPhoto(TemporaryActivityReportedDto temActDto) { private void saveActivityPhotoV2(TemporaryActivityReportedDto temActDto) {
Integer temporaryId = temActDto.getTemporaryId(); Integer temporaryId = temActDto.getTemporaryId();
Long reportedId = temActDto.getId(); Long reportedId = temActDto.getId();
// 推广试吃照片 // 推广试吃照片
if (!CollectionUtils.isEmpty(temActDto.getTgscPhotoUrls())) { if (CollectionUtils.isEmpty(temActDto.getTgscPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGSC.getType(), temActDto.getTgscPhotoUrls(), temActDto.getTgscChangePhotoUrls()); tempActivityPhotoDao.deleteList(reportedId,ActivityPhotoType.TGSC.getType());
}else {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGSC.getType(), temActDto.getTgscPhotoUrls());
} }
// 推广互动照片 // 推广互动照片
if (!CollectionUtils.isEmpty(temActDto.getTghdPhotoUrls())) { if (CollectionUtils.isEmpty(temActDto.getTghdPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGHD.getType(), temActDto.getTghdPhotoUrls(), temActDto.getTghdChangePhotoUrls()); tempActivityPhotoDao.deleteList(reportedId,ActivityPhotoType.TGHD.getType());
}else {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGHD.getType(), temActDto.getTghdPhotoUrls());
} }
// 推广成交照片 // 推广成交照片
if (!CollectionUtils.isEmpty(temActDto.getTgcjPhotoUrls())) { if (CollectionUtils.isEmpty(temActDto.getTgcjPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGCJ.getType(), temActDto.getTgcjPhotoUrls(), temActDto.getTgcjChangePhotoUrls()); tempActivityPhotoDao.deleteList(reportedId,ActivityPhotoType.TGCJ.getType());
}else {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGCJ.getType(), temActDto.getTgcjPhotoUrls());
} }
// POS机页面凭证 // POS机页面凭证
if (!CollectionUtils.isEmpty(temActDto.getPsvPhotoUrls())) { // if (!CollectionUtils.isEmpty(temActDto.getPsvPhotoUrls())) {
tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.POS_SELL_VOUCHER.getType(), temActDto.getPsvPhotoUrls(), temActDto.getPsvChangePhotoUrls()); // tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.POS_SELL_VOUCHER.getType(), temActDto.getPsvPhotoUrls());
} // }
} }
// private void saveActivityPhoto(TemporaryActivityReportedDto temActDto) {
// Integer temporaryId = temActDto.getTemporaryId();
// Long reportedId = temActDto.getId();
// // 推广试吃照片
// if (!CollectionUtils.isEmpty(temActDto.getTgscPhotoUrls())) {
// tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGSC.getType(), temActDto.getTgscPhotoUrls(), temActDto.getTgscChangePhotoUrls());
// }
//
// // 推广互动照片
// if (!CollectionUtils.isEmpty(temActDto.getTghdPhotoUrls())) {
// tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGHD.getType(), temActDto.getTghdPhotoUrls(), temActDto.getTghdChangePhotoUrls());
// }
//
// // 推广成交照片
// if (!CollectionUtils.isEmpty(temActDto.getTgcjPhotoUrls())) {
// tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.TGCJ.getType(), temActDto.getTgcjPhotoUrls(), temActDto.getTgcjChangePhotoUrls());
// }
// // POS机页面凭证
// if (!CollectionUtils.isEmpty(temActDto.getPsvPhotoUrls())) {
// tempActivityPhotoDao.saveReportedList(temporaryId, reportedId, ActivityPhotoType.POS_SELL_VOUCHER.getType(), temActDto.getPsvPhotoUrls(), temActDto.getPsvChangePhotoUrls());
// }
// }
} }
package com.wangxiaolu.promotion.service.activityplanv2;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ActivityPlanVo;
import com.wangxiaolu.promotion.pojo.activity.planv2.vo.ActivityPlanOperVo;
import java.util.List;
import java.util.Map;
/**
* @author : liqiulin
* @date : 2025-01-21 13
* @describe :
*/
public interface PromPlanCoreService {
Map<String,Object> selfPlanUp(ActivityPlanVo activityPlanVo, String filePath) throws DataException;
void selfPlanAf(String planUuid);
void deletePlan(List<Long> planIds,String employeeNo);
Map<String, Object> authPlanUp(ActivityPlanVo activityPlanVo, String filePath) throws DataException;
Map<String, Object> selfPlanPut(ActivityPlanVo activityPlanVo, String filePath) throws DataException;
void putActivityPlan(ActivityPlanOperVo activityPlanOperVo);
void saveActivityPlan(ActivityPlanOperVo operVo);
void updatePlanStatus(Long planId, PlanStatus planStatus);
}
package com.wangxiaolu.promotion.service.activityplanv2;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityPlanVo;
import java.util.List;
/**
* @author : liqiulin
* @date : 2025-02-06 16
* @describe :
*/
public interface PromPlanQueryService {
void queryPage(PageInfo pageInfo);
List<ActivityPlanInfoDto> findClockList(TemporaryActivityPlanVo temporaryActivityPlanVo);
ActivityPlanInfoDto selectById(Long planId);
}
package com.wangxiaolu.promotion.service.activityplanv2.impl;
import com.alibaba.fastjson.JSONObject;
import com.wangxiaolu.promotion.domain.activityplanv2.dao.ActivityPlanInfoDao;
import com.wangxiaolu.promotion.domain.manage.wrapperQo.ActivityPlanInfoWrapper;
import com.wangxiaolu.promotion.enums.plan.PlanStatus;
import com.wangxiaolu.promotion.pojo.PageInfo;
import com.wangxiaolu.promotion.pojo.activity.planv2.dto.ActivityPlanInfoDto;
import com.wangxiaolu.promotion.pojo.activity.temporary.vo.TemporaryActivityPlanVo;
import com.wangxiaolu.promotion.service.activityplanv2.PromPlanQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
/**
* @author : liqiulin
* @date : 2025-02-06 16
* @describe :
*/
@Service
public class PromPlanQueryServiceImpl implements PromPlanQueryService {
@Autowired
private ActivityPlanInfoDao activityPlanInfoDao;
@Override
public void queryPage(PageInfo pageInfo) {
ActivityPlanInfoWrapper wrapper = JSONObject.parseObject(JSONObject.toJSONString(pageInfo.getQueryParams()), ActivityPlanInfoWrapper.class);
activityPlanInfoDao.page(pageInfo,wrapper);
}
/**
* 促销员查询
*/
@Override
public List<ActivityPlanInfoDto> findClockList(TemporaryActivityPlanVo temporaryActivityPlanVo) {
ActivityPlanInfoWrapper wrapper = JSONObject.parseObject(JSONObject.toJSONString(temporaryActivityPlanVo), ActivityPlanInfoWrapper.class);
wrapper.setActivityDate(Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant()));
wrapper.setPlanStatus(PlanStatus.NOT_EXECUTION);
wrapper.setLimitNum(50);
return activityPlanInfoDao.findClockList(wrapper);
}
@Override
public ActivityPlanInfoDto selectById(Long planId) {
return activityPlanInfoDao.selectById(planId);
}
}
package com.wangxiaolu.promotion.service.user; package com.wangxiaolu.promotion.service.user;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam; import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-05-29 13 * @date : 2025-01-13 14
* @describe : * @describe :
*/ */
public interface WangxlEmployeeQueryService { public interface ManageEmployeeCoreService {
void openAccount(UserLoginParam param);
LoginVo employeeLoginVerify(UserLoginParam userLoginParam); void putAccount(UserLoginParam param);
} }
...@@ -2,6 +2,8 @@ package com.wangxiaolu.promotion.service.user; ...@@ -2,6 +2,8 @@ package com.wangxiaolu.promotion.service.user;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto; import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import java.util.List; import java.util.List;
...@@ -11,8 +13,16 @@ import java.util.List; ...@@ -11,8 +13,16 @@ import java.util.List;
* @describe : * @describe :
*/ */
public interface ManageEmployeeQueryService { public interface ManageEmployeeQueryService {
LoginVo employeeLoginVerify(UserLoginParam userLoginParam);
ManageEmployeeInfoDto findOne(ManageEmployeeVo manageEmployeeVo); ManageEmployeeInfoDto findOne(ManageEmployeeVo manageEmployeeVo);
List<ManageEmployeeInfoDto> findList(ManageEmployeeVo manageEmployeeVo); List<ManageEmployeeInfoDto> findList(ManageEmployeeVo manageEmployeeVo);
boolean hasByEmpNo(String employeeNo);
boolean isOneSelf(String employeeNo);
boolean isAuth(String employeeNo);
} }
package com.wangxiaolu.promotion.service.user.impl;
import com.wangxiaolu.promotion.domain.activity.dao.ManageEmployeeInfoDao;
import com.wangxiaolu.promotion.domain.user.dao.QinCeEmployeeDao;
import com.wangxiaolu.promotion.domain.user.wrapperQo.EmployeeWrapper;
import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.activity.temporary.dto.QinCeEmployeeDto;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.user.ManageEmployeeCoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
* @author : liqiulin
* @date : 2025-01-13 14
* @describe :
*/
@Service
public class ManageEmployeeCoreServiceImpl implements ManageEmployeeCoreService {
@Autowired
ManageEmployeeInfoDao manageEmployeeInfoDao;
@Autowired
QinCeEmployeeDao qinCeEmployeeDao;
@Override
public void openAccount(UserLoginParam param) {
// 判断账号在勤策中是否存在
int count = qinCeEmployeeDao.count(new EmployeeWrapper().setEmpCode(param.getLoginName()));
if (count <= 0){
throw new DataException(RCode.QC_USER_IS_NULL_ERROR);
}
manageEmployeeInfoDao.openAccount(param.getLoginName(),param.getPrivilegeId());
}
/**
* 修改账号的状态,权限
*/
@Override
public void putAccount(UserLoginParam param) {
manageEmployeeInfoDao.updateAccount(param.getLoginName(), param.getPrivilegeId(), param.getStatus());
}
}
package com.wangxiaolu.promotion.service.user.impl; package com.wangxiaolu.promotion.service.user.impl;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.JwtUtils;
import com.wangxiaolu.promotion.domain.activity.dao.ManageEmployeeInfoDao; import com.wangxiaolu.promotion.domain.activity.dao.ManageEmployeeInfoDao;
import com.wangxiaolu.promotion.domain.activity.wrapperQo.ManageEmployeeWrapper; import com.wangxiaolu.promotion.domain.activity.wrapperQo.ManageEmployeeWrapper;
import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo; import com.wangxiaolu.promotion.pojo.activity.manage.vo.ManageEmployeeVo;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto; import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import com.wangxiaolu.promotion.service.user.ManageEmployeeQueryService; import com.wangxiaolu.promotion.service.user.ManageEmployeeQueryService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,10 +23,22 @@ import java.util.List; ...@@ -18,10 +23,22 @@ import java.util.List;
*/ */
@Service @Service
public class ManageEmployeeQueryServiceImpl implements ManageEmployeeQueryService { public class ManageEmployeeQueryServiceImpl implements ManageEmployeeQueryService {
@Autowired
RedisCache redisCache;
@Autowired
JwtUtils jwtUtils;
@Autowired @Autowired
ManageEmployeeInfoDao manageEmployeeInfoDao; ManageEmployeeInfoDao manageEmployeeInfoDao;
@Override
public LoginVo employeeLoginVerify(UserLoginParam userLoginParam) {
ManageEmployeeInfoDto employeeDto = manageEmployeeInfoDao.loginByEmployeeNo(userLoginParam.getLoginName(),userLoginParam.getPassword());
String loginToken = jwtUtils.getEmployeeToken(userLoginParam.getLoginName(), userLoginParam.getPassword());
redisCache.addToJsonToMinute(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey()+loginToken,employeeDto,360);
LoginVo loginVo = new LoginVo<>(employeeDto,loginToken);
return loginVo;
}
@Override @Override
public ManageEmployeeInfoDto findOne(ManageEmployeeVo manageEmployeeVo) { public ManageEmployeeInfoDto findOne(ManageEmployeeVo manageEmployeeVo) {
ManageEmployeeWrapper ewrap = new ManageEmployeeWrapper(); ManageEmployeeWrapper ewrap = new ManageEmployeeWrapper();
...@@ -35,4 +52,19 @@ public class ManageEmployeeQueryServiceImpl implements ManageEmployeeQueryServic ...@@ -35,4 +52,19 @@ public class ManageEmployeeQueryServiceImpl implements ManageEmployeeQueryServic
BeanUtils.copyProperties(manageEmployeeVo,wrap); BeanUtils.copyProperties(manageEmployeeVo,wrap);
return manageEmployeeInfoDao.selectList(wrap); return manageEmployeeInfoDao.selectList(wrap);
} }
@Override
public boolean hasByEmpNo(String employeeNo) {
return manageEmployeeInfoDao.hasByEmpNo(employeeNo);
}
@Override
public boolean isOneSelf(String employeeNo) {
return manageEmployeeInfoDao.isOneSelf(employeeNo);
}
@Override
public boolean isAuth(String employeeNo) {
return manageEmployeeInfoDao.isAuth(employeeNo);
}
} }
package com.wangxiaolu.promotion.service.user.impl;
import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.JwtUtils;
import com.wangxiaolu.promotion.domain.activity.dao.ManageEmployeeInfoDao;
import com.wangxiaolu.promotion.pojo.user.dto.ManageEmployeeInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.pojo.user.vo.UserLoginParam;
import com.wangxiaolu.promotion.service.user.WangxlEmployeeQueryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author : liqiulin
* @date : 2024-05-29 13
* @describe :
*/
@Service
@Slf4j
public class WangxlEmployeeQueryServiceImpl implements WangxlEmployeeQueryService {
@Autowired
RedisCache redisCache;
@Autowired
JwtUtils jwtUtils;
@Autowired
ManageEmployeeInfoDao manageEmployeeInfoDao;
@Override
public LoginVo employeeLoginVerify(UserLoginParam userLoginParam) {
ManageEmployeeInfoDto employeeDto = manageEmployeeInfoDao.loginByEmployeeNo(userLoginParam.getLoginName(),userLoginParam.getPassword());
String loginToken = jwtUtils.getEmployeeToken(userLoginParam.getLoginName(), userLoginParam.getPassword());
redisCache.addToJsonToMinute(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey()+loginToken,employeeDto,360);
LoginVo loginVo = new LoginVo<>(employeeDto,loginToken);
return loginVo;
}
}
package com.wangxiaolu.promotion.service.wechat; package com.wangxiaolu.promotion.service.wechat;
import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo; import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
/** /**
...@@ -11,4 +10,6 @@ import com.wangxiaolu.promotion.pojo.user.vo.LoginVo; ...@@ -11,4 +10,6 @@ import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
public interface WeChatUserQueryService { public interface WeChatUserQueryService {
LoginVo loginTemporaryByOpenIdAndPhone(String openId, String phone); LoginVo loginTemporaryByOpenIdAndPhone(String openId, String phone);
LoginVo temporaryLoginByPhone(String phone);
} }
package com.wangxiaolu.promotion.service.wechat.impl; package com.wangxiaolu.promotion.service.wechat.impl;
import com.alibaba.fastjson.JSONObject; import cn.hutool.core.lang.UUID;
import com.wangxiaolu.promotion.common.constant.TokenConstants;
import com.wangxiaolu.promotion.common.redis.RedisKeys; import com.wangxiaolu.promotion.common.redis.RedisKeys;
import com.wangxiaolu.promotion.common.redis.service.RedisCache; import com.wangxiaolu.promotion.common.redis.service.RedisCache;
import com.wangxiaolu.promotion.common.util.JwtTokenUtils;
import com.wangxiaolu.promotion.common.util.JwtUtils;
import com.wangxiaolu.promotion.domain.user.dao.TemporaryInfoDao; import com.wangxiaolu.promotion.domain.user.dao.TemporaryInfoDao;
import com.wangxiaolu.promotion.exception.DataException; import com.wangxiaolu.promotion.exception.DataException;
import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto; import com.wangxiaolu.promotion.pojo.user.dto.WxTemporaryInfoDto;
import com.wangxiaolu.promotion.pojo.user.vo.LoginVo; import com.wangxiaolu.promotion.pojo.user.vo.LoginVo;
import com.wangxiaolu.promotion.result.basedata.RCode; import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService; import com.wangxiaolu.promotion.service.wechat.WeChatUserQueryService;
import com.wangxiaolu.promotion.common.util.JwtUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,7 +29,6 @@ import java.util.Objects; ...@@ -27,7 +29,6 @@ import java.util.Objects;
@Service @Service
public class WeChatUserQueryServiceImpl implements WeChatUserQueryService { public class WeChatUserQueryServiceImpl implements WeChatUserQueryService {
private static final Logger log = LoggerFactory.getLogger(WeChatUserQueryServiceImpl.class);
@Autowired @Autowired
TemporaryInfoDao temporaryInfoDao; TemporaryInfoDao temporaryInfoDao;
@Autowired @Autowired
...@@ -50,8 +51,39 @@ public class WeChatUserQueryServiceImpl implements WeChatUserQueryService { ...@@ -50,8 +51,39 @@ public class WeChatUserQueryServiceImpl implements WeChatUserQueryService {
throw new DataException(RCode.LOGIN_PHONE_PARAM_ERROR); throw new DataException(RCode.LOGIN_PHONE_PARAM_ERROR);
} }
String temporaryToken = jwtUtils.getTemporaryToken(openId, phone);
redisCache.addToJsonToMinute(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + temporaryToken, temDto, 360); String token = UUID.fastUUID().toString();
// Jwt存储信息
Map<String, Object> claimsMap = new HashMap<String, Object>();
claimsMap.put(TokenConstants.USER_KEY, token);
claimsMap.put(TokenConstants.DETAILS_USER_ID, temDto.getId());
claimsMap.put(TokenConstants.DETAILS_USERNAME, temDto.getName());
String temporaryToken = JwtTokenUtils.createToken(claimsMap);
// String temporaryToken = jwtUtils.getTemporaryToken(openId, phone);
redisCache.addToJsonToMinute(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + token, temDto, 1080);
LoginVo loginVo = new LoginVo(temDto, temporaryToken);
return loginVo;
}
@Override
public LoginVo temporaryLoginByPhone(String phone) {
WxTemporaryInfoDto temDto = temporaryInfoDao.selectByPhone(phone);
if (Objects.isNull(temDto)) {
throw new DataException(RCode.LOGIN_USER_IS_NULL_ERROR);
}
String token = UUID.fastUUID().toString();
// Jwt存储信息
Map<String, Object> claimsMap = new HashMap<String, Object>();
claimsMap.put(TokenConstants.USER_KEY, token);
claimsMap.put(TokenConstants.DETAILS_USER_ID, temDto.getId());
claimsMap.put(TokenConstants.DETAILS_USERNAME, temDto.getName());
String temporaryToken = JwtTokenUtils.createToken(claimsMap);
// String temporaryToken = jwtUtils.getTemporaryToken(openId, phone);
redisCache.addToJsonToMinute(RedisKeys.UserKeys.TEMPORARY_TOKEN.getKey() + token, temDto, 1080);
LoginVo loginVo = new LoginVo(temDto, temporaryToken); LoginVo loginVo = new LoginVo(temDto, temporaryToken);
return loginVo; return loginVo;
} }
......
package com.wangxiaolu.promotion.utils;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.sts20150401.Client;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.auth.sts.AssumeRoleRequest;
import com.aliyuncs.auth.sts.AssumeRoleResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author : liqiulin
* @date : 2025-02-06 13
* @describe :
*/
@Component
public class AliyunUtils {
@Value("${aliyun.access-key-id}")
private String OSS_ACCESS_KEY_ID;
@Value("${aliyun.access-key-secret}")
private String OSS_ACCESS_KEY_SECRET;
@Value("${aliyun.oss.sts-role-arm}")
private String OSS_STS_ROLE_ARN;
@Value("${aliyun.oss.region-id}")
private String REGION_ID;
@Value("${aliyun.oss.session-name}")
private String YOUR_ROLE_SESSION_NAME;
@Value("${aliyun.oss.bucket-name}")
private String BUCKET_NAME;
@Value("${aliyun.oss.web-js-link}")
private String WEB_JS_LIN;
public JSONObject getSignature() throws JsonProcessingException {
//获取发送STS请求基础信息
//获取access_key_id
String accessKeyId = OSS_ACCESS_KEY_ID;
//获取access_key_secret
String accessKeySecret = OSS_ACCESS_KEY_SECRET;
//获取ARN
String roleArnForOssUpload = OSS_STS_ROLE_ARN;
//色会话名称,用来区分不同的令牌,可自定义
String roleSessionName = YOUR_ROLE_SESSION_NAME;
//临时访问凭证的有效时间
Long durationSeconds = 3600L;
//初始化客户端
DefaultProfile profile = DefaultProfile.getProfile(REGION_ID, accessKeyId, accessKeySecret);
IAcsClient client = new DefaultAcsClient(profile);
AssumeRoleRequest request = new AssumeRoleRequest();
request.setRoleArn(roleArnForOssUpload);
request.setRoleSessionName(roleSessionName);
request.setDurationSeconds(durationSeconds);
//定义STS临时访问凭证变量
String STSaccessKeyId = null;
String STSsecretAccessKey = null;
String securityToken = null;
try {
AssumeRoleResponse response = client.getAcsResponse(request);
//将请求返回的STS临时访问凭证赋值到自定义变量中
STSaccessKeyId = response.getCredentials().getAccessKeyId();
STSsecretAccessKey = response.getCredentials().getAccessKeySecret();
securityToken = response.getCredentials().getSecurityToken();
} catch (ClientException e) {
e.printStackTrace();
}
//格式化请求日期
long now = System.currentTimeMillis() / 1000;
ZonedDateTime dtObj = ZonedDateTime.ofInstant(Instant.ofEpochSecond(now), ZoneId.of("UTC"));
ZonedDateTime dtObjPlus3h = dtObj.plusHours(3);
//请求时间
DateTimeFormatter dtObj1Formatter = DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss'Z'");
String dtObj1 = dtObj.format(dtObj1Formatter);
//请求日期
DateTimeFormatter dtObj2Formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
String dtObj2 = dtObj.format(dtObj2Formatter);
//请求过期时间
DateTimeFormatter expirationTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
String expirationTime = dtObjPlus3h.format(expirationTimeFormatter);
// 创建policy
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> policy = new HashMap<>();
policy.put("expiration", expirationTime);
List<Object> conditions = new ArrayList<>();
Map<String, String> bucketCondition = new HashMap<>();
bucketCondition.put("bucket", BUCKET_NAME); //请替换为目标bucket名称
conditions.add(bucketCondition);
Map<String, String> signatureVersionCondition = new HashMap<>();
signatureVersionCondition.put("x-oss-signature-version", "OSS4-HMAC-SHA256");
conditions.add(signatureVersionCondition);
Map<String, String> credentialCondition = new HashMap<>();
// 替换为实际的 access key id
credentialCondition.put("x-oss-credential", STSaccessKeyId + "/" + dtObj2 + "/"+REGION_ID+"/oss/aliyun_v4_request");
conditions.add(credentialCondition);
Map<String, String> token = new HashMap<>();
token.put("x-oss-security-token", securityToken);
conditions.add(token);
Map<String, String> dateCondition = new HashMap<>();
dateCondition.put("x-oss-date", dtObj1);
conditions.add(dateCondition);
policy.put("conditions", conditions);
String jsonPolicy = mapper.writeValueAsString(policy);
//构造待签名字符串(StringToSign)
String stringToSign = new String(Base64.encodeBase64(jsonPolicy.getBytes()));
//计算SigningKey
byte[] dateKey = hmacsha256(("aliyun_v4" + STSsecretAccessKey).getBytes(), dtObj2);
byte[] dateRegionKey = hmacsha256(dateKey, REGION_ID);
byte[] dateRegionServiceKey = hmacsha256(dateRegionKey, "oss");
byte[] signingKey = hmacsha256(dateRegionServiceKey, "aliyun_v4_request");
//计算Signature
byte[] result = hmacsha256(signingKey, stringToSign);
String signature = BinaryUtil.toHex(result);
Map<String, String> messageMap = new HashMap<>();
messageMap.put("security_token", securityToken);
messageMap.put("signature", signature);
messageMap.put("x_oss_date", dtObj1);
messageMap.put("x_oss_credential", STSaccessKeyId + "/" + dtObj2 + "/"+REGION_ID+"/oss/aliyun_v4_request");
messageMap.put("x_oss_signature_version", "OSS4-HMAC-SHA256");
messageMap.put("policy", stringToSign);
messageMap.put("web_js_link", WEB_JS_LIN);
ObjectMapper objectMapper = new ObjectMapper();
String signatureStr = objectMapper.writeValueAsString(messageMap);
return JSONObject.parseObject(signatureStr);
}
/**
* 使用HMAC-SHA256算法计算给定密钥和数据的哈希值的静态方法
*
* @param key
* @param data
* @return
*/
public static byte[] hmacsha256(byte[] key, String data) {
try {
SecretKeySpec secretKeySpec = new SecretKeySpec(key, "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(secretKeySpec);
byte[] hmacBytes = mac.doFinal(data.getBytes());
return hmacBytes;
} catch (Exception e) {
throw new RuntimeException("Failed to calculate HMAC-SHA256", e);
}
}
public JSONObject getStsToken() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
.setAccessKeyId(OSS_ACCESS_KEY_ID)
.setAccessKeySecret(OSS_ACCESS_KEY_SECRET);
config.endpoint = "sts." + REGION_ID + ".aliyuncs.com";
Client client = new Client(config);
com.aliyun.sts20150401.models.AssumeRoleRequest assumeRoleRequest = new com.aliyun.sts20150401.models.AssumeRoleRequest()
.setDurationSeconds(3600L)
.setRoleArn(OSS_STS_ROLE_ARN)
.setRoleSessionName("000516");
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
com.aliyun.sts20150401.models.AssumeRoleResponse assumeRoleResponse = client.assumeRoleWithOptions(assumeRoleRequest, runtime);
JSONObject rj = JSONObject.parseObject(JSONObject.toJSONString(assumeRoleResponse.body.getCredentials()));
rj.put("web_js_link",BUCKET_NAME);
rj.put("region",REGION_ID);
return rj;
}
}
\ No newline at end of file
...@@ -2,10 +2,14 @@ package com.wangxiaolu.promotion.utils; ...@@ -2,10 +2,14 @@ package com.wangxiaolu.promotion.utils;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
import java.util.Locale;
/** /**
* @author : liqiulin * @author : liqiulin
...@@ -29,4 +33,21 @@ public class DateUtils { ...@@ -29,4 +33,21 @@ public class DateUtils {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
public static LocalTime parseLocalTimeByEmdtime(String emdtimeStr) {
if (StringUtils.isBlank(emdtimeStr)) {
return null;
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
return LocalTime.parse(emdtimeStr, formatter);
}
public static Date parseDateBylocalDate(LocalDate localDate) {
if (localDate == null) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
Instant instant = zonedDateTime.toInstant();
return Date.from(instant);
}
} }
...@@ -84,8 +84,8 @@ public class QinCeUtils { ...@@ -84,8 +84,8 @@ public class QinCeUtils {
*/ */
public Map<String, Object> queryOrgParam() { public Map<String, Object> queryOrgParam() {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
DateTime dateTime = DateUtil.offsetDay(new Date(), -1); // DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
params.put("modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATE_PATTERN)); params.put("modify_date", DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN));
return params; return params;
} }
...@@ -98,8 +98,8 @@ public class QinCeUtils { ...@@ -98,8 +98,8 @@ public class QinCeUtils {
if (queryId) { if (queryId) {
params.put("id", ""); params.put("id", "");
} }
DateTime dateTime = DateUtil.offsetDay(new Date(), -1); // DateTime dateTime = DateUtil.offsetDay(new Date(), -1);
params.put("modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATE_PATTERN)); params.put("modify_date", DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN));
return params; return params;
} }
...@@ -110,9 +110,8 @@ public class QinCeUtils { ...@@ -110,9 +110,8 @@ public class QinCeUtils {
HashMap<String, Object> params = new HashMap<>(); HashMap<String, Object> params = new HashMap<>();
// 分页页码,默认1 // 分页页码,默认1
params.put("page_number", pageNum); params.put("page_number", pageNum);
// 查询指定数据 params.put("store_code", "POS00040423"); after_modify_date:查询更新时间(2小时之内)的门店数据。格式:yyyy-MM-dd HH:mm:SS
// after_modify_date:更新时间之后,查询更新时间之后的门店数据。格式:yyyy-MM-dd HH:mm:SS DateTime dateTime = DateUtil.offsetHour(new Date(), -2);
DateTime dateTime = DateUtil.offsetDay(new Date(), -2);
params.put("after_modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN)); params.put("after_modify_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN));
return params; return params;
} }
...@@ -157,11 +156,10 @@ public class QinCeUtils { ...@@ -157,11 +156,10 @@ public class QinCeUtils {
public Map<String, Object> queryDealerParam(Integer pageNum) { public Map<String, Object> queryDealerParam(Integer pageNum) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("page_number", pageNum); params.put("page_number", pageNum);
// 记录状态。0:已删除,1:正常 // 记录状态。0:已删除,1:正常 params.put("status", "1");
params.put("status", "1");
// 全量数据同步后,再开启指定日期同步 // todo 全量数据同步后,再开启指定日期同步
DateTime dateTime = DateUtil.offsetDay(new Date(), -2); DateTime dateTime = DateUtil.offsetHour(new Date(), -2);
params.put("after_create_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN)); params.put("after_create_date", DateUtil.format(dateTime, DatePattern.NORM_DATETIME_PATTERN));
return params; return params;
} }
......
package com.wangxiaolu.promotion.utils; package com.wangxiaolu.promotion.utils;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.ClientProfile;
...@@ -10,11 +8,16 @@ import com.tencentcloudapi.sms.v20210111.SmsClient; ...@@ -10,11 +8,16 @@ import com.tencentcloudapi.sms.v20210111.SmsClient;
import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest; import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse; import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
import com.tencentcloudapi.sms.v20210111.models.SendStatus; import com.tencentcloudapi.sms.v20210111.models.SendStatus;
import com.wangxiaolu.promotion.exception.ParamException;
import com.wangxiaolu.promotion.result.basedata.RCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.groovy.util.Maps;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Map;
/** /**
* @author : liqiulin * @author : liqiulin
* @date : 2024-04-15 15 * @date : 2024-04-15 15
...@@ -48,6 +51,15 @@ public class TencentUtils { ...@@ -48,6 +51,15 @@ public class TencentUtils {
@Value("${tengxunyun.sms.overdue_long}") @Value("${tengxunyun.sms.overdue_long}")
private long overdueLong; private long overdueLong;
// 小卤通信息
@Value("${wx.xlt_miniapp.app_id}")
private String xltAppId;
@Value("${wx.xlt_miniapp.app_secret}")
private String xltAppSecret;
public Map<String,String> getXltMini() {
return Maps.of("appId", xltAppId, "appSecret", xltAppSecret);
}
/** /**
* 给指定手机号发送验证码 * 给指定手机号发送验证码
* *
......
...@@ -27,8 +27,7 @@ public class XxlJobHandler { ...@@ -27,8 +27,7 @@ public class XxlJobHandler {
/** /**
* 同步组织架构/部门数据 * 同步组织架构/部门数据
* 0 10 1 * 每2小时同步修改日期为今天的数据
* 修改日期为昨天
*/ */
@XxlJob("qince_department_task") @XxlJob("qince_department_task")
public void departmentSyncTask(){ public void departmentSyncTask(){
...@@ -39,8 +38,7 @@ public class XxlJobHandler { ...@@ -39,8 +38,7 @@ public class XxlJobHandler {
/** /**
* 同步员工数据 * 同步员工数据
* 0 0 1 * 每2小时同步修改日期为今天的数据
* 修改日期为昨天
*/ */
@XxlJob("qince_employee_task") @XxlJob("qince_employee_task")
public void employeeSyncTask(){ public void employeeSyncTask(){
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论