From 7005c13237516d5dd965afb1b3c5aa734a01a661 Mon Sep 17 00:00:00 2001 From: wang-hao-jie <1550036656@qq.com> Date: 星期三, 23 三月 2022 17:27:59 +0800 Subject: [PATCH] 最新版本 --- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java | 45 ++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IDuoZhengServiceImpl.java | 36 ++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java | 47 --- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderDealScheduleImpl.java | 14 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderLogService.java | 18 + xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderSynScheduleImpl.java | 90 +++-- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java | 21 + xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderLog.java | 34 ++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/DuoZhengMapper.java | 20 + xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderLogServiceImpl.java | 37 ++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java | 12 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java | 107 ++++++- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderLogMapper.java | 36 ++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/DuoZheng.java | 39 ++ xboot-modules/xboot-your/src/main/resources/mapper/OrderLogMapper.xml | 5 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java | 19 + xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IDuoZhengService.java | 17 + xboot-modules/xboot-generator/src/main/java/cn/exrick/xboot/generator/XbootMPGenerator.java | 4 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DuoZhengController.java | 77 +++++ xboot-modules/xboot-your/src/main/resources/mapper/DuoZhengMapper.xml | 5 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java | 28 + xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderLogController.java | 77 +++++ 22 files changed, 661 insertions(+), 127 deletions(-) diff --git a/xboot-modules/xboot-generator/src/main/java/cn/exrick/xboot/generator/XbootMPGenerator.java b/xboot-modules/xboot-generator/src/main/java/cn/exrick/xboot/generator/XbootMPGenerator.java index 0575311..7da3175 100644 --- a/xboot-modules/xboot-generator/src/main/java/cn/exrick/xboot/generator/XbootMPGenerator.java +++ b/xboot-modules/xboot-generator/src/main/java/cn/exrick/xboot/generator/XbootMPGenerator.java @@ -33,13 +33,13 @@ * 瀹炰綋绫诲悕 * 寤鸿浠呴渶淇敼 */ - private static final String CLASS_NAME = "OrderTask2"; + private static final String CLASS_NAME = "DuoZheng"; /** * 绫昏鏄庢弿杩� * 寤鸿浠呴渶淇敼 */ - private static final String DESCRIPTION = "璁㈠崟浠诲姟鍘嗗彶琛�"; + private static final String DESCRIPTION = "涓�鎴峰璇佽〃"; /** * 浣滆�呭悕 diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DuoZhengController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DuoZhengController.java new file mode 100644 index 0000000..ae8431f --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DuoZhengController.java @@ -0,0 +1,77 @@ +package cn.exrick.xboot.your.controller; + +import cn.exrick.xboot.core.common.utils.PageUtil; +import cn.exrick.xboot.core.common.utils.ResultUtil; +import cn.exrick.xboot.core.common.vo.PageVo; +import cn.exrick.xboot.core.common.vo.Result; +import cn.exrick.xboot.your.entity.DuoZheng; +import cn.exrick.xboot.your.service.IDuoZhengService; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author whj + */ +@Slf4j +@RestController +@Api(tags = "涓�鎴峰璇佽〃绠$悊鎺ュ彛") +@RequestMapping("/xboot/duoZheng") +@Transactional +public class DuoZhengController { + + @Autowired + private IDuoZhengService iDuoZhengService; + + @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) + @ApiOperation(value = "閫氳繃id鑾峰彇") + public Result<DuoZheng> get(@PathVariable String id) { + + DuoZheng duoZheng = iDuoZhengService.getById(id); + return new ResultUtil<DuoZheng>().setData(duoZheng); + } + + @RequestMapping(value = "/getAll", method = RequestMethod.GET) + @ApiOperation(value = "鑾峰彇鍏ㄩ儴鏁版嵁") + public Result<List<DuoZheng>> getAll() { + + List<DuoZheng> list = iDuoZhengService.list(); + return new ResultUtil<List<DuoZheng>>().setData(list); + } + + @RequestMapping(value = "/getByPage", method = RequestMethod.GET) + @ApiOperation(value = "鍒嗛〉鑾峰彇") + public Result<IPage<DuoZheng>> getByPage(PageVo page) { + + IPage<DuoZheng> data = iDuoZhengService.page(PageUtil.initMpPage(page)); + return new ResultUtil<IPage<DuoZheng>>().setData(data); + } + + @RequestMapping(value = "/insertOrUpdate", method = RequestMethod.POST) + @ApiOperation(value = "缂栬緫鎴栨洿鏂版暟鎹�") + public Result<DuoZheng> saveOrUpdate(DuoZheng duoZheng) { + + if (iDuoZhengService.saveOrUpdate(duoZheng)) { + return new ResultUtil<DuoZheng>().setData(duoZheng); + } + return new ResultUtil<DuoZheng>().setErrorMsg("鎿嶄綔澶辫触"); + } + + @RequestMapping(value = "/delByIds", method = RequestMethod.POST) + @ApiOperation(value = "鎵归噺閫氳繃id鍒犻櫎") + public Result<Object> delAllByIds(@RequestParam String[] ids) { + + for (String id : ids) { + iDuoZhengService.removeById(id); + } + return ResultUtil.success("鎵归噺閫氳繃id鍒犻櫎鏁版嵁鎴愬姛"); + } +} diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java index 26ef18c..3d50971 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java @@ -59,11 +59,19 @@ return new ResultUtil<Fingerprint>().setData(fingerprint); } + @RequestMapping(value = "/getAreaIdByToken", method = RequestMethod.GET) + @ApiOperation(value = "鏍规嵁token鑾峰彇鍖哄煙id") + public Result<Object> getAreaIdByToken() { + Area area = getArea(securityUtil.getCurrUser().getId()); + return new ResultUtil<Object>().setData(area); + } + @RequestMapping(value = "/getAll", method = RequestMethod.GET) @ApiOperation(value = "鑾峰彇鍏ㄩ儴鍙告満鍜岄厤閫佸憳鎸囩汗鏁版嵁") public Result<List<Fingerprint>> getAll() { QueryWrapper<Fingerprint> wrapper = new QueryWrapper<>(); wrapper.isNotNull("user_id"); + wrapper.isNotNull("file_id"); List<Fingerprint> list = iFingerprintService.list(wrapper); return new ResultUtil<List<Fingerprint>>().setData(list); } @@ -81,21 +89,35 @@ return new ResultUtil<List<Fingerprint>>().setData(list); } - public Area getArea(String userId){ - QueryWrapper<Area> wrapper = new QueryWrapper<Area>(); - wrapper.eq("user_id",userId); - Area area = iAreaService.getOne(wrapper); - if(area==null){ - QueryWrapper<Car> carQueryWrapper = new QueryWrapper<Car>(); - carQueryWrapper.eq("user_id",userId); - Car one = iCarService.getOne(carQueryWrapper); +// public Area getArea(String userId){ +// QueryWrapper<Area> wrapper = new QueryWrapper<Area>(); +// wrapper.eq("user_id",userId); +// Area area = iAreaService.getOne(wrapper); +// if(area==null){ +// QueryWrapper<Car> carQueryWrapper = new QueryWrapper<Car>(); +// carQueryWrapper.eq("user_id",userId); +// Car one = iCarService.getOne(carQueryWrapper); +// +// QueryWrapper<Area> wrapper3 = new QueryWrapper<Area>(); +// wrapper3.eq("user_id",one.getFollowUserId()); +// area = iAreaService.getOne(wrapper3); +// return area; +// } +// return area; +// } - QueryWrapper<Area> wrapper3 = new QueryWrapper<Area>(); - wrapper3.eq("user_id",one.getFollowUserId()); - area = iAreaService.getOne(wrapper3); + public Area getArea(String userId){ + QueryWrapper<Car> carQueryWrapper = new QueryWrapper<Car>(); + carQueryWrapper.eq("user_id",userId).or().eq("follow_user_id",userId); + Car one = iCarService.getOne(carQueryWrapper); + if(one==null){ + return null; + }else{ + QueryWrapper<Area> wrapper = new QueryWrapper<Area>(); + wrapper.eq("car_id",one.getId()); + Area area = iAreaService.getOne(wrapper); return area; } - return area; } @RequestMapping(value = "/getCount", method = RequestMethod.GET) @@ -166,28 +188,63 @@ @RequestMapping(value = "/getCode", method = RequestMethod.GET) @ApiOperation(value = "鑾峰彇鍙告満鎴栭厤閫佸憳鎸囩汗缂栧彿") public Result<Object> getCode() { - int code = iFingerprintService.maxCode(); - return new ResultUtil<Object>().setData(code); + + User currUser = securityUtil.getCurrUser(); + String userId = currUser.getId(); + + QueryWrapper<Fingerprint> wrapper = new QueryWrapper<Fingerprint>(); + wrapper.eq("user_id",userId); + wrapper.isNull("file_id"); + Fingerprint one = iFingerprintService.getOne(wrapper); + if(one!=null){ + return new ResultUtil<Object>().setData(one.getCode()); + }else{ + int code = iFingerprintService.maxCode(); + + Fingerprint fingerprint = new Fingerprint(); + fingerprint.setUserId(userId); + fingerprint.setType(currUser.getType2()); + fingerprint.setCode(code); + fingerprint.setUsername(currUser.getUsername()); + fingerprint.setPassword(currUser.getDescription()); + iFingerprintService.saveOrUpdate(fingerprint); + return new ResultUtil<Object>().setData(code); + } } @RequestMapping(value = "/insertOrUpdate", method = RequestMethod.POST) @ApiOperation(value = "缂栬緫鎴栨洿鏂版暟鎹�") public Result<Fingerprint> saveOrUpdate(Fingerprint fingerprint) { + if(StrUtil.isEmpty(fingerprint.getFileId())){ + return ResultUtil.error("fileId涓嶈兘涓虹┖"); + } + if(StrUtil.isNotEmpty(fingerprint.getUserId())){ + QueryWrapper<Fingerprint> wp = new QueryWrapper<Fingerprint>(); + wp.eq("code",fingerprint.getCode()); + wp.isNotNull("user_id"); + List<Fingerprint> f = iFingerprintService.list(wp); + if(f.size()>1){ + return ResultUtil.error("code閲嶅锛岃閲嶆柊鑾峰彇code骞跺綍鍏ユ寚绾�"); + } QueryWrapper<Fingerprint> wrapper = new QueryWrapper<Fingerprint>(); wrapper.eq("code",fingerprint.getCode()); - wrapper.isNotNull("user_id"); + wrapper.eq("user_id",fingerprint.getUserId()); Fingerprint one = iFingerprintService.getOne(wrapper); if(one!=null){ - return ResultUtil.error("code閲嶅浜嗭紝璇烽噸鏂拌幏鍙�"); + one.setFileId(fingerprint.getFileId()); +// User user = userService.get(fingerprint.getUserId()); +// one.setUsername(user.getUsername()); +// one.setPassword(user.getDescription()); +// one.setType(user.getType2()); + iFingerprintService.saveOrUpdate(one); + }else{ + return ResultUtil.error("鏈壘鍒伴渶瑕佹洿鏂扮殑鎸囩汗"); } - User user = userService.get(fingerprint.getUserId()); - fingerprint.setUsername(user.getUsername()); - fingerprint.setPassword(user.getDescription()); - fingerprint.setType(user.getType2()); } + if(StrUtil.isNotEmpty(fingerprint.getCustomerId())){ Customer byId = iCustomerService.getById(fingerprint.getCustomerId()); fingerprint.setAreaId(byId.getAreaId()); @@ -200,16 +257,20 @@ if(one!=null){ return ResultUtil.error("code閲嶅浜嗭紝璇烽噸鏂拌幏鍙�"); } + }else{ + return ResultUtil.error("customerId涓嶈兘涓虹┖"); } if(StrUtil.isNotEmpty(fingerprint.getCustomerReceiveId())){ CustomerReceive byId = iCustomerReceiveService.getById(fingerprint.getCustomerReceiveId()); byId.setFstatus(1); iCustomerReceiveService.saveOrUpdate(byId); + + if (iFingerprintService.saveOrUpdate(fingerprint)) { + return new ResultUtil<Fingerprint>().setData(fingerprint); + } } - if (iFingerprintService.saveOrUpdate(fingerprint)) { - return new ResultUtil<Fingerprint>().setData(fingerprint); - } + return new ResultUtil<Fingerprint>().setErrorMsg("鎿嶄綔澶辫触"); } diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderLogController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderLogController.java new file mode 100644 index 0000000..0e2941b --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderLogController.java @@ -0,0 +1,77 @@ +package cn.exrick.xboot.your.controller; + +import cn.exrick.xboot.core.common.utils.PageUtil; +import cn.exrick.xboot.core.common.utils.ResultUtil; +import cn.exrick.xboot.core.common.vo.PageVo; +import cn.exrick.xboot.core.common.vo.Result; +import cn.exrick.xboot.your.entity.OrderLog; +import cn.exrick.xboot.your.service.IOrderLogService; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author whj + */ +@Slf4j +@RestController +@Api(tags = "璁㈠崟鏃ュ織琛ㄧ鐞嗘帴鍙�") +@RequestMapping("/xboot/orderLog") +@Transactional +public class OrderLogController { + + @Autowired + private IOrderLogService iOrderLogService; + + @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) + @ApiOperation(value = "閫氳繃id鑾峰彇") + public Result<OrderLog> get(@PathVariable String id) { + + OrderLog orderLog = iOrderLogService.getById(id); + return new ResultUtil<OrderLog>().setData(orderLog); + } + + @RequestMapping(value = "/getAll", method = RequestMethod.GET) + @ApiOperation(value = "鑾峰彇鍏ㄩ儴鏁版嵁") + public Result<List<OrderLog>> getAll() { + + List<OrderLog> list = iOrderLogService.list(); + return new ResultUtil<List<OrderLog>>().setData(list); + } + + @RequestMapping(value = "/getByPage", method = RequestMethod.GET) + @ApiOperation(value = "鍒嗛〉鑾峰彇") + public Result<IPage<OrderLog>> getByPage(PageVo page) { + + IPage<OrderLog> data = iOrderLogService.page(PageUtil.initMpPage(page)); + return new ResultUtil<IPage<OrderLog>>().setData(data); + } + + @RequestMapping(value = "/insertOrUpdate", method = RequestMethod.POST) + @ApiOperation(value = "缂栬緫鎴栨洿鏂版暟鎹�") + public Result<OrderLog> saveOrUpdate(OrderLog orderLog) { + + if (iOrderLogService.saveOrUpdate(orderLog)) { + return new ResultUtil<OrderLog>().setData(orderLog); + } + return new ResultUtil<OrderLog>().setErrorMsg("鎿嶄綔澶辫触"); + } + + @RequestMapping(value = "/delByIds", method = RequestMethod.POST) + @ApiOperation(value = "鎵归噺閫氳繃id鍒犻櫎") + public Result<Object> delAllByIds(@RequestParam String[] ids) { + + for (String id : ids) { + iOrderLogService.removeById(id); + } + return ResultUtil.success("鎵归噺閫氳繃id鍒犻櫎鏁版嵁鎴愬姛"); + } +} diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java index 47dd585..108a99a 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java @@ -67,6 +67,9 @@ @Autowired private IEventLogService iEventLogService; + @Autowired + private IOrderLogService iOrderLogService; + @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) @ApiOperation(value = "閫氳繃id鑾峰彇") public Result<OrderTask> get(@PathVariable String id) { @@ -315,9 +318,25 @@ eventLog.setRefId(orderId); eventLog.setType(6);//6:閰嶉�佸畬鎴� iEventLogService.saveOrUpdate(eventLog); + + saveLog(); return ResultUtil.success("娣诲姞鎴愬姛"); } + private void saveLog(){ + QueryWrapper<OrderLog> wp = new QueryWrapper<>(); + wp.eq("type",2); + OrderLog one = iOrderLogService.getOne(wp); + if(one!=null){ + one.setNum(one.getNum()+1); + }else{ + one = new OrderLog(); + one.setNum(1); + one.setType(2); + } + iOrderLogService.saveOrUpdate(one); + } + @RequestMapping(value = "/getTaKan", method = RequestMethod.GET) @ApiOperation(value = "鑾峰彇韪忓嫎鍟嗘埛") public Result<List<Customer>> getTaKan() { diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java index d251fff..66973a5 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/Statistic2Controller.java @@ -3,11 +3,8 @@ import cn.exrick.xboot.core.common.utils.ResultUtil; import cn.exrick.xboot.core.common.vo.Result; import cn.exrick.xboot.your.entity.Car; -import cn.exrick.xboot.your.service.IEventLogService; -import cn.exrick.xboot.your.service.IOrderTaskService; +import cn.exrick.xboot.your.service.*; import cn.exrick.xboot.your.vo.Month; -import cn.exrick.xboot.your.service.ICarService; -import cn.exrick.xboot.your.service.ICustomerService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -33,16 +30,15 @@ @Autowired private ICustomerService iCustomerService; @Autowired - private IOrderTaskService iOrderTaskService; - @Autowired private IEventLogService iEventLogService; + @Autowired + private IOrderLogService iOrderLogService; @RequestMapping(value = "/getCarCount", method = RequestMethod.GET) @ApiOperation(value = "鑾峰彇杞﹁締鏁扮洰") public Result<Object> getCarCount() { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); - QueryWrapper<Car> wrapper = new QueryWrapper<>(); int m = cal.get(Calendar.MONTH) + 1; @@ -76,7 +72,6 @@ public Result<Object> getCustomerCount() { Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); - QueryWrapper<Car> wrapper = new QueryWrapper<>(); int m = cal.get(Calendar.MONTH) + 1; @@ -111,7 +106,7 @@ int year = cal.get(Calendar.YEAR); QueryWrapper<Car> wrapper = new QueryWrapper<>(); - Month month= iOrderTaskService.getSendNum(year); + Month month= iOrderLogService.getSendNum(year); List<Integer> list = new ArrayList<>(); if (month==null) { month = new Month(); @@ -128,40 +123,6 @@ list.add(month.getOctober()/10000); list.add(month.getNovember()/10000); list.add(month.getDecember()/10000); - return new ResultUtil<Object>().setData(list); - } - - @RequestMapping(value = "/getAvgNum", method = RequestMethod.GET) - @ApiOperation(value = "鑾峰彇鍟嗘埛骞冲潎閫佽揣鏁伴噺") - public Result<Object> getAvgNum() { - Calendar cal = Calendar.getInstance(); - int year = cal.get(Calendar.YEAR); - QueryWrapper<Car> wrapper = new QueryWrapper<>(); - - Month month= iCustomerService.getCustomerCount(year); - Month month2= iOrderTaskService.getSendNum(year); - - List<Integer> list = new ArrayList<>(); - - if (month==null) { - month = new Month(); - } - if (month2==null){ - month2=new Month(); - } - list.add(month.getJanuary()!=0 ? (month2.getJanuary()/month.getJanuary()) : 0); - list.add(month.getFebruary()!=0 ? (month2.getFebruary()/month.getFebruary()) : 0); - list.add(month.getMarch()!=0 ? (month2.getMarch()/month.getMarch()) : 0); - list.add(month.getApril()!=0 ? (month2.getApril()/month.getApril()) : 0); - list.add(month.getMay()!=0 ? (month2.getMay()/month.getMay()) : 0); - list.add(month.getJune()!=0 ? (month2.getJune()/month.getJune()) : 0); - list.add(month.getJuly()!=0 ? (month2.getJuly()/month.getJuly()) : 0); - list.add(month.getAugust()!=0 ? (month2.getAugust()/month.getAugust()) : 0); - list.add(month.getSeptember()!=0 ? (month2.getSeptember()/month.getSeptember()) : 0); - list.add(month.getOctober()!=0 ? (month2.getOctober()/month.getOctober()) : 0); - list.add(month.getNovember()!=0 ? (month2.getNovember()/month.getNovember()) : 0); - list.add(month.getDecember()!=0 ? (month2.getDecember()/month.getDecember()) : 0); - return new ResultUtil<Object>().setData(list); } diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java index fda9a15..8f83c38 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/pc/StatisticController.java @@ -65,6 +65,12 @@ @Autowired private ICustomerService iCustomerService; + @Autowired + private ICustomerReceiveService iCustomerReceiveService; + + @Autowired + private IDuoZhengService iDuoZhengService; + @RequestMapping(value = "/getIndex1", method = RequestMethod.GET) @ApiOperation(value = "鑾峰彇棣栭〉鏁版嵁") public Result<Object> getIndex1() { @@ -286,25 +292,50 @@ @ApiOperation(value = "鑾峰彇閰嶉�佸垎鏋愯鎯�") public Result<Object> getYiHuDuoZheng() { - List<Customer> list = iCustomerService.getYiHuDuoZheng(); +// List<Customer> list = iCustomerService.getYiHuDuoZheng(); +// Map<String,Object> map = new HashMap<>(); +// map.put("name","涓�鎴峰璇�"); +// List<Object> childrens = new ArrayList<>(); +// for(Customer c:list){ +// Map<String,Object> map2 = new HashMap<>(); +// map2.put("name",c.getName()); +// +// List<Object> names = new ArrayList<>(); +// Map<String,Object> map3 = new HashMap<>(); +// map3.put("name",c.getCode()); +// names.add(map3); +// +// map2.put("children",names); +// +// childrens.add(map2); +// } +// map.put("children",childrens); + + + List<String> list = iDuoZhengService.getNames(); Map<String,Object> map = new HashMap<>(); map.put("name","涓�鎴峰璇�"); List<Object> childrens = new ArrayList<>(); - for(Customer c:list){ + for(String c:list){ Map<String,Object> map2 = new HashMap<>(); - map2.put("name",c.getName()); + map2.put("name",c); List<Object> names = new ArrayList<>(); - Map<String,Object> map3 = new HashMap<>(); - map3.put("name",c.getCode()); - names.add(map3); + + QueryWrapper<DuoZheng> wp = new QueryWrapper<>(); + wp.eq("name",c); + List<DuoZheng> list1 = iDuoZhengService.list(wp); + for(DuoZheng dz:list1){ + Map<String,Object> map3 = new HashMap<>(); + map3.put("name",dz.getCustomerName()); + names.add(map3); + } map2.put("children",names); childrens.add(map2); } map.put("children",childrens); - return new ResultUtil<Object>().setData(map); } } diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java index 2fb7607..82bb1a3 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java @@ -56,6 +56,9 @@ @Autowired private ICustomerReceiveService iCustomerReceiveService; + @Autowired + private IOrderLogService iOrderLogService; + //2.寰俊鐧婚檰 @RequestMapping(value = "/login", method = RequestMethod.POST) @@ -117,7 +120,7 @@ } Customer one = iCustomerService.getOne(wrapper); if(one==null){ - return ResultUtil.error("闆跺敭璁稿彲璇佹棤鏁�");//棣栨鐧婚檰闇�缁戝畾闆跺敭璁稿彲璇� + return ResultUtil.error("璇锋鏌ヨ緭鍏ヤ俊鎭槸鍚︽纭�");//棣栨鐧婚檰闇�缁戝畾闆跺敭璁稿彲璇� }else { one.setOpenId(openId); iCustomerService.saveOrUpdate(one); @@ -217,9 +220,25 @@ } order.setLikes(1); iOrderTaskService.saveOrUpdate(order); + + saveLog(); return ResultUtil.success("鍔╁姏鎴愬姛"); } + private void saveLog(){ + QueryWrapper<OrderLog> wp = new QueryWrapper<>(); + wp.eq("type",1); + OrderLog one = iOrderLogService.getOne(wp); + if(one!=null){ + one.setNum(one.getNum()+1); + }else{ + one = new OrderLog(); + one.setNum(1); + one.setType(1); + } + iOrderLogService.saveOrUpdate(one); + } + //7.鑾峰彇璁㈠崟鍒楄〃 @RequestMapping(value = "/getOrderList", method = RequestMethod.POST) @ApiOperation(value = "鑾峰彇璁㈠崟鍒楄〃") diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/DuoZheng.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/DuoZheng.java new file mode 100644 index 0000000..c9f7c16 --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/DuoZheng.java @@ -0,0 +1,39 @@ +package cn.exrick.xboot.your.entity; + +import cn.exrick.xboot.core.base.XbootBaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.persistence.Transient; + +/** + * @author Exrick + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@Table(name = "t_duo_zheng") +@TableName("t_duo_zheng") +@ApiModel(value = "涓�鎴峰璇佽〃") +public class DuoZheng extends XbootBaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "鍟嗘埛鍚嶇О") + private String customerName; + + @ApiModelProperty(value = "鍚嶇О") + private String name; + + @ApiModelProperty(value = "鑱旂郴鏂瑰紡") + private String phone; + +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderLog.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderLog.java new file mode 100644 index 0000000..11bbb37 --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderLog.java @@ -0,0 +1,34 @@ +package cn.exrick.xboot.your.entity; + +import cn.exrick.xboot.core.base.XbootBaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @author Exrick + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@Table(name = "t_order_log") +@TableName("t_order_log") +@ApiModel(value = "璁㈠崟鏃ュ織琛�") +public class OrderLog extends XbootBaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "浠婃棩璁㈠崟鎬绘暟") + private int num; + + @ApiModelProperty(value = "0:浠婃棩璁㈠崟鏁� 1锛氫簰鍔ㄦ暟 2锛氱數瀛愮鏀舵暟") + private int type; + +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/DuoZhengMapper.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/DuoZhengMapper.java new file mode 100644 index 0000000..c742f0d --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/DuoZhengMapper.java @@ -0,0 +1,20 @@ +package cn.exrick.xboot.your.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import cn.exrick.xboot.your.entity.DuoZheng; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 涓�鎴峰璇佽〃鏁版嵁澶勭悊灞� + * @author whj + */ +public interface DuoZhengMapper extends BaseMapper<DuoZheng> { + + @Select("select DISTINCT(c.name) as customer_name,a.name,a.phone from t_customer_receive a,t_customer_receive b,t_customer c where a.name=b.name and a.phone=b.phone and a.customer_id<>b.customer_id and a.customer_id = c.id") + List<DuoZheng> getYiHuDuoZheng(); + + @Select("select DISTINCT(name) from t_duo_zheng") + List<String> getNames(); +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderLogMapper.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderLogMapper.java new file mode 100644 index 0000000..ec045eb --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderLogMapper.java @@ -0,0 +1,36 @@ +package cn.exrick.xboot.your.mapper; + +import cn.exrick.xboot.your.vo.Month; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import cn.exrick.xboot.your.entity.OrderLog; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * 璁㈠崟鏃ュ織琛ㄦ暟鎹鐞嗗眰 + * @author whj + */ +public interface OrderLogMapper extends BaseMapper<OrderLog> { + + @Select("SELECT sum(num) FROM t_order_log where type=0") + int sumNum(); + + @Select("select \n" + + "sum(case month(t.create_time) when '1' then t.num else 0 end) as january,\n" + + "sum(case month(t.create_time) when '2' then t.num else 0 end) as february,\n" + + "sum(case month(t.create_time) when '3' then t.num else 0 end) as march,\n" + + "sum(case month(t.create_time) when '4' then t.num else 0 end) as april,\n" + + "sum(case month(t.create_time) when '5' then t.num else 0 end) as may,\n" + + "sum(case month(t.create_time) when '6' then t.num else 0 end) as june,\n" + + "sum(case month(t.create_time) when '7' then t.num else 0 end) as july,\n" + + "sum(case month(t.create_time) when '8' then t.num else 0 end) as august,\n" + + "sum(case month(t.create_time) when '9' then t.num else 0 end) as september,\n" + + "sum(case month(t.create_time) when '10' then t.num else 0 end) as october,\n" + + "sum(case month(t.create_time) when '11' then t.num else 0 end) as november,\n" + + "sum(case month(t.create_time) when '12' then t.num else 0 end) as december\n" + + "from t_order_log t\n" + + "where year(t.create_time)=#{year} and type=0") + Month getSendNum(@Param("year")int year); +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderDealScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderDealScheduleImpl.java index eb31242..a78ba90 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderDealScheduleImpl.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderDealScheduleImpl.java @@ -9,6 +9,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import java.util.List; //鍒犻櫎鍘嗗彶鏁版嵁 @Component @@ -26,8 +27,11 @@ @Autowired private IOrderDetailService iOrderDetailService; + @Autowired + private IDuoZhengService iDuoZhengService; + @Scheduled(cron="0 0 21 * * ?")//姣忔櫄涓嬪崍9鐐规墽琛� - //@Scheduled(cron="0 * * * * ?")//娴嬭瘯 + //@Scheduled(cron="0 33 17 * * ?")//娴嬭瘯 public void execute(){ String day = getDay(-8); QueryWrapper<OrderTask> wrapper = new QueryWrapper<>(); @@ -38,7 +42,7 @@ wrapper2.lt("create_time",day+" 00:00:00"); iOrderDetailService.remove(wrapper2); - String day2 = getDay(-31); + String day2 = getDay(-30); QueryWrapper<OrderTaskOriginal> wrapper3 = new QueryWrapper<>(); wrapper3.lt("create_time",day2+" 00:00:00"); iOrderTaskOriginalService.remove(wrapper3); @@ -46,6 +50,12 @@ QueryWrapper<OrderDetailOriginal> wrapper4 = new QueryWrapper<>(); wrapper4.lt("create_time",day2+" 00:00:00"); iOrderDetailOriginalService.remove(wrapper4); + + QueryWrapper<DuoZheng> wrapper5 = new QueryWrapper<>(); + iDuoZhengService.remove(wrapper5); + + List<DuoZheng> list = iDuoZhengService.getYiHuDuoZheng(); + iDuoZhengService.saveBatch(list); } private String getDay(int day){ diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderSynScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderSynScheduleImpl.java index 154a2db..22046d7 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderSynScheduleImpl.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/OrderSynScheduleImpl.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -38,50 +39,65 @@ @Autowired private ICustomerReceiveService iCustomerReceiveService; + @Autowired + private IOrderLogService iOrderLogService; + @Scheduled(cron="0 30 23 * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛� - //@Scheduled(cron="0 22 11 * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛� + //@Scheduled(cron="0 11 15 * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛� public void execute(){ System.out.println("寮�濮嬪鐞嗚鍗�"); QueryWrapper<OrderTaskOriginal> queryWrapper = new QueryWrapper<>(); queryWrapper.between("create_time",dateStringFormat(new Date()),dateStringFormat2(new Date())); List<OrderTaskOriginal> list = iOrderTaskOriginalService.list(queryWrapper); + int sumNum = 0; for(OrderTaskOriginal original:list){ - OrderTask orderTask = new OrderTask(); - orderTask.setCode(original.getCode()); - Area area = getArea(original.getAreaName()); - orderTask.setAreaId(area.getId()); - orderTask.setCarId(area.getCarId()); - orderTask.setAreaSectionId(getAreaSection(orderTask.getAreaId(),original.getAreaSection())); - orderTask.setCustomerId(getCustomer(original.getCustomerCode(),original.getCustomerName(),original.getCustomerPhone(),original.getLinker(),orderTask.getAreaId(),orderTask.getAreaSectionId())); - orderTask.setEndDate(original.getPacketDate()); - orderTask.setSendDate(original.getSendDate()); - orderTask.setOrderDate(original.getOrderDate()); - if(original.getSeq()!=null){ - orderTask.setSeq(original.getSeq()); - }else{ - orderTask.setSeq(999); + try { + OrderTask orderTask = new OrderTask(); + orderTask.setCode(original.getCode()); + Area area = getArea(original.getAreaName()); + orderTask.setAreaId(area.getId()); + orderTask.setCarId(area.getCarId()); + orderTask.setAreaSectionId(getAreaSection(orderTask.getAreaId(),original.getAreaSection())); + orderTask.setCustomerId(getCustomer(original.getCustomerCode(),original.getCustomerName(),original.getCustomerPhone(),original.getLinker(),orderTask.getAreaId(),orderTask.getAreaSectionId())); + orderTask.setEndDate(original.getPacketDate()); + orderTask.setSendDate(original.getSendDate()); + orderTask.setOrderDate(original.getOrderDate()); + if(original.getSeq()!=null){ + orderTask.setSeq(original.getSeq()); + }else{ + orderTask.setSeq(999); + } + + orderTask.setNum(original.getNum()); + sumNum+=original.getNum(); + + iOrderTaskService.saveOrUpdate(orderTask); + + updateCustomerRecive(orderTask.getCustomerId(),original.getLinker(),original.getCustomerPhone()); + + QueryWrapper<OrderDetailOriginal> wrapper = new QueryWrapper<>(); + wrapper.eq("order_id",original.getId()); + List<OrderDetailOriginal> list1 = iOrderDetailOriginalService.list(wrapper); + + List<OrderDetail> detailList = new ArrayList<>(); + for(OrderDetailOriginal o:list1){ + OrderDetail orderDetail = new OrderDetail(); + orderDetail.setNum(o.getNum()); + orderDetail.setOrderId(orderTask.getId()); + orderDetail.setProduct(o.getProductName()); + detailList.add(orderDetail); + } + iOrderDetailService.saveBatch(detailList); + }catch (Exception e){ + } - - orderTask.setNum(original.getNum()); - - iOrderTaskService.saveOrUpdate(orderTask); - - updateCustomerRecive(orderTask.getCustomerId(),original.getLinker(),original.getCustomerPhone()); - - QueryWrapper<OrderDetailOriginal> wrapper = new QueryWrapper<>(); -// wrapper.between("create_time",dateStringFormat(new Date()),dateStringFormat2(new Date())); - wrapper.eq("order_id",original.getId()); - List<OrderDetailOriginal> list1 = iOrderDetailOriginalService.list(wrapper); - for(OrderDetailOriginal o:list1){ - OrderDetail orderDetail = new OrderDetail(); - orderDetail.setNum(o.getNum()); - orderDetail.setOrderId(orderTask.getId()); - orderDetail.setProduct(o.getProductName()); - iOrderDetailService.saveOrUpdate(orderDetail); - } - } + + OrderLog orderLog = new OrderLog(); + orderLog.setNum(sumNum); + orderLog.setType(0); + iOrderLogService.save(orderLog); System.out.println("澶勭悊璁㈠崟缁撴潫"); } @@ -90,9 +106,9 @@ QueryWrapper<CustomerReceive> wrapper = new QueryWrapper<>(); wrapper.eq("customer_id",customerId); wrapper.eq("name",linker); - CustomerReceive one = iCustomerReceiveService.getOne(wrapper); - if(one==null){ - one = new CustomerReceive(); + List<CustomerReceive> list = iCustomerReceiveService.list(wrapper); + if(list.size()==0){ + CustomerReceive one = new CustomerReceive(); one.setCustomerId(customerId); one.setFstatus(0); one.setStatus(1); diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java index c1d17a5..4b6bb0a 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPcScheduleImpl.java @@ -48,6 +48,9 @@ @Autowired private IEventLogService eventLogService; + @Autowired + private IOrderLogService iOrderLogService; + public static final String HEAD = "statistic1::"; @Scheduled(cron="0 15 * * * ?")//姣忓皬鏃�15鍒嗛挓鏃舵墽琛� @@ -58,12 +61,13 @@ redisTemplate.set(HEAD+"dept","3");//杞繍绔欐暟 redisTemplate.set(HEAD+"area",iAreaService.count()+"");//鐗囧尯鏁� - redisTemplate.set(HEAD+"customer",iCustomerService.count()+"");//鍟嗘埛鏁� + int customNum = iCustomerService.count(); + redisTemplate.set(HEAD+"customer",customNum+"");//鍟嗘埛鏁� redisTemplate.set(HEAD+"out",iDrivingRecordService.count()+"");//鍑鸿溅娆℃暟 redisTemplate.set(HEAD+"driving",iUserStatisticService.sumDriving()+"");//琛岄┒閲岀▼ - redisTemplate.set(HEAD+"num",iOrderTaskService.sumNum()+"");//閫佽揣鍖呮暟 - redisTemplate.set(HEAD+"status",iOrderTaskService.sumStatus(1)+"");//鐢靛瓙绛炬敹娆℃暟 + redisTemplate.set(HEAD+"num",iOrderLogService.sumNum()+"");//閫佽揣鍖呮暟 + redisTemplate.set(HEAD+"status",getNum(2)+"");//鐢靛瓙绛炬敹娆℃暟 redisTemplate.set(HEAD+"notice",messageService.getTotalCount()+"");//閫氱煡鍏憡鏉℃暟 redisTemplate.set(HEAD+"video","0");//瑙嗛鐩戞帶娆℃暟 @@ -72,13 +76,14 @@ redisTemplate.set(HEAD+"wx",iCustomerService.sumLogin()+"");//灏忕▼搴忕櫥闄嗘鏁� redisTemplate.set(HEAD+"wxRate",iCustomerService.countOpenId()+"");//灏忕▼搴忎娇鐢ㄧ巼 - int i = iOrderTaskService.countLike(); + + int i = getNum(1); redisTemplate.set(HEAD+"like",i+"");//浜掑姩娆℃暟 - int count = iOrderTaskService.count(); + int count = iOrderLogService.sumNum(); if(count==0){ redisTemplate.set(HEAD+"likeRate","0");//浜掑姩鐜� }else{ - redisTemplate.set(HEAD+"likeRate",(i*100)/count+"");//浜掑姩鐜� + redisTemplate.set(HEAD+"likeRate",(((i*100)/customNum)+1)+"");//浜掑姩鐜� } String format = DateUtil.format(new Date(), "yyyy-MM-dd"); @@ -95,4 +100,15 @@ wrapper.between("create_time",format+" 00:00:00",format+" 23:59:59"); redisTemplate.set(HEAD+"addCustomer",iCustomerService.count(wrapper)+"");//浠婃棩鏂板鍟嗘埛 } + + private int getNum(int type){ + QueryWrapper<OrderLog> wp = new QueryWrapper<>(); + wp.eq("type",type); + OrderLog one = iOrderLogService.getOne(wp); + if(one!=null){ + return one.getNum(); + }else{ + return 0; + } + } } diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java index ea2857e..166f111 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticScheduleImpl.java @@ -39,7 +39,7 @@ @Autowired private ICarService iCarService; - @Scheduled(cron="0 0 1 * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛� + @Scheduled(cron="0 0 5 * * ?")//姣忔櫄鍑屾櫒1鐐规墽琛� public void execute(){ List<User> all = userService.findAll(); for(User user:all){ @@ -95,11 +95,11 @@ int count = iOrderTaskService.count(wrapper2); one.setSends(count);//閰嶉�佹鏁� - QueryWrapper<OrderTask> wrapper22 = new QueryWrapper<>(); - wrapper22.eq("user_id",user.getId()); - wrapper22.eq("status",1); - int count2 = iOrderTaskService.count(wrapper22); - one.setSends2(count2);//閫佽揪娆℃暟 +// QueryWrapper<OrderTask> wrapper22 = new QueryWrapper<>(); +// wrapper22.eq("user_id",user.getId()); +// wrapper22.eq("status",1); +// int count2 = iOrderTaskService.count(wrapper22); + one.setSends2(count);//閫佽揪娆℃暟 // QueryWrapper<Area> wrapper3 = new QueryWrapper<>(); // wrapper3.eq("user_id",user.getId()); diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IDuoZhengService.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IDuoZhengService.java new file mode 100644 index 0000000..5f48c3a --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IDuoZhengService.java @@ -0,0 +1,17 @@ +package cn.exrick.xboot.your.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import cn.exrick.xboot.your.entity.DuoZheng; + +import java.util.List; + +/** + * 涓�鎴峰璇佽〃鎺ュ彛 + * @author whj + */ +public interface IDuoZhengService extends IService<DuoZheng> { + + List<DuoZheng> getYiHuDuoZheng(); + + List<String> getNames(); +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderLogService.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderLogService.java new file mode 100644 index 0000000..8e9fe22 --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderLogService.java @@ -0,0 +1,18 @@ +package cn.exrick.xboot.your.service; + +import cn.exrick.xboot.your.vo.Month; +import com.baomidou.mybatisplus.extension.service.IService; +import cn.exrick.xboot.your.entity.OrderLog; + +import java.util.List; + +/** + * 璁㈠崟鏃ュ織琛ㄦ帴鍙� + * @author whj + */ +public interface IOrderLogService extends IService<OrderLog> { + + int sumNum(); + + Month getSendNum(int year); +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IDuoZhengServiceImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IDuoZhengServiceImpl.java new file mode 100644 index 0000000..497efef --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IDuoZhengServiceImpl.java @@ -0,0 +1,36 @@ +package cn.exrick.xboot.your.serviceimpl; + +import cn.exrick.xboot.your.mapper.DuoZhengMapper; +import cn.exrick.xboot.your.entity.DuoZheng; +import cn.exrick.xboot.your.service.IDuoZhengService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 涓�鎴峰璇佽〃鎺ュ彛瀹炵幇 + * @author whj + */ +@Slf4j +@Service +@Transactional +public class IDuoZhengServiceImpl extends ServiceImpl<DuoZhengMapper, DuoZheng> implements IDuoZhengService { + + @Autowired + private DuoZhengMapper duoZhengMapper; + + @Override + public List<DuoZheng> getYiHuDuoZheng() { + return duoZhengMapper.getYiHuDuoZheng(); + } + + @Override + public List<String> getNames() { + return duoZhengMapper.getNames(); + } +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderLogServiceImpl.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderLogServiceImpl.java new file mode 100644 index 0000000..0c8dabf --- /dev/null +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderLogServiceImpl.java @@ -0,0 +1,37 @@ +package cn.exrick.xboot.your.serviceimpl; + +import cn.exrick.xboot.your.mapper.OrderLogMapper; +import cn.exrick.xboot.your.entity.OrderLog; +import cn.exrick.xboot.your.service.IOrderLogService; +import cn.exrick.xboot.your.vo.Month; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 璁㈠崟鏃ュ織琛ㄦ帴鍙e疄鐜� + * @author whj + */ +@Slf4j +@Service +@Transactional +public class IOrderLogServiceImpl extends ServiceImpl<OrderLogMapper, OrderLog> implements IOrderLogService { + + @Autowired + private OrderLogMapper orderLogMapper; + + @Override + public int sumNum() { + return orderLogMapper.sumNum(); + } + + @Override + public Month getSendNum(int year) { + return orderLogMapper.getSendNum(year); + } +} \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/resources/mapper/DuoZhengMapper.xml b/xboot-modules/xboot-your/src/main/resources/mapper/DuoZhengMapper.xml new file mode 100644 index 0000000..5495b55 --- /dev/null +++ b/xboot-modules/xboot-your/src/main/resources/mapper/DuoZhengMapper.xml @@ -0,0 +1,5 @@ +<?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="cn.exrick.xboot.your.mapper.DuoZhengMapper"> + +</mapper> \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/resources/mapper/OrderLogMapper.xml b/xboot-modules/xboot-your/src/main/resources/mapper/OrderLogMapper.xml new file mode 100644 index 0000000..7f0a014 --- /dev/null +++ b/xboot-modules/xboot-your/src/main/resources/mapper/OrderLogMapper.xml @@ -0,0 +1,5 @@ +<?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="cn.exrick.xboot.your.mapper.OrderLogMapper"> + +</mapper> \ No newline at end of file -- Gitblit v1.9.1