Commit ec486450 by huluobin

后台发券

parent abeb73f5
...@@ -49,4 +49,11 @@ public interface TakeLeaveEventCmdService { ...@@ -49,4 +49,11 @@ public interface TakeLeaveEventCmdService {
* @return * @return
*/ */
List<StoreTechnician> queryCheckTechnicianList(Integer id, Integer departmentId); List<StoreTechnician> queryCheckTechnicianList(Integer id, Integer departmentId);
/**
* 总后台驳回请假
*
* @param takeLeaveEventId
*/
void adminRefuseTakeLeaveEvent(Integer takeLeaveEventId);
} }
...@@ -56,6 +56,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService { ...@@ -56,6 +56,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
private final OvertimeRecordMapper overtimeRecordRepository; private final OvertimeRecordMapper overtimeRecordRepository;
private final OverTimeRecordLogMapper overTimeRecordLogRepository; private final OverTimeRecordLogMapper overTimeRecordLogRepository;
private final MessageMapper messageMapper; private final MessageMapper messageMapper;
private final StoreManageMapper storeManageMapper;
@Override @Override
public void applyTakeLeave(ApplyTakeLeaveCommand cmd) { public void applyTakeLeave(ApplyTakeLeaveCommand cmd) {
...@@ -243,7 +244,6 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService { ...@@ -243,7 +244,6 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
return page; return page;
} }
private final StoreManageMapper storeManageMapper;
@Override @Override
public List<StoreTechnician> queryCheckTechnicianList(Integer technicianId, Integer departmentId) { public List<StoreTechnician> queryCheckTechnicianList(Integer technicianId, Integer departmentId) {
...@@ -255,4 +255,24 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService { ...@@ -255,4 +255,24 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
storeTechnician = storeTechnicianRepository.selectById((storeManage.getMasterUserId())); storeTechnician = storeTechnicianRepository.selectById((storeManage.getMasterUserId()));
return Lists.newArrayList(storeTechnician); return Lists.newArrayList(storeTechnician);
} }
@Override
public void adminRefuseTakeLeaveEvent(Integer takeLeaveEventId) {
TakeLeaveEvent takeLeaveEvent = takeLeaveEventRepository.selectById(takeLeaveEventId);
//如果是通过的加班申请被驳回
if (takeLeaveEvent.getType().equals(TakeLeaveEvent.TYPE_OVER_TIME) &&
takeLeaveEvent.getStatus().equals(TakeLeaveEvent.STATUS_APPROVAL_PASS)) {
OvertimeRecord overtimeRecord = overtimeRecordRepository.selectOne(new LambdaQueryWrapper<OvertimeRecord>()
.eq(OvertimeRecord::getTakeLeaveEventId, takeLeaveEvent.getId()));
List<OverTimeRecordLog> overTimeRecordLogList = overTimeRecordLogRepository.selectList(new LambdaQueryWrapper<OverTimeRecordLog>()
.eq(OverTimeRecordLog::getOverTimeRecordId, overtimeRecord.getId()));
overTimeRecordLogList.forEach(overTimeRecordLog -> {
});
}
}
} }
...@@ -120,6 +120,7 @@ public class CouponCustomerRelevance implements Serializable { ...@@ -120,6 +120,7 @@ public class CouponCustomerRelevance implements Serializable {
* @return * @return
*/ */
public static CouponCustomerRelevance getInstance(Coupon coupon) { public static CouponCustomerRelevance getInstance(Coupon coupon) {
CouponCustomerRelevance customerRelevance = CouponCustomerRelevance.builder() CouponCustomerRelevance customerRelevance = CouponCustomerRelevance.builder()
//使用条件 //使用条件
.condition1(coupon.getCondition1()) .condition1(coupon.getCondition1())
...@@ -151,7 +152,8 @@ public class CouponCustomerRelevance implements Serializable { ...@@ -151,7 +152,8 @@ public class CouponCustomerRelevance implements Serializable {
customerRelevance.setValidEndTime(coupon.getValidEndTime()); customerRelevance.setValidEndTime(coupon.getValidEndTime());
} else { } else {
long startMills = System.currentTimeMillis(); long startMills = System.currentTimeMillis();
long endMills = startMills + coupon.getValidDate() * 24 * 60 * 60 * 1000; //必须加L否则有精度错误
long endMills = startMills + coupon.getValidDate() * 24 * 60 * 60 * 1000L;
Date startTime = new Date(startMills); Date startTime = new Date(startMills);
Date endTime = new Date(endMills); Date endTime = new Date(endMills);
customerRelevance.setValidStartTime(startTime); customerRelevance.setValidStartTime(startTime);
......
...@@ -38,7 +38,6 @@ public class LogAspect { ...@@ -38,7 +38,6 @@ public class LogAspect {
* @within和@target针对类的注解, * @within和@target针对类的注解,
* @annotation是针对方法的注解,为自定义注解 * @annotation是针对方法的注解,为自定义注解
*/ */
// @Pointcut("execution(public * com.*.web..*.*(..))")
@Pointcut("@within(org.springframework.web.bind.annotation.RestController)") @Pointcut("@within(org.springframework.web.bind.annotation.RestController)")
public void point() { public void point() {
......
...@@ -28,7 +28,6 @@ public class TakeLeaveEventController { ...@@ -28,7 +28,6 @@ public class TakeLeaveEventController {
private final TakeLeaveEventCmdService takeLeaveEventCmdService; private final TakeLeaveEventCmdService takeLeaveEventCmdService;
@ApiOperation("/申请请假") @ApiOperation("/申请请假")
@PostMapping("/technician/takeLeave/applyTakeLeave") @PostMapping("/technician/takeLeave/applyTakeLeave")
public JsonResult<Void> applyTakeLeave(@RequestHeader String token, public JsonResult<Void> applyTakeLeave(@RequestHeader String token,
...@@ -77,4 +76,11 @@ public class TakeLeaveEventController { ...@@ -77,4 +76,11 @@ public class TakeLeaveEventController {
takeLeaveEventCmdService.approvalTakeLeave(cmd); takeLeaveEventCmdService.approvalTakeLeave(cmd);
return JsonResult.success(); return JsonResult.success();
} }
@ApiOperation("/总后台驳回请假")
@PostMapping("/admin/takeLeave/adminRefuseTakeLeaveEvent/{takeLeaveEventId}")
public JsonResult<Void> adminRefuseTakeLeaveEvent(@PathVariable Integer takeLeaveEventId) {
takeLeaveEventCmdService.adminRefuseTakeLeaveEvent(takeLeaveEventId);
return JsonResult.success();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment