Commit 86ce4857 by huluobin

战术更新

parent 1089fb95
......@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.gogirl.domain.product.serve.BaseServe;
import java.time.LocalDateTime;
import java.util.List;
/**
* Created by yinyong on 2018/8/21.
......@@ -18,10 +17,9 @@ public interface BaseServeService extends IService<BaseServe> {
* 查询服务列表
*
* @param param
* @param serveIdList
* @return
*/
IPage<BaseServe> listServeForPage(IPage<BaseServe> page, BaseServe param, List<Integer> serveIdList);
IPage<BaseServe> listServeForPage(IPage<BaseServe> page, BaseServe param);
/**
* 查询服务聚合
......
......@@ -10,7 +10,6 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
@Service
@AllArgsConstructor
......@@ -20,8 +19,8 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override
public IPage<BaseServe> listServeForPage(IPage<BaseServe> page, BaseServe param, List<Integer> serveIdList) {
return baseServeMapper.listServeForPage(page, param, serveIdList);
public IPage<BaseServe> listServeForPage(IPage<BaseServe> page, BaseServe param) {
return baseServeMapper.listServeForPage(page, param);
}
......
package com.gogirl.interfaces.store.complaint;
package com.gogirl.application.store.oa;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gogirl.domain.store.oa.OverTimeRecordLog;
/**
* <p>
* 前端控制器
* 服务类
* </p>
*
* @author robbendev
* @since 2020-07-20
* @since 2020-07-23
*/
@RestController
@RequestMapping("/recent-deducted-complaint-score")
public class RecentDeductedComplaintScoreController {
public interface IOverTimeRecordLogService extends IService<OverTimeRecordLog> {
}
package com.gogirl.application.store.oa;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.shared.store.OrderTimeRecordPageQuery;
/**
* <p>
* 加班记录表 服务类
* </p>
*
* @author robbendev
* @since 2020-07-23
*/
public interface IOverTimeRecordService extends IService<OverTimeRecord> {
/**
* 加班记录
*
* @param qry
*/
IPage<OverTimeRecord> queryPage(OrderTimeRecordPageQuery qry);
}
package com.gogirl.application.store.oa;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gogirl.domain.store.oa.TakeLeaveEvent;
/**
* <p>
* 请假记录表 服务类
* </p>
*
* @author robbendev
* @since 2020-07-23
*/
public interface ITakeLeaveEventService extends IService<TakeLeaveEvent> {
}
package com.gogirl.application.store.oa.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.store.oa.IOverTimeRecordLogService;
import com.gogirl.domain.store.oa.OverTimeRecordLog;
import com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordLogMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author robbendev
* @since 2020-07-23
*/
@Service
public class OverTimeRecordLogServiceImpl extends ServiceImpl<OverTimeRecordLogMapper, OverTimeRecordLog> implements IOverTimeRecordLogService {
}
package com.gogirl.application.store.oa.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.store.oa.IOverTimeRecordService;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.infrastructure.common.util.SessionUtils;
import com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordMapper;
import com.gogirl.shared.store.OrderTimeRecordPageQuery;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.Date;
/**
* <p>
* 加班记录表 服务实现类
* </p>
*
* @author robbendev
* @since 2020-07-23
*/
@Service
public class OverTimeRecordServiceImpl extends ServiceImpl<OverTimeRecordMapper, OverTimeRecord> implements IOverTimeRecordService {
@Override
public IPage<OverTimeRecord> queryPage(OrderTimeRecordPageQuery qry) {
Calendar cale = Calendar.getInstance();
cale.add(Calendar.MONTH, 0);
cale.set(Calendar.DAY_OF_MONTH, 1);
Date firstDay = cale.getTime();
Date paramDate = new Date(firstDay.getTime() - 7 * 24 * 60 * 60 * 1000);
IPage<OverTimeRecord> page = new Page<>();
page = baseMapper.selectPage(page, new LambdaQueryWrapper<OverTimeRecord>()
.eq(OverTimeRecord::getTechnicianId, SessionUtils.getTechnicianId())
.gt(OverTimeRecord::getLeftTimeLength, 0)
.ge(OverTimeRecord::getStartTime, paramDate.getTime())
.ge(OverTimeRecord::getEndTime, paramDate.getTime()));
return page;
}
}
package com.gogirl.application.store.oa.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.store.oa.ITakeLeaveEventService;
import com.gogirl.domain.store.oa.TakeLeaveEvent;
import com.gogirl.infrastructure.mapper.store.oa.TakeLeaveEventMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 请假记录表 服务实现类
* </p>
*
* @author robbendev
* @since 2020-07-23
*/
@Service
public class TakeLeaveEventServiceImpl extends ServiceImpl<TakeLeaveEventMapper, TakeLeaveEvent> implements ITakeLeaveEventService {
}
......@@ -6,8 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gogirl.application.store.store.TakeLeaveEventCmdService;
import com.gogirl.assembler.ApplyTakeLeaveCommandAssembler;
import com.gogirl.assembler.OverTimeLogCommandAssembler;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.domain.store.oa.OverTimeRecordLog;
import com.gogirl.domain.store.oa.OvertimeRecord;
import com.gogirl.domain.store.oa.TakeLeaveEvent;
import com.gogirl.domain.store.store.Message;
import com.gogirl.domain.store.store.StoreManage;
......@@ -16,7 +16,7 @@ import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.JsonUtilByFsJson;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordLogMapper;
import com.gogirl.infrastructure.mapper.store.oa.OvertimeRecordMapper;
import com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordMapper;
import com.gogirl.infrastructure.mapper.store.oa.TakeLeaveEventMapper;
import com.gogirl.infrastructure.mapper.store.store.MessageMapper;
import com.gogirl.infrastructure.mapper.store.store.StoreManageMapper;
......@@ -53,7 +53,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
*/
private final StoreTechnicianMapper storeTechnicianRepository;
private final TakeLeaveEventMapper takeLeaveEventRepository;
private final OvertimeRecordMapper overtimeRecordRepository;
private final OverTimeRecordMapper overtimeRecordRepository;
private final OverTimeRecordLogMapper overTimeRecordLogRepository;
private final MessageMapper messageMapper;
private final StoreManageMapper storeManageMapper;
......@@ -101,7 +101,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
overTimeRecordLogList.forEach(overTimeRecordLog -> {
//加班记录
OvertimeRecord overtimeRecord = overtimeRecordRepository.selectById(overTimeRecordLog.getOverTimeRecordId());
OverTimeRecord overtimeRecord = overtimeRecordRepository.selectById(overTimeRecordLog.getOverTimeRecordId());
//扣除这一次申请的时间
overtimeRecord.setLeftTimeLength(overtimeRecord.getLeftTimeLength().subtract(overTimeRecordLog.getLengthTime()));
//检查调休时间和加班时间匹配
......@@ -149,7 +149,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
if (takeLeaveEvent.getType().equals(TakeLeaveEvent.TYPE_OVER_TIME)
&& cmd.getApproval().equals(TakeLeaveEvent.STATUS_APPROVAL_PASS)) {
OvertimeRecord overtimeRecord = OvertimeRecord.builder()
OverTimeRecord overtimeRecord = OverTimeRecord.builder()
.createTime(System.currentTimeMillis())
.startTime(takeLeaveEvent.getStartTime())
.endTime(takeLeaveEvent.getEndTime())
......@@ -173,7 +173,7 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
overTimeRecordLogList.stream().collect(Collectors.groupingBy(OverTimeRecordLog::getOverTimeRecordId))
.forEach((overTimeRecordId, list) -> {
OvertimeRecord overtimeRecord = overtimeRecordRepository.selectById(overTimeRecordId);
OverTimeRecord overtimeRecord = overtimeRecordRepository.selectById(overTimeRecordId);
BigDecimal timeLength = list.stream().map(OverTimeRecordLog::getLengthTime).reduce(BigDecimal.ZERO, BigDecimal::add);
overtimeRecord.setLeftTimeLength(overtimeRecord.getLeftTimeLength().add(timeLength));
overtimeRecordRepository.insert(overtimeRecord);
......@@ -267,8 +267,8 @@ public class TakeLeaveEventCmdServiceImpl implements TakeLeaveEventCmdService {
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()));
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()));
......
......@@ -80,7 +80,7 @@ public class BaseServe implements Serializable {
private String explain;
@TableField(exist = false)
private Integer serveLabelId;
private Integer labelId;
/**
* 非数据库字段
......
......@@ -22,7 +22,7 @@ import java.math.BigDecimal;
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OvertimeRecord implements Serializable {
public class OverTimeRecord implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
......
......@@ -6,8 +6,6 @@ import com.gogirl.domain.product.serve.BaseServe;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by yinyong on 2018/8/21.
*/
......@@ -15,10 +13,9 @@ import java.util.List;
@Repository
public interface BaseServeMapper extends BaseMapper<BaseServe> {
IPage<BaseServe> listServeForPage(@Param("page") IPage<BaseServe> page, @Param("baseServe") BaseServe baseServe, @Param("serveIdList") List<Integer> serveIdList);
IPage<BaseServe> listServeForPage(@Param("page") IPage<BaseServe> page, @Param("baseServe") BaseServe baseServe);
IPage<BaseServe> listLeisureServeForPage(@Param("page") IPage<BaseServe> page, @Param("baseServe") BaseServe baseServe, @Param("serveIdList") List<Integer> serveIdList, @Param("time") String time, @Param("week") Integer week);
}
......@@ -2,12 +2,12 @@ package com.gogirl.infrastructure.mapper.store.oa;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gogirl.domain.store.oa.OvertimeRecord;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.domain.store.oa.TakeLeaveEvent;
import java.util.List;
public interface OvertimeRecordMapper extends BaseMapper<OvertimeRecord> {
public interface OverTimeRecordMapper extends BaseMapper<OverTimeRecord> {
List<TakeLeaveEvent> plusOverTimeRecord();
}
package com.gogirl.infrastructure.mapper.store.oa;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gogirl.domain.store.oa.OvertimeRecord;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.domain.store.oa.TakeLeaveEvent;
import org.apache.ibatis.annotations.Param;
......@@ -23,5 +23,5 @@ public interface TakeLeaveEventMapper extends BaseMapper<TakeLeaveEvent> {
*
* @return
*/
List<OvertimeRecord> takeLeaveId();
List<OverTimeRecord> takeLeaveId();
}
......@@ -20,8 +20,7 @@ public class MallCustomerAddressController {
@ApiOperation("新增收获地址")
@PostMapping("/customer/customerAddress/addMallCustomerAddress")
public JsonResult<MallCustomerAddress> addMallCustomerAddress(@RequestHeader String token,
@RequestBody MallCustomerAddress mallCustomerAddress) {
public JsonResult<MallCustomerAddress> addMallCustomerAddress(@RequestBody MallCustomerAddress mallCustomerAddress) {
Integer currentCustomerId = SessionUtils.getCustomerId();
mallCustomerAddress.setCustomerId(currentCustomerId);
mallCustomerAddress.setIsDefault(MallCustomerAddress.IS_DEFAULT_FALSE);
......@@ -31,8 +30,7 @@ public class MallCustomerAddressController {
@ApiOperation("修改收货地址")
@PostMapping("/customer/customerAddress/changeMallCustomerAddress")
public JsonResult<MallCustomerAddress> changeMallCustomerAddress(@RequestHeader String token,
@RequestBody MallCustomerAddress mallCustomerAddress) {
public JsonResult<MallCustomerAddress> changeMallCustomerAddress(@RequestBody MallCustomerAddress mallCustomerAddress) {
Integer currentCustomerId = SessionUtils.getCustomerId();
mallCustomerAddress.setCustomerId(currentCustomerId);
mallCustomerAddressService.changeMallCustomerAddress(mallCustomerAddress);
......@@ -41,7 +39,7 @@ public class MallCustomerAddressController {
@ApiOperation("收获地址列表")
@GetMapping("/customer/customerAddress/listMallCustomerAddress")
public JsonResult<List<MallCustomerAddress>> listMallCustomerAddress(@RequestHeader String token) {
public JsonResult<List<MallCustomerAddress>> listMallCustomerAddress() {
Integer currentCustomerId = SessionUtils.getCustomerId();
List<MallCustomerAddress> list = mallCustomerAddressService.listMallCustomerAddress(currentCustomerId);
return JsonResult.success(list);
......@@ -49,8 +47,7 @@ public class MallCustomerAddressController {
@ApiOperation("修改默认收货地址")
@GetMapping("/customer/customerAddress/updateDefaultMallCustomerAddress/{mallCustomerAddressId}")
public JsonResult<MallCustomerAddress> updateDefaultMallCustomerAddress(@RequestHeader String token,
@PathVariable Long mallCustomerAddressId) {
public JsonResult<MallCustomerAddress> updateDefaultMallCustomerAddress(@PathVariable Long mallCustomerAddressId) {
Integer currentCustomerId = SessionUtils.getCustomerId();
MallCustomerAddress mallCustomerAddress = mallCustomerAddressService.updateDefaultMallCustomerAddress(currentCustomerId, mallCustomerAddressId);
return JsonResult.success(mallCustomerAddress);
......@@ -59,7 +56,7 @@ public class MallCustomerAddressController {
@ApiOperation("获取默认收货地址")
@GetMapping("/customer/customerAddress/getDefaultMallCustomerAddress")
public JsonResult<MallCustomerAddress> getDefaultMallCustomerAddress(@RequestHeader String token) {
public JsonResult<MallCustomerAddress> getDefaultMallCustomerAddress() {
Integer currentCustomerId = SessionUtils.getCustomerId();
MallCustomerAddress mallCustomerAddress = mallCustomerAddressService.getDefaultMallCustomerAddress(currentCustomerId);
return JsonResult.success(mallCustomerAddress);
......
......@@ -201,8 +201,7 @@ public class PayController {
@ApiOperation(value = "美甲师端,充值会员卡")
@PostMapping("/technician/pay/chargeCustomerCard")
public JsonResult<Void> chargeCustomerCard(@RequestHeader String token,
String name,
public JsonResult<Void> chargeCustomerCard(String name,
String phone,
Double amount,
Integer source,
......
......@@ -233,12 +233,6 @@ public class ScheduleManageController {
}
/**
* @param scheduleServeId
* @param status
* @param forceLeisureConfig 强制使用闲时预约次数 1-是 2-否
* @return
*/
@ApiOperation("更新预约服务状态")
@GetMapping("/technician/schedule/updateScheduledServeStatus")
public JsonResult<Void> updateScheduledServeStatus(@RequestParam Integer scheduleServeId,
......
......@@ -12,7 +12,7 @@ import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.security.InvalidParameterException;
import javax.validation.Valid;
@Api(tags = "商城购物车接口")
@RestController
......@@ -24,14 +24,9 @@ public class MallShoppingCartController {
@ApiOperation("添加购物车")
@PostMapping("/customer/mallCart/addMallShoppingCart")
public JsonResult<Void> addMallShoppingCart(@RequestBody MallShoppingCartCommand cmd) {
Integer currentCustomerId = SessionUtils.getCustomerId();
cmd.setCustomerId(currentCustomerId);
if (cmd.getProductId() == null || cmd.getNum() == null) {
throw new InvalidParameterException();
}
public JsonResult<Void> addMallShoppingCart(@RequestBody
@Valid MallShoppingCartCommand cmd) {
cmd.setCustomerId(SessionUtils.getCustomerId());
mallShoppingCartCmdService.addMallShoppingCart(cmd);
return JsonResult.success();
}
......@@ -40,9 +35,7 @@ public class MallShoppingCartController {
@ApiOperation("查看我的购物车")
@PostMapping("/customer/mallCart/listMallShoppingCart")
public JsonResult<MyMallShoppingCartDTO> listMallShoppingCart() {
Integer currentCustomerId = SessionUtils.getCustomerId();
MyShoppingCartQuery qry = new MyShoppingCartQuery(currentCustomerId);
MyShoppingCartQuery qry = new MyShoppingCartQuery(SessionUtils.getCustomerId());
MyMallShoppingCartDTO myMallShoppingCartDTO = mallShoppingCartQryService.queryMyShoppingCart(qry);
return JsonResult.success(myMallShoppingCartDTO);
}
......@@ -50,9 +43,7 @@ public class MallShoppingCartController {
@ApiOperation("清空购物车")
@GetMapping("/customer/mallCart/removeAllMallShoppingCart")
public JsonResult<Void> removeAllMallShoppingCart() {
Integer currentCustomerId = SessionUtils.getCustomerId();
RemoveAllCartCommand cmd = new RemoveAllCartCommand(currentCustomerId);
RemoveAllCartCommand cmd = new RemoveAllCartCommand(SessionUtils.getCustomerId());
mallShoppingCartCmdService.removeAllMallShoppingCart(cmd);
return JsonResult.success();
}
......@@ -61,8 +52,7 @@ public class MallShoppingCartController {
@GetMapping("/customer/mallCart/removeMallShoppingCart/{id}")
public JsonResult<Integer> removeMallShoppingCart(@ApiParam("购物车id")
@PathVariable Long id) {
RemoveCartCommand cmd = new RemoveCartCommand(id);
mallShoppingCartCmdService.removeMallShoppingCart(cmd);
mallShoppingCartCmdService.removeMallShoppingCart(new RemoveCartCommand(id));
return JsonResult.success();
}
......@@ -70,10 +60,7 @@ public class MallShoppingCartController {
@GetMapping("/customer/mallCart/decreaseMallShoppingCart/{id}")
public JsonResult<Integer> decreaseMallShoppingCart(@ApiParam("产品id")
@PathVariable Long id) {
Integer currentCustomerId = SessionUtils.getCustomerId();
DecreaseCartCommand cmd = new DecreaseCartCommand(currentCustomerId, id);
mallShoppingCartCmdService.decreaseMallShoppingCart(cmd);
mallShoppingCartCmdService.decreaseMallShoppingCart(new DecreaseCartCommand(SessionUtils.getCustomerId(), id));
return JsonResult.success();
}
......
......@@ -16,7 +16,6 @@ import java.util.List;
/**
* Created by yinyong on 2018/9/11.
*/
@RestController
@Api(tags = {"首页banner轮播图"})
public class BroadcastController {
......
......@@ -7,10 +7,7 @@ import com.gogirl.domain.product.serve.BaseServe;
import com.gogirl.infrastructure.common.annotation.AuthIgnore;
import com.gogirl.infrastructure.common.annotation.LoginIgnore;
import com.gogirl.infrastructure.common.base.JsonResult;
import com.gogirl.infrastructure.common.util.DateUtils;
import com.gogirl.infrastructure.common.util.StringUtils;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.google.common.collect.Lists;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
......@@ -19,10 +16,6 @@ import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@Api(tags = {"服务接口"}, value = "预约服务接口")
......@@ -35,40 +28,14 @@ public class ServeController {
@ApiOperation(value = "查看服务列表")
@GetMapping("/customer/serve/no_queryServeForPage")
@Deprecated
@LoginIgnore
@AuthIgnore
public JsonResult<IPage<BaseServe>> no_queryServeForPage(BaseServe param,
Integer pageNum,
Integer pageSize,
Integer labelId,
String serveIds,
String time) {
if (labelId != null && labelId == -1) {
labelId = null;
}
List<Integer> serveIdList;
if (StringUtils.isNotEmpty(serveIds)) {
serveIdList = Lists.newArrayList(serveIds.split(",")).stream().map(Integer::valueOf).collect(Collectors.toList());
} else {
serveIdList = new ArrayList<>();
}
if (pageNum == null) {
pageNum = 1;
}
if (pageSize == null) {
pageSize = 20;
}
IPage<BaseServe> page = new Page<>(pageNum, pageSize);
int weekday = DateUtils.getWeek(new Date());
param.setServeLabelId(labelId);
if (StringUtils.isEmpty(time))
page = baseServeService.listServeForPage(page, param, serveIdList);
else
page = baseServeMapper.listLeisureServeForPage(page, param, serveIdList, time, weekday);
Integer pageSize) {
IPage<BaseServe> page = new Page<>(pageNum == null ? 1 : pageNum, pageSize == null ? 20 : pageSize);
page = baseServeService.listServeForPage(page, param);
return JsonResult.success(page);
}
......@@ -103,7 +70,7 @@ public class ServeController {
@RequestParam(required = false, defaultValue = "20") Integer pageSize) {
IPage<BaseServe> page = new Page<>(pageNum, pageSize);
page = baseServeService.listServeForPage(page, baseServe, null);
page = baseServeService.listServeForPage(page, baseServe);
return JsonResult.success(page);
}
......
......@@ -7,8 +7,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......@@ -24,19 +22,16 @@ public class TypeController {
private final BaseTypeService baseTypeService;
@ApiOperation("查询服务类型")
@ApiOperation("用户端询服务类型")
@GetMapping("/customer/type/queryType")
public JsonResult<List<BaseType>> queryType() {
return JsonResult.success(baseTypeService.list());
}
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST}, value = "/technician/type/queryType")
@ApiOperation("美甲师端查询服务类型")
@GetMapping("/technician/type/queryType")
public JsonResult<List<BaseType>> technicianQueryType() {
JsonResult<List<BaseType>> jsonResult = new JsonResult<>();
List<BaseType> lists = baseTypeService.list();
jsonResult.setSuccess(JsonResult.CODE_SUCCESS).setMessage(JsonResult.APP_DEFINE_SUC).setData(lists);
return jsonResult;
return JsonResult.success(baseTypeService.list());
}
}
package com.gogirl.interfaces.store.attendance;
package com.gogirl.interfaces.store.oa;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gogirl.domain.store.oa.OvertimeRecord;
import com.gogirl.application.store.oa.IOverTimeRecordService;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.infrastructure.common.base.JsonResult;
import com.gogirl.infrastructure.common.util.SessionUtils;
import com.gogirl.infrastructure.mapper.store.oa.OvertimeRecordMapper;
import com.gogirl.shared.store.OrderTimeRecordPageQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import java.util.Calendar;
import java.util.Date;
@Api(tags = "美甲师加班记录接口")
@AllArgsConstructor
@RestController
public class OverTimeRecordController {
private final OvertimeRecordMapper overtimeRecordMapper;
private final IOverTimeRecordService overTimeRecordService;
@ApiOperation("加班记录")
@PostMapping("/technician/overTimeRecord/queryPage")
public JsonResult<IPage<OvertimeRecord>> queryPage(@RequestHeader String token,
@RequestBody OrderTimeRecordPageQuery qry) {
Calendar cale = Calendar.getInstance();
// 获取前月的第一天
cale.add(Calendar.MONTH, 0);
cale.set(Calendar.DAY_OF_MONTH, 1);
Date firstDay = cale.getTime();
Date paramDate = new Date(firstDay.getTime() - 7 * 24 * 60 * 60 * 1000);
IPage<OvertimeRecord> page = new Page<>();
page = overtimeRecordMapper.selectPage(page, new LambdaQueryWrapper<OvertimeRecord>()
.eq(OvertimeRecord::getTechnicianId, SessionUtils.getTechnicianId())
.gt(OvertimeRecord::getLeftTimeLength, 0)
.ge(OvertimeRecord::getStartTime, paramDate.getTime())
.ge(OvertimeRecord::getEndTime, paramDate.getTime()));
public JsonResult<IPage<OverTimeRecord>> queryPage(@RequestBody OrderTimeRecordPageQuery qry) {
IPage<OverTimeRecord> page = overTimeRecordService.queryPage(qry);
return JsonResult.success(page);
}
}
package com.gogirl.interfaces.store.attendance;
package com.gogirl.interfaces.store.oa;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gogirl.application.store.store.TakeLeaveEventCmdService;
......
package com.gogirl.interfaces.store.training;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author robbendev
* @since 2020-07-07
*/
@RestController
@RequestMapping("")
@Api(tags = "美甲师培训问卷调查接口")
public class TrainingQuestionController {
}
......@@ -3,6 +3,7 @@ package com.gogirl.shared.product;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
......@@ -11,9 +12,11 @@ public class MallShoppingCartCommand implements Serializable {
@ApiModelProperty(value = "用户id")
private Integer customerId;
@NotNull
@ApiModelProperty(value = "加入购物车的产品id", required = true)
private Long productId;
@NotNull
@ApiModelProperty(value = "产品sku数量", required = true)
private Integer num;
}
package com.gogirl.shared.store;
import com.gogirl.infrastructure.common.base.PageRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
public class OrderTimeRecordPageQuery implements Serializable {
public class OrderTimeRecordPageQuery extends PageRequest implements Serializable {
private Integer pageNum;
private Integer pageSize;
private Integer technicianId;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gogirl.infrastructure.mapper.store.oa.OvertimeRecordMapper">
<mapper namespace="com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordMapper">
<select id="plusOverTimeRecord" resultType="com.gogirl.domain.store.oa.TakeLeaveEvent">
SELECT t1.*
from take_leave_event t1
......@@ -13,4 +13,4 @@
and t2.id is null
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -13,7 +13,7 @@
and type != 2
</select>
<select id="takeLeaveId" resultType="com.gogirl.domain.store.oa.OvertimeRecord">
<select id="takeLeaveId" resultType="com.gogirl.domain.store.oa.OverTimeRecord">
SELECT t1.*
from over_time_record t1
LEFT JOIN take_leave_event t2 on t1.start_time = t2.start_time and t1.end_time = t2.end_time and
......@@ -23,4 +23,4 @@
GROUP BY t1.id
</select>
</mapper>
\ No newline at end of file
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordLogMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gogirl.infrastructure.mapper.store.oa.TakeLeaveEventMapper">
</mapper>
......@@ -128,7 +128,7 @@ public class CodeGenerator {
// strategy.setSuperEntityClass("你自己的父类实体,没有就不用设置!");
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
// strategy.setRestControllerStyle(true);
// 公共父类
// strategy.setSuperControllerClass("你自己的父类控制器,没有就不用设置!");
// 写于父类中的公共字段
......
......@@ -26,7 +26,7 @@ import com.gogirl.domain.product.purchase.PurchaseStockRecord;
import com.gogirl.domain.store.complaint.ComplaintDetailed;
import com.gogirl.domain.store.complaint.ComplaintDetailedTechnician;
import com.gogirl.domain.store.complaint.ComplaintMain;
import com.gogirl.domain.store.oa.OvertimeRecord;
import com.gogirl.domain.store.oa.OverTimeRecord;
import com.gogirl.domain.store.oa.TakeLeaveEvent;
import com.gogirl.domain.store.store.StoreTechnician;
import com.gogirl.domain.user.customer.Customer;
......@@ -50,7 +50,7 @@ import com.gogirl.infrastructure.mapper.product.purchase.PurchaseStockRecordMapp
import com.gogirl.infrastructure.mapper.store.complaint.ComplaintDetailedMapper;
import com.gogirl.infrastructure.mapper.store.complaint.ComplaintDetailedTechnicianMapper;
import com.gogirl.infrastructure.mapper.store.complaint.ComplaintMainMapper;
import com.gogirl.infrastructure.mapper.store.oa.OvertimeRecordMapper;
import com.gogirl.infrastructure.mapper.store.oa.OverTimeRecordMapper;
import com.gogirl.infrastructure.mapper.store.oa.TakeLeaveEventMapper;
import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceMapper;
import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMapper;
......@@ -583,7 +583,7 @@ public class Test {
@Resource
OvertimeRecordMapper overtimeRecordMapper;
OverTimeRecordMapper overtimeRecordMapper;
@org.junit.Test
public void plusOverTimeRecord() {
......@@ -591,7 +591,7 @@ public class Test {
takeLeaveEventList.forEach(takeLeaveEvent -> {
OvertimeRecord overtimeRecord = OvertimeRecord.builder()
OverTimeRecord overtimeRecord = OverTimeRecord.builder()
.createTime(System.currentTimeMillis())
.startTime(takeLeaveEvent.getStartTime())
.endTime(takeLeaveEvent.getEndTime())
......@@ -613,9 +613,9 @@ public class Test {
@org.junit.Test
public void takeLeaveId() {
List<OvertimeRecord> overtimeRecordList = takeLeaveEventMapper.takeLeaveId();
List<OverTimeRecord> overTimeRecordList = takeLeaveEventMapper.takeLeaveId();
overtimeRecordList.forEach(overtimeRecord -> {
overTimeRecordList.forEach(overtimeRecord -> {
List<TakeLeaveEvent> takeLeaveEventList = takeLeaveEventMapper.selectList(
new LambdaQueryWrapper<TakeLeaveEvent>()
.eq(TakeLeaveEvent::getStartTime, overtimeRecord.getStartTime())
......@@ -624,20 +624,20 @@ public class Test {
.eq(TakeLeaveEvent::getTimeLength, overtimeRecord.getTotalTimeLength())
);
List<OvertimeRecord> overtimeRecordList1 = overtimeRecordMapper.selectList(
new LambdaQueryWrapper<OvertimeRecord>()
.eq(OvertimeRecord::getStartTime, overtimeRecord.getStartTime())
.eq(OvertimeRecord::getEndTime, overtimeRecord.getEndTime())
.eq(OvertimeRecord::getTechnicianId, overtimeRecord.getTechnicianId())
.eq(OvertimeRecord::getTotalTimeLength, overtimeRecord.getTotalTimeLength())
List<OverTimeRecord> overTimeRecordList1 = overtimeRecordMapper.selectList(
new LambdaQueryWrapper<OverTimeRecord>()
.eq(OverTimeRecord::getStartTime, overtimeRecord.getStartTime())
.eq(OverTimeRecord::getEndTime, overtimeRecord.getEndTime())
.eq(OverTimeRecord::getTechnicianId, overtimeRecord.getTechnicianId())
.eq(OverTimeRecord::getTotalTimeLength, overtimeRecord.getTotalTimeLength())
);
Queue<OvertimeRecord> overTimeRecordQueue = new LinkedList<>(overtimeRecordList1);
Queue<OverTimeRecord> overTimeRecordQueue = new LinkedList<>(overTimeRecordList1);
if (takeLeaveEventList.size() == overTimeRecordQueue.size()) {
takeLeaveEventList.forEach(takeLeaveEvent -> {
OvertimeRecord overtimeRecord1 = overTimeRecordQueue.poll();
overtimeRecord1.setTakeLeaveEventId(takeLeaveEvent.getId());
overtimeRecordMapper.updateById(overtimeRecord1);
OverTimeRecord overTimeRecord1 = overTimeRecordQueue.poll();
overTimeRecord1.setTakeLeaveEventId(takeLeaveEvent.getId());
overtimeRecordMapper.updateById(overTimeRecord1);
});
}
});
......
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