Commit c87b0c38 by YG8999

保洁记录

parent 4def0d01
......@@ -21,6 +21,8 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType;
import share.system.domain.SCleanRecords;
import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.ISCleanRecordsService;
import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo;
......@@ -46,6 +48,8 @@ public class SCleanRecordsController extends BaseController
@GetMapping("/list")
public TableDataInfo list(SCleanRecords sCleanRecords)
{
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sCleanRecords.setConsumerId(user.getId());
startPage();
List<SCleanRecords> list = sCleanRecordsService.selectSCleanRecordsList(sCleanRecords);
return getDataTable(list);
......@@ -58,6 +62,8 @@ public class SCleanRecordsController extends BaseController
@GetMapping("/unCleanList")
public TableDataInfo unCleanList(SCleanRecords sCleanRecords)
{
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sCleanRecords.setConsumerId(user.getId());
startPage();
List<SCleanRecords> list = sCleanRecordsService.unCleanList(sCleanRecords);
return getDataTable(list);
......@@ -70,6 +76,8 @@ public class SCleanRecordsController extends BaseController
@GetMapping("/myCleanList")
public TableDataInfo myCleanList(SCleanRecords sCleanRecords)
{
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sCleanRecords.setConsumerId(user.getId());
startPage();
List<SCleanRecords> list = sCleanRecordsService.myCleanList(sCleanRecords);
return getDataTable(list);
......@@ -93,9 +101,11 @@ public class SCleanRecordsController extends BaseController
@PostMapping(value = "/startClean")
public AjaxResult startClean(@RequestBody SCleanRecords sCleanRecords)
{
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sCleanRecords.setConsumerId(user.getId());
sCleanRecords.setStartDate(DateUtil.date());
sCleanRecords.setStatus(1);
return toAjax(sCleanRecordsService.updateSCleanRecords(sCleanRecords));
return toAjax(sCleanRecordsService.startCleanRecords(sCleanRecords));
}
/**
......@@ -106,6 +116,8 @@ public class SCleanRecordsController extends BaseController
@PostMapping(value = "/endClean")
public AjaxResult endClean(@RequestBody SCleanRecords sCleanRecords)
{
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sCleanRecords.setConsumerId(user.getId());
sCleanRecords.setEndDate(DateUtil.date());
sCleanRecords.setStatus(2);
return toAjax(sCleanRecordsService.updateSCleanRecords(sCleanRecords));
......
......@@ -80,4 +80,6 @@ public interface ISCleanRecordsService
* @return
*/
boolean finishCleanRecords();
int startCleanRecords(SCleanRecords sCleanRecords);
}
......@@ -188,6 +188,18 @@ public class SCleanRecordsServiceImpl implements ISCleanRecordsService
return 0 < sCleanRecordsMapper.updateBatch(list);
}
@Override
public int startCleanRecords(SCleanRecords sCleanRecords) {
LambdaQueryWrapper<SCleanRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SCleanRecords::getStatus,1);
queryWrapper.eq(SCleanRecords::getConsumerId,sCleanRecords.getConsumerId());
List<SCleanRecords> list = sCleanRecordsMapper.selectList(queryWrapper);
if (list.size() > 0) {
throw new RuntimeException("当前用户有未结束的保洁任务");
}
return updateSCleanRecords(sCleanRecords);
}
private void sendSms(Long storeId,SStore store, SRoom room) {
List<SConsumer> list = sConsumerMapper.selectListByStoreId(storeId);
for (SConsumer consumer : list) {
......
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