Commit d8f5684b by huluobin

Merge branch 'master' into 3.6

# Conflicts:
#	src/main/java/com/gogirl/interfaces/order/mall/MallOrderPayController.java
parents a5ed7088 89f8a7d3
......@@ -49,4 +49,11 @@ public interface TakeLeaveEventCmdService {
* @return
*/
List<StoreTechnician> queryCheckTechnicianList(Integer id, Integer departmentId);
/**
* 总后台驳回请假
*
* @param takeLeaveEventId
*/
void adminRefuseTakeLeaveEvent(Integer takeLeaveEventId);
}
......@@ -56,6 +56,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
private final OvertimeRecordMapper overtimeRecordRepository;
private final OverTimeRecordLogMapper overTimeRecordLogRepository;
private final MessageMapper messageMapper;
private final StoreManageMapper storeManageMapper;
@Override
public void applyTakeLeave(ApplyTakeLeaveCommand cmd) {
......@@ -154,6 +155,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
.status(1)
.totalTimeLength(takeLeaveEvent.getTimeLength())
.technicianId(takeLeaveEvent.getApplyTechnicianId())
.takeLeaveEventId(cmd.getTakeLeaveEventId())
.build();
overtimeRecordRepository.insert(overtimeRecord);
}
......@@ -242,7 +244,6 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
return page;
}
private final StoreManageMapper storeManageMapper;
@Override
public List<StoreTechnician> queryCheckTechnicianList(Integer technicianId, Integer departmentId) {
......@@ -254,4 +255,24 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
storeTechnician = storeTechnicianRepository.selectById((storeManage.getMasterUserId()));
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 {
* @return
*/
public static CouponCustomerRelevance getInstance(Coupon coupon) {
CouponCustomerRelevance customerRelevance = CouponCustomerRelevance.builder()
//使用条件
.condition1(coupon.getCondition1())
......@@ -151,7 +152,8 @@ public class CouponCustomerRelevance implements Serializable {
customerRelevance.setValidEndTime(coupon.getValidEndTime());
} else {
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 endTime = new Date(endMills);
customerRelevance.setValidStartTime(startTime);
......
......@@ -49,4 +49,6 @@ public class OvertimeRecord {
private Long createTime;
private Long lastUpdateTime;
private Long takeLeaveEventId;
}
......@@ -38,7 +38,6 @@ public class LogAspect {
* @within和@target针对类的注解,
* @annotation是针对方法的注解,为自定义注解
*/
// @Pointcut("execution(public * com.*.web..*.*(..))")
@Pointcut("@within(org.springframework.web.bind.annotation.RestController)")
public void point() {
......
......@@ -38,4 +38,7 @@ public interface CouponCustomerRelevanceMapper extends BaseMapper<CouponCustomer
List<Integer> queryCouponCustomerServeRelevance(Integer couponId);
List<CouponCustomerRelevance> selectByOrderTimes();
List<CouponCustomerRelevance> couponCustomerRelevanceError();
}
......@@ -3,7 +3,6 @@ package com.gogirl.interfaces.order.mall;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gogirl.application.order.mall.MallOrderService;
import com.gogirl.application.xcx.GogirlTokenService;
import com.gogirl.domain.order.mall.MallOrder;
import com.gogirl.infrastructure.common.base.JsonResult;
import com.gogirl.infrastructure.util.SessionUtils;
......@@ -15,6 +14,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
......@@ -22,16 +22,19 @@ import java.math.BigDecimal;
@Api(tags = "商城订单接口", value = "商城订单接口")
@RestController
@AllArgsConstructor
@Slf4j
public class MallOrderController {
private final MallOrderService mallOrderService;
private final GogirlTokenService gogirlTokenService;
@ApiOperation("提交订单")
@PostMapping("/customer/mallOrder/submitMallOrder")
public JsonResult<MallOrder> submitMallOrder(@RequestHeader String token,
@RequestBody SubmitMallOrderCommand cmd) {
log.info("token:{}", token);
log.info("token:{}", SessionUtils.getCustomerToken().toString());
Integer currentCustomerId = SessionUtils.getCustomerId();
cmd.setCustomerId(currentCustomerId);
mallOrderService.submitMallOrder(cmd);
......@@ -43,8 +46,10 @@ public class MallOrderController {
@PostMapping("/customer/mallOrder/immediatePurchase")
public JsonResult<MallOrder> immediatePurchase(@RequestHeader String token,
@RequestBody ImmediatePurchaseCommand cmd) {
log.info("token:{}", token);
log.info("token:{}", SessionUtils.getCustomerToken().toString());
Integer currentCustomerId = SessionUtils.getCustomerId();
cmd.setCustomerId(currentCustomerId);
mallOrderService.immediatePurchase(cmd);
MallOrder mallOrder = mallOrderService.getMallOrderAggregate(cmd.getExecutionResult());
return JsonResult.success(mallOrder);
......@@ -79,7 +84,6 @@ public class MallOrderController {
@GetMapping("/customer/mallOrder/getMallOrderAggregate/{mallOrderId}")
public JsonResult<MallOrder> getMallOrderAggregate(@RequestHeader String token,
@PathVariable Long mallOrderId) {
Integer currentCustomerId = SessionUtils.getCustomerId();
MallOrder mallOrder = mallOrderService.getMallOrderAggregate(mallOrderId);
return JsonResult.success(mallOrder);
}
......
......@@ -29,6 +29,7 @@ public class MallOrderPayController {
private final MallOrderPayService mallOrderPayService;
private final MallRefundOrderService mallRefundOrderService;
@ApiOperation("微信支付")
@GetMapping("/customer/mallOrderPay/payMallOrder/{mallOrderId}")
public JsonResult<WxPayMpOrderResult> wxPayMallOrder(@RequestHeader String token,
......@@ -53,7 +54,7 @@ public class MallOrderPayController {
@ApiOperation("余额支付")
@GetMapping("/customer/mallOrderPay/pbalancePayMallOrder/{mallOrderId}")
@GetMapping("/customer/mallOrderPay/balancePayMallOrder/{mallOrderId}")
public JsonResult<Integer> balancePayMallOrder(@RequestHeader String token,
@PathVariable Long mallOrderId) {
Integer currentCustomerId = SessionUtils.getCustomerId();
......@@ -63,7 +64,7 @@ public class MallOrderPayController {
@ApiOperation("余额抵扣的微信支付")
@GetMapping("/customer/mallOrderPay/pbalanceWxPayMallOrder/{mallOrderId}")
@GetMapping("/customer/mallOrderPay/balanceWxPayMallOrder/{mallOrderId}")
public JsonResult<WxPayMpOrderResult> balanceWxPayMallOrder(@RequestHeader String token,
@PathVariable Long mallOrderId) {
Integer currentCustomerId = SessionUtils.getCustomerId();
......@@ -72,7 +73,7 @@ public class MallOrderPayController {
}
@ApiOperation("朋友代付")
@GetMapping("/customer/mallOrderPay/pfriendPayMallOrder/{mallOrderId}")
@GetMapping("/customer/mallOrderPay/friendPayMallOrder/{mallOrderId}")
public JsonResult<Integer> friendPayMallOrder(@RequestHeader String token,
@PathVariable Long mallOrderId,
@ApiParam("朋友手机号")
......@@ -83,7 +84,7 @@ public class MallOrderPayController {
}
@ApiOperation(("/确认退款"))
@GetMapping("/customer/mallOrderPay/prefund/{orderDetailId}")
@GetMapping("/customer/mallOrderPay/refund/{orderDetailId}")
@Transactional(timeout = 10000)
public JsonResult<Void> refund(@PathVariable Long orderDetailId) throws WxPayException {
mallRefundOrderService.refund(orderDetailId);
......
......@@ -28,7 +28,6 @@ public class TakeLeaveEventController {
private final TakeLeaveEventCmdService takeLeaveEventCmdService;
@ApiOperation("/申请请假")
@PostMapping("/technician/takeLeave/applyTakeLeave")
public JsonResult<Void> applyTakeLeave(@RequestHeader String token,
......@@ -77,4 +76,11 @@ public class TakeLeaveEventController {
takeLeaveEventCmdService.approvalTakeLeave(cmd);
return JsonResult.success();
}
@ApiOperation("/总后台审批请假")
@PostMapping("/admin/takeLeave/adminRefuseTakeLeaveEvent/{takeLeaveEventId}")
public JsonResult<Void> adminRefuseTakeLeaveEvent(@PathVariable Integer takeLeaveEventId) {
takeLeaveEventCmdService.adminRefuseTakeLeaveEvent(takeLeaveEventId);
return JsonResult.success();
}
}
......@@ -31,6 +31,9 @@
where t2.finish_time > '2020-01-01'
and t1.state = 2
</select>
<select id="couponCustomerRelevanceError" resultType="com.gogirl.domain.market.coupon.CouponCustomerRelevance">
select * from coupon_customer_relevance where valid_end_time &lt; valid_start_time and state =3
</select>
<update id="setCouponExpire" parameterType="java.util.Date">
update coupon_customer_relevance
......
......@@ -480,7 +480,7 @@ public class Test {
@org.junit.Test
public void testMail() {
mailService.sendSimpleMail("robbendev@qq.com","pre","test");
mailService.sendSimpleMail("robbendev@qq.com", "pre", "test");
}
......@@ -488,7 +488,19 @@ public class Test {
Schedule schedule;
@org.junit.Test
public void career(){
public void career() {
schedule.syncTechnicianCareer();
}
@org.junit.Test
public void couponCustomerRelevanceError() {
List<CouponCustomerRelevance> couponCustomerRelevanceList = couponCustomerRelevanceMapper.couponCustomerRelevanceError();
couponCustomerRelevanceList.forEach(couponCustomerRelevance -> {
couponCustomerRelevance.setValidEndTime(new Date(couponCustomerRelevance.getValidStartTime().getTime() + 30 * 24 * 60 * 60 * 1000L));
if (couponCustomerRelevance.isValid()) {
couponCustomerRelevance.setState(1);
}
couponCustomerRelevanceMapper.updateById(couponCustomerRelevance);
});
}
}
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