From 5d802384a6319b70077d813930efc602cd4efa77 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 25 十二月 2024 14:57:54 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/eyes --- optometrist/src/main/resources/mapping/TStoreMapper.xml | 45 + optometrist/src/main/resources/mapping/TInventoryFrameDetailMapper.xml | 30 optometrist/src/main/resources/mapping/TOptometryMapper.xml | 30 manage/src/main/java/com/jilongda/manage/service/TWarehousingService.java | 1 optometrist/src/main/java/com/jilongda/optometrist/model/TLensWarehousingDetail.java | 3 optometrist/src/main/resources/mapping/TBrandMapper.xml | 33 optometrist/src/main/resources/mapping/TAppUserMapper.xml | 45 + optometrist/src/main/resources/mapping/TSupplierMapper.xml | 33 optometrist/src/main/java/com/jilongda/optometrist/service/impl/TWarehousingServiceImpl.java | 2 optometrist/src/main/resources/mapping/SecUserRoleMapper.xml | 31 optometrist/src/main/resources/mapping/TLineUpMapper.xml | 49 + optometrist/src/main/resources/mapping/SecResourcesMapper.xml | 109 +++ manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java | 5 optometrist/src/main/resources/mapping/OperLogMapper.xml | 44 + optometrist/src/main/resources/mapping/SecUserMapper.xml | 167 ++++ optometrist/src/main/resources/mapping/TFrameWarehousingDetailMapper.xml | 60 + optometrist/src/main/resources/mapping/TInventoryMapper.xml | 47 + optometrist/src/main/resources/mapping/LoginLogMapper.xml | 53 + optometrist/src/main/resources/mapping/SecRoleResourceMapper.xml | 16 optometrist/src/main/resources/mapping/TWarehousingMapper.xml | 60 + optometrist/src/main/java/com/jilongda/optometrist/query/TOptometryQuery.java | 22 optometrist/src/main/resources/mapping/SecRoleMapper.xml | 71 + optometrist/src/main/resources/mapping/TMaterialMapper.xml | 28 optometrist/src/main/resources/mapping/TUserMapper.xml | 53 + optometrist/src/main/resources/mapping/TFrameGoods.xml | 52 + optometrist/src/main/resources/mapping/TOrderAftersalesMapper.xml | 50 + optometrist/src/main/resources/mapping/TModelMapper.xml | 47 + optometrist/src/main/resources/mapping/TOrderMapper.xml | 47 + optometrist/src/main/resources/mapping/TLensSeriesMapper.xml | 45 + optometrist/src/main/resources/mapping/TTicketMapper.xml | 40 + optometrist/src/main/resources/mapping/TLensWarehousingDetailMapper.xml | 67 + optometrist/src/main/resources/mapping/TOptometristMapper.xml | 65 + optometrist/src/main/java/com/jilongda/optometrist/query/TWarehousingDetailLensQuery.java | 2 /dev/null | 357 --------- manage/target/classes/application.yml | 14 optometrist/src/main/resources/mapping/TCouponMapper.xml | 41 + optometrist/src/main/resources/mapping/TOptometryDetailMapper.xml | 32 optometrist/src/main/resources/mapping/SecFeeItemsMapper.xml | 23 optometrist/src/main/resources/mapping/TInventoryLensDetailMapper.xml | 30 manage/src/main/java/com/jilongda/manage/service/impl/TWarehousingServiceImpl.java | 3 optometrist/src/main/java/com/jilongda/optometrist/vo/TOptometryVO.java | 16 optometrist/src/main/resources/mapping/SecSettingMapper.xml | 22 optometrist/src/main/resources/mapping/TCouponReceiveMapper.xml | 35 manage/src/main/resources/mapping/TOptometristMapper.xml | 1 optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java | 34 optometrist/src/main/resources/mapping/TOrderAccountingMapper.xml | 32 optometrist/src/main/resources/mapping/TLensGoods.xml | 47 + 47 files changed, 1,731 insertions(+), 408 deletions(-) diff --git a/.idea/eyes.iml b/.idea/eyes.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/eyes.iml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" inherit-compiler-output="true"> - <exclude-output /> - <content url="file://$MODULE_DIR$" /> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> \ No newline at end of file diff --git a/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java index 22a4ee2..b13bd49 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java @@ -156,6 +156,11 @@ PageInfo<TFrameWarehousingDetailVO> frameWarehousingDetailVOPageInfo = warehousingService.detailList(query); return ApiResult.success(frameWarehousingDetailVOPageInfo); } + @ApiOperation(value = "镜片出入库记录列表") + @PostMapping(value = "/detailLensList") + public ApiResult<PageInfo<TLensWarehousingDetailVO>> detailLensList(@RequestBody TWarehousingDetailLensQuery query) { + return ApiResult.success(warehousingService.detailListLens(query)); + } /** * 库存明细记录列表 */ diff --git a/manage/src/main/java/com/jilongda/manage/service/TWarehousingService.java b/manage/src/main/java/com/jilongda/manage/service/TWarehousingService.java index 9834c0c..7d407b6 100644 --- a/manage/src/main/java/com/jilongda/manage/service/TWarehousingService.java +++ b/manage/src/main/java/com/jilongda/manage/service/TWarehousingService.java @@ -37,4 +37,5 @@ PageInfo<TWarehousingLensVO> inventoryReceiptLensList(TWarehousingDetailLensQuery query); PageInfo<TLensWarehousingDetailVO> detailListLens(TWarehousingDetailLensQuery query); + } diff --git a/manage/src/main/java/com/jilongda/manage/service/impl/TWarehousingServiceImpl.java b/manage/src/main/java/com/jilongda/manage/service/impl/TWarehousingServiceImpl.java index 6bd4c4c..8d4953e 100644 --- a/manage/src/main/java/com/jilongda/manage/service/impl/TWarehousingServiceImpl.java +++ b/manage/src/main/java/com/jilongda/manage/service/impl/TWarehousingServiceImpl.java @@ -67,6 +67,9 @@ pageInfo.setRecords(list); return pageInfo; } + + + @Override public PageInfo<TWarehousingVO> inventoryReceiptList(TWarehousingDetailQuery query) { PageInfo<TWarehousingVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); diff --git a/manage/src/main/resources/mapping/TOptometristMapper.xml b/manage/src/main/resources/mapping/TOptometristMapper.xml index cc7051e..fdf7830 100644 --- a/manage/src/main/resources/mapping/TOptometristMapper.xml +++ b/manage/src/main/resources/mapping/TOptometristMapper.xml @@ -55,7 +55,6 @@ <if test="req.startTime != null and req.startTime!=''"> and (t1.createTime between #{req.startTime} and #{req.endTime}) </if> - AND t3.type=1 AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} </where> ORDER BY createTime DESC diff --git a/manage/target/classes/application.yml b/manage/target/classes/application.yml index a48e6c9..05850e2 100644 --- a/manage/target/classes/application.yml +++ b/manage/target/classes/application.yml @@ -1,9 +1,9 @@ server: - port: 9090 + port: 9092 tomcat: max-swallow-size: 500MB - servlet: - context-path: /api +# servlet: +# context-path: /api spring: thymeleaf: cache: false @@ -13,7 +13,7 @@ max-request-size: 500MB resolve-lazily: true #设置为懒加载,不然依然会捕获不到异常 profiles: - active: prod + active: dev main: allow-bean-definition-overriding: true #sagger文档属性配置 @@ -90,8 +90,8 @@ # 数据源 datasource: username: root #测试环境 - password: 123456 - url: jdbc:mysql://127.0.0.1:3306/jilongda?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + password: root + url: jdbc:mysql://192.168.110.64:3306/eyes?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver hikari: @@ -141,7 +141,7 @@ on-profile: prod # 数据源 datasource: - url: jdbc:mysql://127.0.0.1:3306/jilongda?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + url: jdbc:mysql://192.168.110.64:3306/eyes?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root password: Xiwang2024! type: com.zaxxer.hikari.HikariDataSource diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/SecFeeItemsController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/SecFeeItemsController.java deleted file mode 100644 index 7b780c7..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/SecFeeItemsController.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.optometrist.dto.SecFeeItemsDTO; -import com.jilongda.optometrist.model.SecFeeItems; -import com.jilongda.optometrist.service.SecFeeItemsService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * <p> - * 系统设置-收费项设置 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "收费项设置") -@RestController -@RequestMapping("/sec-fee-items") -public class SecFeeItemsController { - - - @Autowired - private SecFeeItemsService secFeeItemsService; - - /** - * 收费项设置 - */ - @ApiOperation(value = "收费项设置查询列表") - @PostMapping(value = "/list") - public ApiResult<List<SecFeeItems>> list() { - return ApiResult.success(secFeeItemsService.list()); - } - - /** - * 查询详情 - */ - @ApiOperation(value = "收费项设置修改") - @PostMapping(value = "/updateList") - public ApiResult<String> updateList(@RequestBody SecFeeItemsDTO dto ) { - List<SecFeeItems> secFeeItemsList = dto.getSecFeeItemsList(); - secFeeItemsService.saveOrUpdateBatch(secFeeItemsList); - return ApiResult.success(); - } - - @ApiOperation(value = "收费项设置启用禁用") - @GetMapping(value = "/upAndDown") - public ApiResult<Boolean> upAndDown(@RequestParam Long id, - @RequestParam Integer status) { - return ApiResult.success(secFeeItemsService.upAndDown(id,status)); - } - - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/SecSettingController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/SecSettingController.java deleted file mode 100644 index 3b090aa..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/SecSettingController.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.optometrist.model.SecSetting; -import com.jilongda.optometrist.model.TFrameWarehousingDetail; -import com.jilongda.optometrist.model.TWarehousing; -import com.jilongda.optometrist.service.SecSettingService; -import com.jilongda.optometrist.vo.TWarehousingVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * <p> - * 系统设置 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "低库存警告") -@RestController -@RequestMapping("/sec-setting") -public class SecSettingController { - - @Autowired - private SecSettingService secSettingService; - - /** - * 查询详情 - */ - @ApiOperation(value = "低库存警告查询") - @PostMapping(value = "/getDetailById") - public ApiResult<SecSetting> getDetailById() { - return ApiResult.success(secSettingService.getById(1)); - } - - /** - * 低库存警告修改 - */ - @ApiOperation(value = "低库存警告修改") - @PostMapping(value = "/updateById") - public ApiResult<String> updateById(@RequestBody SecSetting secSetting) { - secSettingService.updateById(secSetting); - return ApiResult.success(); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TAppUserController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TAppUserController.java deleted file mode 100644 index 52f191b..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TAppUserController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TAppUser; -import com.jilongda.optometrist.model.TCouponReceive; -import com.jilongda.optometrist.model.TOptometry; -import com.jilongda.optometrist.model.TOrder; -import com.jilongda.optometrist.query.TAppUserCouponQuery; -import com.jilongda.optometrist.query.TAppUserQuery; -import com.jilongda.optometrist.query.TOptometristQuery; -import com.jilongda.optometrist.service.TAppUserService; -import com.jilongda.optometrist.service.TCouponReceiveService; -import com.jilongda.optometrist.service.TOptometryService; -import com.jilongda.optometrist.service.TOrderService; -import com.jilongda.optometrist.vo.TAppUserCouponVO; -import com.jilongda.optometrist.vo.TAppUserVO; -import com.jilongda.optometrist.vo.TOptometristVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -/** - * <p> - * 用户表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@Api(tags = "用户管理") -@RequestMapping("/t-app-user") -public class TAppUserController { - - @Resource - private TAppUserService appUserService; - @Resource - private TOrderService orderService; - @Resource - private TOptometryService tOptometryService; - @Resource - private TCouponReceiveService couponReceiveService; - @ApiOperation(value = "用户列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TAppUserVO>> pageList(@RequestBody TAppUserQuery query) { - if (StringUtils.hasLength(query.getStartTime())){ - query.setStartTime(query.getStartTime()+" 00:00:00"); - query.setEndTime(query.getEndTime()+" 23:59:59"); - } - PageInfo<TAppUserVO> appUserVOPageInfo = appUserService.pageList(query); - return ApiResult.success(appUserVOPageInfo); - } - @ApiOperation(value = "启用/禁用") - @GetMapping(value = "/updateState") - public ApiResult updateState(Integer id) { - TAppUser byId = appUserService.getById(id); - if (byId.getStatus()==1){ - byId.setStatus(2); - }else{ - byId.setStatus(1); - } - appUserService.updateById(byId); - return ApiResult.success(); - } - @ApiOperation(value = "用户详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TAppUserVO> getDetailById(Integer id) { - TAppUser byId = appUserService.getById(id); - TAppUserVO tAppUserVO = new TAppUserVO(); - BeanUtils.copyProperties(byId, tAppUserVO); - // 查询消费次数 - long l = orderService.count(new LambdaQueryWrapper<TOrder>() - .eq(TOrder::getUserId, tAppUserVO.getId())); - tAppUserVO.setSalesCount((int) l); - // 查询验光次数 - int size = tOptometryService.lambdaQuery().eq(TOptometry::getUserId, tAppUserVO.getId()) - .eq(TOptometry::getStatus, 3).list().size(); - tAppUserVO.setOptometryCount(size); - // 查询最后消费时间 - tAppUserVO.setSalesTime(orderService.lambdaQuery().eq(TOrder::getUserId, tAppUserVO.getId()) - .orderByDesc(TOrder::getCreateTime).last("limit 1").one().getCreateTime()); - // 查询最后验光时间 - tAppUserVO.setOptometryTime(tOptometryService.lambdaQuery().eq(TOptometry::getUserId, tAppUserVO.getId()) - .eq(TOptometry::getStatus, 3).orderByDesc(TOptometry::getCreateTime).last("limit 1").one().getCreateTime()); - // 查询订单总额 - BigDecimal reduce = orderService.lambdaQuery().eq(TOrder::getUserId, byId.getId()).list().stream().map(TOrder::getPayMoney) - .reduce(BigDecimal.ZERO, BigDecimal::add); - tAppUserVO.setSalesAmount(reduce); - - return ApiResult.success(tAppUserVO); - } - @ApiOperation(value = "用户详情-查看优惠券") - @GetMapping(value = "/getCouponDetailById") - public ApiResult<PageInfo<TAppUserCouponVO>> getCouponDetailById(@RequestBody TAppUserCouponQuery query) { - PageInfo<TAppUserCouponVO> appUserVOPageInfo = couponReceiveService.pageList(query); - return ApiResult.success(appUserVOPageInfo); - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TBrandController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TBrandController.java deleted file mode 100644 index 55d803c..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TBrandController.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TBrand; -import com.jilongda.optometrist.query.TBrandQuery; -import com.jilongda.optometrist.service.TBrandService; -import com.jilongda.optometrist.utils.LoginInfoUtil; -import com.jilongda.optometrist.vo.TBrandVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * <p> - * 镜架-镜片品牌表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "镜架-镜片品牌表") -@RestController -@RequestMapping("/t-brand") -public class TBrandController { - - @Autowired - private TBrandService brandService; - - /** - * 获取镜架-镜片品牌列表 - */ - @ApiOperation(value = "获取镜架-镜片品牌分页列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TBrandVO>> pageList(@RequestBody TBrandQuery query) { - return ApiResult.success(brandService.pageList(query)); - } - - /** - * 添加镜架-镜片品牌 - */ - @ApiOperation(value = "添加镜架-镜片品牌") - @PostMapping(value = "/add") - public ApiResult<String> add(@Validated @RequestBody TBrand dto) { - brandService.save(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "修改镜架-镜片品牌--启用、禁用、设置主要品牌接口") - @PostMapping(value = "/update") - public ApiResult<String> update(@RequestBody TBrand dto) { - brandService.updateById(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "删除镜架-镜片品牌") - @DeleteMapping(value = "/deleteById") - public ApiResult<Boolean> deleteById(@RequestParam Long id) { - return ApiResult.success(brandService.removeById(id)); - } - - @ApiOperation(value = "批量删除镜架-镜片品牌") - @DeleteMapping(value = "/deleteByIds") - public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { - return ApiResult.success(brandService.removeByIds(ids)); - } - - @ApiOperation(value = "查询镜架-镜片品牌详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TBrand> getDetailById(@RequestParam Long id) { - return ApiResult.success(brandService.getById(id)); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TCouponController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TCouponController.java deleted file mode 100644 index 46fa77a..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TCouponController.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.common.utils.UUIDUtil; -import com.jilongda.optometrist.dto.TModelDTO; -import com.jilongda.optometrist.model.TAppUser; -import com.jilongda.optometrist.model.TCoupon; -import com.jilongda.optometrist.model.TCouponReceive; -import com.jilongda.optometrist.model.TModel; -import com.jilongda.optometrist.query.TAppUserQuery; -import com.jilongda.optometrist.query.TCouponQuery; -import com.jilongda.optometrist.service.TAppUserService; -import com.jilongda.optometrist.service.TCouponReceiveService; -import com.jilongda.optometrist.service.TCouponService; -import com.jilongda.optometrist.utils.QRCodeUtil; -import com.jilongda.optometrist.vo.TAppUserVO; -import com.jilongda.optometrist.vo.TCouponInfoVO; -import com.jilongda.optometrist.vo.TCouponVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream; -import org.springframework.beans.BeanUtils; -import org.springframework.core.io.ByteArrayResource; -import org.springframework.mock.web.MockMultipartFile; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - * <p> - * 优惠券领取记录 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@Api(tags = "优惠券管理") -@RequestMapping("/t-coupon") -public class TCouponController { - @Resource - private TCouponService couponService; - @Resource - private TCouponReceiveService couponReceiveService; - @Resource - private TAppUserService appUserService; - @ApiOperation(value = "优惠券列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TCouponVO>> pageList(@RequestBody TCouponQuery query) { - PageInfo<TCouponVO> appUserVOPageInfo = couponService.pageList(query); - return ApiResult.success(appUserVOPageInfo); - } - @ApiOperation(value = "添加优惠券") - @PostMapping(value = "/add") - public ApiResult<String> add( @RequestBody TCoupon dto) throws Exception { - couponService.save(dto); - switch (dto.getType()){ - case 2: - // 全局发放 - List<Integer> collect = appUserService.lambdaQuery().list().stream() - .map(TAppUser::getId).collect(Collectors.toList()); - List<TCouponReceive> tCouponReceives = new ArrayList<>(); - for (Integer i : collect) { - TCouponReceive tCouponReceive = new TCouponReceive(); - tCouponReceive.setCouponId(dto.getId()); - tCouponReceive.setUserId(i); - tCouponReceive.setType(2); - tCouponReceive.setAmount(dto.getAmount()); - tCouponReceive.setStoreId(dto.getStoreId()); - if (dto.getTime()!=0){ - tCouponReceive.setEndTime(LocalDateTime.now().plusDays(dto.getTime())); - } - tCouponReceive.setAmountCondition(dto.getAmountCondition()); - tCouponReceive.setStatus(1); - tCouponReceives.add(tCouponReceive); - } - couponReceiveService.saveBatch(tCouponReceives); - break; - case 3: - List<TCouponReceive> tCouponReceives1 = new ArrayList<>(); - - for (Integer userId : dto.getUserIds()) { - TCouponReceive tCouponReceive = new TCouponReceive(); - tCouponReceive.setCouponId(dto.getId()); - tCouponReceive.setUserId(userId); - tCouponReceive.setType(2); - tCouponReceive.setAmount(dto.getAmount()); - tCouponReceive.setStoreId(dto.getStoreId()); - if (dto.getTime()!=0){ - tCouponReceive.setEndTime(LocalDateTime.now().plusDays(dto.getTime())); - } - tCouponReceive.setAmountCondition(dto.getAmountCondition()); - tCouponReceive.setStatus(1); - tCouponReceives1.add(tCouponReceive); - } - couponReceiveService.saveBatch(tCouponReceives1); - break; - case 4: - String code = "{\"id\": "+dto.getId()+ "}"; - BufferedImage blueImage = QRCodeUtil.createImage(code); - MultipartFile blueFile = convert(blueImage, new Date().getTime() + UUIDUtil.getRandomCode(3) + ".PNG"); - // todo 没有云存储 -// String s = OssUploadUtil.ossUpload("img/", blueFile); - break; - } - return ApiResult.success(); - } - @ApiOperation(value = "修改优惠券") - @PostMapping(value = "/update") - public ApiResult<String> update( @RequestBody TCoupon dto) throws Exception { - couponService.updateById(dto); - return ApiResult.success(); - } - @ApiOperation(value = "优惠券详情") - @PostMapping(value = "/getDetail") - public ApiResult<TCouponInfoVO> getDetail(Integer id) { - TCouponInfoVO tCouponInfoVO = new TCouponInfoVO(); - TCoupon byId = couponService.getById(id); - BeanUtils.copyProperties(byId, tCouponInfoVO); - int size = couponReceiveService.list(new LambdaQueryWrapper<TCouponReceive>() - .eq(TCouponReceive::getCouponId, id)).size(); - tCouponInfoVO.setGrantCout(size); - int size1 = couponReceiveService.list(new LambdaQueryWrapper<TCouponReceive>() - .eq(TCouponReceive::getCouponId, id) - .eq(TCouponReceive::getStatus, 2)).size(); - tCouponInfoVO.setUseCount(size1); - - return ApiResult.success(tCouponInfoVO); - } - public static MultipartFile convert(BufferedImage bufferedImage, String fileName) throws IOException { - // 将 BufferedImage 转换为字节数组 - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ImageIO.write(bufferedImage, "png", baos); - byte[] bytes = baos.toByteArray(); - - // 创建 ByteArrayResource - ByteArrayResource resource = new ByteArrayResource(bytes); - - // 创建 MockMultipartFile - MockMultipartFile multipartFile = new MockMultipartFile( - "file", - fileName, - "image/png", - resource.getInputStream() - ); - - return multipartFile; - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TCouponReceiveController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TCouponReceiveController.java deleted file mode 100644 index 32473ce..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TCouponReceiveController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 优惠券 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-coupon-receive") -public class TCouponReceiveController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TFrameWarehousingDetailController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TFrameWarehousingDetailController.java deleted file mode 100644 index 64e2d98..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TFrameWarehousingDetailController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 镜架出库入库详细表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-frame-warehousing-detail") -public class TFrameWarehousingDetailController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryController.java deleted file mode 100644 index ee00d94..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryController.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.dto.FrameInventoryDTO; -import com.jilongda.optometrist.dto.GetCurrentByParam; -import com.jilongda.optometrist.dto.GetCurrentByParamLens; -import com.jilongda.optometrist.dto.LensInventoryDTO; -import com.jilongda.optometrist.query.TInventoryQuery; -import com.jilongda.optometrist.utils.LoginInfoUtil; -import com.jilongda.optometrist.vo.TInventoryInfoVO; -import com.jilongda.optometrist.vo.TInventoryVO; -import com.jilongda.optometrist.model.*; -import com.jilongda.optometrist.service.*; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; -import java.util.stream.Collectors; - -/** - * <p> - * 盘点表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@Api(tags = "盘点管理") -@RequestMapping("/t-inventory") -public class TInventoryController { - - @Resource - private TInventoryService inventoryService; - @Resource - private TInventoryFrameDetailService inventoryFrameDetailService; - @Resource - private TInventoryLensDetailService inventoryLensDetailService; - @Resource - private LoginInfoUtil loginInfoUtil; - @Resource - private TFrameGoodsService frameGoodsService; - @Resource - private TLensGoodsService lensGoodsService; - @Resource - private TLensSeriesService lensSeriesService; - @Resource - private TModelService modelService; - @Resource - private TStoreService storeService; - @ApiOperation(value = "盘点分页列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TInventoryVO>> pageList(@RequestBody TInventoryQuery query) { - if (StringUtils.hasLength(query.getStartTime())){ - query.setStartTime(query.getStartTime()+" 00:00:00"); - query.setEndTime(query.getEndTime()+" 23:59:59"); - } - return ApiResult.success(inventoryService.pageList(query)); - } - @ApiOperation(value = "镜架添加盘点") - @PostMapping(value = "/addFrameInventory") - public ApiResult addFrameInventory(@RequestBody FrameInventoryDTO query) { - TInventory tInventory = new TInventory(); - BeanUtils.copyProperties(query, tInventory); - inventoryService.save(tInventory); - for (TInventoryFrameDetail tInventoryFrameDetail : query.getList()) { - tInventoryFrameDetail.setInventoryId(tInventory.getId()); - } - inventoryFrameDetailService.saveBatch(query.getList()); - return ApiResult.success(); - } - @ApiOperation(value = "镜片添加盘点") - @PostMapping(value = "/addLensInventory") - public ApiResult addLensInventory(@RequestBody LensInventoryDTO query) { - TInventory tInventory = new TInventory(); - BeanUtils.copyProperties(query, tInventory); - inventoryService.save(tInventory); - for (TInventoryLensDetail tInventoryFrameDetail : query.getList()) { - tInventoryFrameDetail.setInventoryId(tInventory.getId()); - } - inventoryLensDetailService.saveBatch(query.getList()); - return ApiResult.success(); - } - - @ApiOperation(value = "镜架-根据品牌id查询对应库存") - @PostMapping(value = "/getCountByBrandId") - public ApiResult getCountByBrandId(Integer id) { - List<Integer> collect = modelService.lambdaQuery().eq(TModel::getBrandId, id) - .list().stream().map(TModel::getId).distinct().collect(Collectors.toList()); - if (collect.isEmpty())collect.add(-1); - List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect).list(); - if (list.isEmpty())return ApiResult.success("0"); - int i = 0; - for (TFrameGoods tFrameGoods : list) { - i+=tFrameGoods.getTotal(); - } - return ApiResult.success(i); - } - @ApiOperation(value = "镜架-根据材质id查询对应库存") - @PostMapping(value = "/getCountByMaterialId") - public ApiResult getCountByMaterialId(Integer id) { - List<Integer> collect = modelService.lambdaQuery().eq(TModel::getMaterialId, id) - .list().stream().map(TModel::getId).distinct().collect(Collectors.toList()); - if (collect.isEmpty())collect.add(-1); - List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect).list(); - if (list.isEmpty())return ApiResult.success("0"); - int i = 0; - for (TFrameGoods tFrameGoods : list) { - i+=tFrameGoods.getTotal(); - } - return ApiResult.success(i); - } - @ApiOperation(value = "镜架-根据品牌id、型号名称、色号名称、材质id查询当前库存") - @PostMapping(value = "/getCurrentByParamFrame") - public ApiResult<Integer> getCurrentByParamFrame(@RequestBody GetCurrentByParam getCurrentByParam) { - // 根据型号名称 查询型号列表ids - List<Integer> collect = modelService.lambdaQuery().eq(TModel::getName, getCurrentByParam.getModel()) - .eq(TModel::getColor,getCurrentByParam.getColor()) - .eq(TModel::getMaterialId,getCurrentByParam.getMaterialId()) - .eq(TModel::getBrandId,getCurrentByParam.getBrandId()) - .list().stream().map(TModel::getId).collect(Collectors.toList()); - TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) - .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one(); - if (one!=null){ - return ApiResult.success(one.getTotal()); - - } - return ApiResult.success(0); - } - @ApiOperation(value = "镜片-根据品牌id、型号名称、色号名称、材质id查询当前库存") - @PostMapping(value = "/getCurrentByParamLens") - public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { - TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId()) - .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType()) - .eq(dto.getRefractiveIndex()!=null,TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) - .eq(dto.getBallMirror()!=null,TLensGoods::getBallMirror, dto.getBallMirror()) - .eq(dto.getColumnMirror()!=null,TLensGoods::getColumnMirror, dto.getColumnMirror()) - .one(); - if (one!=null){ - return ApiResult.success(one.getTotal()); - } - return ApiResult.success(0); - } - @ApiOperation(value = "查看详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TInventoryInfoVO> getDetailById(Integer id) { - TInventoryInfoVO tInventoryInfoVO = new TInventoryInfoVO(); - - TInventory byId = inventoryService.getById(id); - BeanUtils.copyProperties(byId, tInventoryInfoVO); - switch (byId.getType()){ - case 1: - List<TInventoryFrameDetail> list = inventoryFrameDetailService.lambdaQuery().eq(TInventoryFrameDetail::getInventoryId, id).list(); - tInventoryInfoVO.setFrameList(list); - break; - case 2: - List<TInventoryLensDetail> list2 = inventoryLensDetailService.lambdaQuery().eq(TInventoryLensDetail::getInventoryId, id).list(); - tInventoryInfoVO.setLensList(list2); - break; - } - TStore byId1 = storeService.getById(byId.getStoreId()); - if (byId1!=null)tInventoryInfoVO.setStore(byId1.getName()); - return ApiResult.success(tInventoryInfoVO); - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryFrameDetailController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryFrameDetailController.java deleted file mode 100644 index 67ad18a..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryFrameDetailController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 材质表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-inventory-frame-detail") -public class TInventoryFrameDetailController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryLensDetailController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryLensDetailController.java deleted file mode 100644 index fafb14b..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TInventoryLensDetailController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 镜架盘点详细表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-inventory-lens-detail") -public class TInventoryLensDetailController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TLensSeriesController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TLensSeriesController.java deleted file mode 100644 index d8339a4..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TLensSeriesController.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.alibaba.fastjson.JSONObject; -import com.google.gson.JsonArray; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TLensSeries; -import com.jilongda.optometrist.model.TOptometrist; -import com.jilongda.optometrist.query.TLensSeriesQuery; -import com.jilongda.optometrist.query.TOptometristQuery; -import com.jilongda.optometrist.service.TLensSeriesService; -import com.jilongda.optometrist.vo.TLensSeriesVO; -import com.jilongda.optometrist.vo.TOptometristVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.List; - -/** - * <p> - * 镜片系列表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "镜片系列管理") -@RestController -@RequestMapping("/t-lens-series") -public class TLensSeriesController { - @Autowired - private TLensSeriesService lensSeriesService; - @ApiOperation(value = "镜片系列列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TLensSeriesVO>> pageList(@RequestBody TLensSeriesQuery query) { - PageInfo<TLensSeriesVO> optometristVOPageInfo = lensSeriesService.pageList(query); - return ApiResult.success(optometristVOPageInfo); - } - @ApiOperation(value = "镜片系列添加") - @PostMapping(value = "/add") - public ApiResult<String> add(@RequestBody TLensSeries dto) { - lensSeriesService.save(dto); - return ApiResult.success(); - } - @ApiOperation(value = "镜片系列编辑") - @PostMapping(value = "/update") - public ApiResult<String> update(@RequestBody TLensSeries dto) { - if (!StringUtils.hasLength(dto.getSphere())){ - dto.setSphere(""); - } - if (!StringUtils.hasLength(dto.getAsphericSurface())){ - dto.setAsphericSurface(""); - } - if (!StringUtils.hasLength(dto.getDoubleNon())){ - dto.setDoubleNon(""); - } - lensSeriesService.updateById(dto); - return ApiResult.success(); - } - @ApiOperation(value = "镜片系列启用/禁用") - @GetMapping(value = "/updateState") - public ApiResult<String> update(Integer id) { - TLensSeries byId = lensSeriesService.getById(id); - if (byId.getStatus()==1){ - byId.setStatus(2); - }else{ - byId.setStatus(1); - } - lensSeriesService.updateById(byId); - return ApiResult.success(); - } - @ApiOperation(value = "通过品牌id查询镜片系列列表") - @GetMapping(value = "/seriesList") - public ApiResult<List<TLensSeries>> seriesList(Integer brandId) { - return ApiResult.success(lensSeriesService.lambdaQuery().eq(TLensSeries::getBrandId,brandId).list()); - } - @ApiOperation(value = "通过系列id查询球/非球 返回参数1为球 2非球 3双飞") - @GetMapping(value = "/lensTypeList") - public ApiResult<List<Integer>> lensTypeList(Integer id) { - TLensSeries byId = lensSeriesService.getById(id); - List<Integer> integers = new ArrayList<>(); - if (StringUtils.hasLength(byId.getSphere())){ - integers.add(1); - } - if (StringUtils.hasLength(byId.getAsphericSurface())){ - integers.add(2); - } - if (StringUtils.hasLength(byId.getDoubleNon())){ - integers.add(3); - } - return ApiResult.success(integers); - } - @ApiOperation(value = "根据系列id + 球/非球查询折射率列表 球/非球入参数1为球 2非球 3双飞") - @GetMapping(value = "/refractiveIndexList") - public ApiResult<List<String>> refractiveIndexList(Integer id, Integer lensType) { - TLensSeries byId = lensSeriesService.getById(id); - if (lensType==1){ - String sphere = byId.getSphere(); - // 将字符串化为jsonArray - if (StringUtils.hasLength(sphere)) { - JSONObject.parseArray(sphere); - } else { - return ApiResult.success(new ArrayList<String>()); - } - } - if (lensType==2){ - String asphericSurface = byId.getAsphericSurface(); - if (StringUtils.hasLength(asphericSurface)) { - JSONObject.parseArray(asphericSurface); - } else { - return ApiResult.success(new ArrayList<String>()); - } - } - if (lensType==3){ - String doubleNon = byId.getDoubleNon(); - if (StringUtils.hasLength(doubleNon)) { - JSONObject.parseArray(doubleNon); - } else { - return ApiResult.success(new ArrayList<String>()); - } - } - return ApiResult.success(new ArrayList<String>()); - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TLensWarehousingDetailController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TLensWarehousingDetailController.java deleted file mode 100644 index 0c938b5..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TLensWarehousingDetailController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 镜片出库入库明细表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-lens-warehousing-detail") -public class TLensWarehousingDetailController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TLineUpController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TLineUpController.java deleted file mode 100644 index 3e587c4..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TLineUpController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TAppUser; -import com.jilongda.optometrist.model.TLineUp; -import com.jilongda.optometrist.model.TOptometryDetail; -import com.jilongda.optometrist.query.TLineUpQuery; -import com.jilongda.optometrist.query.TOptometryQuery; -import com.jilongda.optometrist.service.TAppUserService; -import com.jilongda.optometrist.service.TLineUpService; -import com.jilongda.optometrist.vo.TOptometryVO; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * <p> - * 排号管理 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-line-up") -public class TLineUpController { - @Autowired - private TLineUpService lineUpService; - @Autowired - private TAppUserService appUserService; - @ApiOperation(value = "获取排号分页列表",tags = "排号管理") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TLineUp>> pageList(@RequestBody TLineUpQuery query) { - PageInfo<TLineUp> res = lineUpService.pageList(query); - return ApiResult.success(res); - } - @ApiOperation(value = "查询当前排队人数",tags = "排号a管理") - @PostMapping(value = "/getCount") - public ApiResult getCount() { - return ApiResult.success(lineUpService.lambdaQuery().eq(TLineUp::getStatus,1).list().size()); - } - @ApiOperation(value = "取消排队",tags = "排号管理") - @GetMapping(value = "/cancel") - public ApiResult cancel(Integer id) { - TLineUp byId = lineUpService.getById(id); - byId.setStatus(5); - lineUpService.updateById(byId); - return ApiResult.success(); - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TMaterialController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TMaterialController.java deleted file mode 100644 index e974011..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TMaterialController.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TMaterial; -import com.jilongda.optometrist.query.TMaterialQuery; -import com.jilongda.optometrist.service.TMaterialService; -import com.jilongda.optometrist.vo.TMaterialVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * <p> - * 材质表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "材质管理") -@RestController -@RequestMapping("/t-material") -public class TMaterialController { - - @Autowired - private TMaterialService materialService; - - /** - * 获取材质列表 - */ - @ApiOperation(value = "获取材质分页列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TMaterialVO>> pageList(@RequestBody TMaterialQuery query) { - return ApiResult.success(materialService.pageList(query)); - } - - /** - * 获取材质列表 - */ - @ApiOperation(value = "获取材质列表") - @PostMapping(value = "/list") - public ApiResult<List<TMaterial>> list(@RequestBody TMaterialQuery query) { - List<TMaterial> list = materialService.list(Wrappers.lambdaQuery(TMaterial.class) - .eq(TMaterial::getStatus, 1)); - return ApiResult.success(list); - } - - /** - * 添加材质 - */ - @ApiOperation(value = "添加材质") - @PostMapping(value = "/add") - public ApiResult<String> add(@Validated @RequestBody TMaterial dto) { - Boolean flag = materialService.isExit(dto.getId(), dto.getName()); - if(flag){ - return ApiResult.failed("材质名称已存在"); - } - materialService.save(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "修改材质") - @PostMapping(value = "/update") - public ApiResult<String> update(@Validated @RequestBody TMaterial dto) { - Boolean flag = materialService.isExit(dto.getId(), dto.getName()); - if(flag){ - return ApiResult.failed("材质名称已存在"); - } - materialService.updateById(dto); - return ApiResult.success(); - } - - /** - * 材质启用禁用 - */ - @ApiOperation(value = "材质启用禁用") - @GetMapping(value = "/upAndDown") - public ApiResult<Boolean> upAndDown(@RequestParam Long id, - @RequestParam Integer status) { - return ApiResult.success(materialService.upAndDown(id,status)); - } - - @ApiOperation(value = "删除材质") - @DeleteMapping(value = "/deleteById") - public ApiResult<Boolean> deleteById(@RequestParam Long id) { - return ApiResult.success(materialService.removeById(id)); - } - - @ApiOperation(value = "批量删除材质") - @DeleteMapping(value = "/deleteByIds") - public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { - return ApiResult.success(materialService.removeByIds(ids)); - } - - @ApiOperation(value = "查询材质详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TMaterial> getDetailById(@RequestParam Long id) { - return ApiResult.success(materialService.getById(id)); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TModelController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TModelController.java deleted file mode 100644 index 4e0fb00..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TModelController.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.dto.TModelDTO; -import com.jilongda.optometrist.model.TModel; -import com.jilongda.optometrist.query.TModelQuery; -import com.jilongda.optometrist.service.TModelService; -import com.jilongda.optometrist.vo.TModelVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * <p> - * 镜架型号表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "镜架型号表") -@RestController -@RequestMapping("/t-model") -public class TModelController { - - @Autowired - private TModelService modelService; - - /** - * 获取镜架型号列表 - */ - @ApiOperation(value = "获取镜架型号分页列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TModelVO>> pageList(@RequestBody TModelQuery query) { - return ApiResult.success(modelService.pageList(query)); - } - - /** - * 通过品牌查询型号列表 - */ - @ApiOperation(value = "通过品牌id查询型号列表") - @GetMapping(value = "/getListByBrandId") - public ApiResult<List<TModel>> pageList(@RequestParam Integer brandId) { - List<TModel> list = modelService.list(Wrappers.lambdaQuery(TModel.class) - .eq(TModel::getBrandId, brandId) - .groupBy(TModel::getName)); - return ApiResult.success(list); - } - - /** - * 通过型号查询色号列表 - */ - @ApiOperation(value = "通过型号查询色号列表") - @GetMapping(value = "/getListByName") - public ApiResult<List<TModel>> pageList(@RequestParam String name) { - List<TModel> list = modelService.list(Wrappers.lambdaQuery(TModel.class) - .eq(TModel::getName, name)); - return ApiResult.success(list); - } - - /** - * 添加镜架型号 - */ - @ApiOperation(value = "添加镜架型号") - @PostMapping(value = "/add") - public ApiResult<String> add(@Validated @RequestBody TModelDTO dto) { - List<String> colorList = dto.getColorList(); - List<TModel> models = new ArrayList<>(); - for (String s : colorList) { - TModel model = new TModel(); - BeanUtils.copyProperties(dto, model); - model.setColor(s); - models.add(model); - } - modelService.saveBatch(models); - return ApiResult.success(); - } - - @ApiOperation(value = "修改镜架型号") - @PostMapping(value = "/update") - public ApiResult<String> update(@RequestBody TModelDTO dto) { - - modelService.remove(Wrappers.lambdaQuery(TModel.class) - .eq(TModel::getName,dto.getName())); - - List<String> colorList = dto.getColorList(); - List<TModel> models = new ArrayList<>(); - for (String s : colorList) { - TModel model = new TModel(); - BeanUtils.copyProperties(dto, model); - model.setId(null); - model.setColor(s); - models.add(model); - } - modelService.saveBatch(models); - return ApiResult.success(); - } - - /** - * 镜架型号上下架 - */ - @ApiOperation(value = "镜架型号上下架--列表使用") - @GetMapping(value = "/upAndDown") - public ApiResult<Boolean> upAndDown(@RequestParam String name, - @RequestParam Integer status) { - return ApiResult.success(modelService.upAndDown(name,status)); - } - - /** - * 镜架型号上下架 - */ - @ApiOperation(value = "镜架型号上下架--修改界面使用") - @GetMapping(value = "/upAndDownColor") - public ApiResult<Boolean> upAndDownColor(@RequestParam String name, - @RequestParam String color, - @RequestParam Integer status) { - return ApiResult.success(modelService.upAndDownColor(name,color,status)); - } - - @ApiOperation(value = "删除镜架型号") - @DeleteMapping(value = "/deleteByName") - public ApiResult<String> deleteById(@RequestParam String name) { - modelService.remove(Wrappers.lambdaQuery(TModel.class) - .eq(TModel::getName, name)); - return ApiResult.success(); - } - - @ApiOperation(value = "批量删除镜架型号") - @DeleteMapping(value = "/deleteByNames") - public ApiResult<String> deleteByIds(@RequestBody List<String> names) { - modelService.remove(Wrappers.lambdaQuery(TModel.class) - .in(TModel::getName, names)); - return ApiResult.success(); - } - - @ApiOperation(value = "查询镜架型号详情") - @GetMapping(value = "/getDetailByName") - public ApiResult<TModelVO> getDetailById(@RequestParam String name) { - List<TModel> models = modelService.list(Wrappers.lambdaQuery(TModel.class) - .eq(TModel::getName, name)); - TModelVO modelVO = new TModelVO(); - BeanUtils.copyProperties(models.get(0), modelVO); - List<String> colorList = models.stream().map(TModel::getColor).collect(Collectors.toList()); - modelVO.setColorList(colorList); - return ApiResult.success(modelVO); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java index c46d107..65ed077 100644 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java +++ b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java @@ -8,18 +8,17 @@ import com.jilongda.optometrist.authority.service.SecUserService; import com.jilongda.optometrist.model.*; import com.jilongda.optometrist.query.TOptometristQuery; +import com.jilongda.optometrist.query.TOptometryQuery; import com.jilongda.optometrist.query.TicketQuery; import com.jilongda.optometrist.service.*; import com.jilongda.optometrist.utils.LoginInfoUtil; -import com.jilongda.optometrist.vo.TAddOptometryVO; -import com.jilongda.optometrist.vo.TLineUpDetailVO; -import com.jilongda.optometrist.vo.TOptometristVO; -import com.jilongda.optometrist.vo.TOptometryDetailVO; +import com.jilongda.optometrist.vo.*; import com.sun.org.apache.bcel.internal.generic.NEW; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -56,6 +55,20 @@ private TOrderService orderService; @Autowired private TOptometryDetailService optometryDetailService; + @ApiOperation(value = "获取验光单分页列表",tags = "验光单") + @PostMapping(value = "/pageList") + public ApiResult<PageInfo<TOptometryVO>> pageList(@RequestBody TOptometryQuery query) { + String startTime = null; + String endTime = null; + if (StringUtils.hasLength(query.getTime())){ + startTime = query.getTime()+" 00:00:00"; + endTime = query.getTime()+" 23:59:59"; + } + query.setStartTime(startTime); + query.setEndTime(endTime); + PageInfo<TOptometryVO> tOptometryVOPageInfo = optometristService.pageList(query); + return ApiResult.success(tOptometryVOPageInfo); + } @ApiOperation(value = "首页") @PostMapping(value = "/index") public ApiResult<TOptometristVO> index() { @@ -178,18 +191,5 @@ return ApiResult.success(); } - @ApiOperation(value = "验光师编辑") - @PostMapping(value = "/update") - public ApiResult<String> update(@RequestBody TOptometrist dto) { - optometristService.updateById(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "验光师上下架") - @GetMapping(value = "/upAndDown") - public ApiResult<Boolean> upAndDown(@RequestParam Integer id, - @RequestParam Integer status) { - return ApiResult.success(optometristService.upAndDown(id,status)); - } } diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometryController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometryController.java deleted file mode 100644 index 9ff63ad..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometryController.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TAppUser; -import com.jilongda.optometrist.model.TOptometryDetail; -import com.jilongda.optometrist.model.TSupplier; -import com.jilongda.optometrist.query.TOptometryQuery; -import com.jilongda.optometrist.query.TSupplierQuery; -import com.jilongda.optometrist.service.TAppUserService; -import com.jilongda.optometrist.service.TOptometristService; -import com.jilongda.optometrist.service.TOptometryDetailService; -import com.jilongda.optometrist.service.TSupplierService; -import com.jilongda.optometrist.vo.TOptometryVO; -import com.jilongda.optometrist.vo.TSupplierVO; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * <p> - * 验光单 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-optometry") -public class TOptometryController { - @Autowired - private TSupplierService supplierService; - @Autowired - private TOptometristService optometristService; - @Autowired - private TOptometryDetailService optometryDetailService; - @Autowired - private TAppUserService appUserService; - - /** - * 获取供应商列表 - */ - @ApiOperation(value = "获取验光单分页列表",tags = "验光单") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TOptometryVO>> pageList(@RequestBody TOptometryQuery query) { - String startTime = null; - String endTime = null; - if (StringUtils.hasLength(query.getCreateTime())){ - String[] split = query.getCreateTime().split(" - "); - startTime = split[0]+" 00:00:00"; - endTime = split[1]+" 23:59:59"; - } - query.setStartTime(startTime); - query.setEndTime(endTime); - PageInfo<TOptometryVO> tOptometryVOPageInfo = optometristService.pageList(query); - List<TOptometryVO> records = tOptometryVOPageInfo.getRecords(); - for (TOptometryVO record : records) { - if (record.getUserId()!=null){ - TAppUser byId = appUserService.getById(record.getUserId()); - if (byId!=null){ - record.setName(byId.getName()); - } - } - TOptometryDetail l = optometryDetailService.lambdaQuery() - .eq(TOptometryDetail::getOptometryId, record.getId()) - .eq(TOptometryDetail::getType,1) - .eq(TOptometryDetail::getStatus,1) - .one(); - TOptometryDetail r = optometryDetailService.lambdaQuery() - .eq(TOptometryDetail::getOptometryId, record.getId()) - .eq(TOptometryDetail::getType,1) - .eq(TOptometryDetail::getStatus,2) - .one(); - double templ = 0.0; - double tempr = 0.0; - if (l!=null){ - record.setLValue(l.getBallMirror().toString()+(l.getColumnMirror()!=null?"-"+l.getColumnMirror():"")); - templ = Double.parseDouble(l.getPupilDistance()); - } - if (r!=null){ - record.setRValue(r.getBallMirror().toString()+(r.getColumnMirror()!=null?"-"+r.getColumnMirror():"")); - tempr = Double.parseDouble(r.getPupilDistance()); - - } - record.setPupilDistance((templ+tempr)+""); - } - return ApiResult.success(tOptometryVOPageInfo); - } - @ApiOperation(value = "查询验光单详情",tags = "验光单") - @GetMapping(value = "/getDetailById") - public ApiResult<List<TOptometryDetail>> getDetailById(@RequestParam Integer id) { - List<TOptometryDetail> list = optometryDetailService.lambdaQuery() - .eq(TOptometryDetail::getOptometryId, id) - .list(); - return ApiResult.success(list); - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometryDetailController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometryDetailController.java deleted file mode 100644 index 77406a0..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometryDetailController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 验光单详情 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-optometry-detail") -public class TOptometryDetailController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderAccountingController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderAccountingController.java deleted file mode 100644 index ddb4cbf..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderAccountingController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 订单核算表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@RestController -@RequestMapping("/t-order-accounting") -public class TOrderAccountingController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderAftersalesController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderAftersalesController.java deleted file mode 100644 index 6d9f77e..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderAftersalesController.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.common.constants.WarehousingConstant; -import com.jilongda.common.utils.CodeGenerateUtils; -import com.jilongda.optometrist.model.TOptometrist; -import com.jilongda.optometrist.model.TOrderAftersales; -import com.jilongda.optometrist.query.TOptometristQuery; -import com.jilongda.optometrist.query.TOrderAftersalesQuery; -import com.jilongda.optometrist.service.TOrderAftersalesService; -import com.jilongda.optometrist.vo.TOptometristVO; -import com.jilongda.optometrist.vo.TOrderAftersalesVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 订单售后表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "订单售后管理") -@RestController -@RequestMapping("/t-order-aftersales") -public class TOrderAftersalesController { - - - @Autowired - private TOrderAftersalesService orderAftersalesService; - - - @ApiOperation(value = "订单售后列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TOrderAftersalesVO>> pageList(@RequestBody TOrderAftersalesQuery query) { - PageInfo<TOrderAftersalesVO> orderAftersalesVOPageInfo = orderAftersalesService.pageList(query); - return ApiResult.success(orderAftersalesVOPageInfo); - } - - @ApiOperation(value = "订单售后添加") - @PostMapping(value = "/add") - public ApiResult<String> add(@RequestBody TOrderAftersales dto) { - dto.setCode(WarehousingConstant.ASTER_SALES+ CodeGenerateUtils.generateVolumeSn()); - orderAftersalesService.save(dto); - return ApiResult.success(); - } - - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderController.java deleted file mode 100644 index bdc2397..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TOrderController.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * <p> - * 销售订单表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "") -@RestController -@RequestMapping("/t-order") -public class TOrderController { - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TStoreController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TStoreController.java deleted file mode 100644 index d70e0dd..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TStoreController.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.Region; -import com.jilongda.optometrist.model.TStore; -import com.jilongda.optometrist.query.TStoreQuery; -import com.jilongda.optometrist.service.ITRegionService; -import com.jilongda.optometrist.service.TStoreService; -import com.jilongda.optometrist.utils.LoginInfoUtil; -import com.jilongda.optometrist.vo.TStoreVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.Objects; - -/** - * <p> - * 门店表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "门店管理") -@RestController -@RequestMapping("/t-store") -public class TStoreController { - - @Autowired - private TStoreService storeService; - @Autowired - private LoginInfoUtil loginInfoUtil; - @Autowired - private ITRegionService regionService; - - /** - * 获取门店列表 - */ - @ApiOperation(value = "获取门店分页列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TStoreVO>> pageList(@RequestBody TStoreQuery query) { - Integer userType = loginInfoUtil.getLoginUser().getUserType(); - if(!Objects.equals(userType,1)){ - query.setStatus(1); - } - return ApiResult.success(storeService.pageList(query)); - } - @ApiOperation(value = "省市区三级联动 获取省不传值 市区县传上级code") - @GetMapping(value = "/list") - public ApiResult<List<Region>> add(String code) { - if (!StringUtils.hasLength(code)){ - return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,0).list()); - }else{ - return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,regionService.lambdaQuery().eq(Region::getCode,code).one().getId()).list()); - - } - } - /** - * 添加门店 - */ - @ApiOperation(value = "添加门店") - @PostMapping(value = "/add") - public ApiResult<String> add(@Validated @RequestBody TStore dto) { - storeService.save(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "修改门店") - @PostMapping(value = "/update") - public ApiResult<String> update(@Validated @RequestBody TStore dto) { - storeService.updateById(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "删除门店") - @DeleteMapping(value = "/deleteById") - public ApiResult<Boolean> deleteById(@RequestParam Long id) { - return ApiResult.success(storeService.removeById(id)); - } - - @ApiOperation(value = "批量删除门店") - @DeleteMapping(value = "/deleteByIds") - public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { - return ApiResult.success(storeService.removeByIds(ids)); - } - - @ApiOperation(value = "查询门店详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TStore> getDetailById(@RequestParam Long id) { - return ApiResult.success(storeService.getById(id)); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TSupplierController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TSupplierController.java deleted file mode 100644 index c4d3403..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TSupplierController.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TSupplier; -import com.jilongda.optometrist.query.TSupplierQuery; -import com.jilongda.optometrist.service.TSupplierService; -import com.jilongda.optometrist.vo.TSupplierVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * <p> - * 供应商 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "供应商管理") -@RestController -@RequestMapping("/t-supplier") -public class TSupplierController { - @Autowired - private TSupplierService supplierService; - - /** - * 获取供应商列表 - */ - @ApiOperation(value = "获取供应商分页列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TSupplierVO>> pageList(@RequestBody TSupplierQuery query) { - return ApiResult.success(supplierService.pageList(query)); - } - - /** - * 获取供应商列表 - */ - @ApiOperation(value = "获取供应商列表") - @PostMapping(value = "/list") - public ApiResult<List<TSupplier>> list(@RequestBody TSupplierQuery query) { - LambdaQueryWrapper<TSupplier> wrapper = new LambdaQueryWrapper<>(); - if(StringUtils.hasLength(query.getName())){ - wrapper.like(TSupplier::getName, query.getName()); - } - wrapper.eq(TSupplier::getStatus, 1); - List<TSupplier> list = supplierService.list(wrapper); - return ApiResult.success(list); - } - - /** - * 添加供应商 - */ - @ApiOperation(value = "添加供应商") - @PostMapping(value = "/add") - public ApiResult<String> add(@Validated @RequestBody TSupplier dto) { - Boolean flag = supplierService.isExit(dto.getId(), dto.getName()); - if(flag){ - return ApiResult.failed("供应商名称已存在"); - } - supplierService.save(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "修改供应商") - @PostMapping(value = "/update") - public ApiResult<String> update(@Validated @RequestBody TSupplier dto) { - Boolean flag = supplierService.isExit(dto.getId(), dto.getName()); - if(flag){ - return ApiResult.failed("供应商名称已存在"); - } - supplierService.updateById(dto); - return ApiResult.success(); - } - - /** - * 供应商启用禁用 - */ - @ApiOperation(value = "供应商启用禁用") - @GetMapping(value = "/upAndDown") - public ApiResult<Boolean> upAndDown(@RequestParam Long id, - @RequestParam Integer status) { - return ApiResult.success(supplierService.upAndDown(id,status)); - } - - @ApiOperation(value = "删除供应商") - @DeleteMapping(value = "/deleteById") - public ApiResult<Boolean> deleteById(@RequestParam Long id) { - return ApiResult.success(supplierService.removeById(id)); - } - - @ApiOperation(value = "批量删除供应商") - @DeleteMapping(value = "/deleteByIds") - public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { - return ApiResult.success(supplierService.removeByIds(ids)); - } - - @ApiOperation(value = "查询供应商详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TSupplier> getDetailById(@RequestParam Long id) { - return ApiResult.success(supplierService.getById(id)); - } -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TTicketController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TTicketController.java deleted file mode 100644 index 3e5beaa..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TTicketController.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.optometrist.model.TTicket; -import com.jilongda.optometrist.query.TWarehousingDetailQuery; -import com.jilongda.optometrist.query.TicketQuery; -import com.jilongda.optometrist.service.TTicketService; -import com.jilongda.optometrist.vo.TFrameWarehousingDetailVO; -import com.jilongda.optometrist.vo.TTicketVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * <p> - * 小票机 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "小票机") -@RestController -@RequestMapping("/t-ticket") -public class TTicketController { - - - @Autowired - private TTicketService tTicketService; - - @ApiOperation(value = "小票机列表") - @PostMapping(value = "/pageList") - public ApiResult<PageInfo<TTicketVO>> pageList(@RequestBody TicketQuery query) { - PageInfo<TTicketVO> ticketVOPageInfo = tTicketService.pageList(query); - return ApiResult.success(ticketVOPageInfo); - } - - @ApiOperation(value = "小票机添加") - @PostMapping(value = "/add") - public ApiResult<String> add(@RequestBody TTicket dto) { - tTicketService.save(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "小票机编辑") - @PostMapping(value = "/update") - public ApiResult<String> update(@RequestBody TTicket dto) { - tTicketService.updateById(dto); - return ApiResult.success(); - } - - @ApiOperation(value = "小票机上下架") - @GetMapping(value = "/upAndDown") - public ApiResult<Boolean> upAndDown(@RequestParam Integer id, - @RequestParam Integer status) { - return ApiResult.success(tTicketService.upAndDown(id,status)); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/controller/TWarehousingController.java b/optometrist/src/main/java/com/jilongda/optometrist/controller/TWarehousingController.java deleted file mode 100644 index 6bcc71f..0000000 --- a/optometrist/src/main/java/com/jilongda/optometrist/controller/TWarehousingController.java +++ /dev/null @@ -1,357 +0,0 @@ -package com.jilongda.optometrist.controller; - - -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.jilongda.common.basic.ApiResult; -import com.jilongda.common.basic.PageInfo; -import com.jilongda.common.constants.WarehousingConstant; -import com.jilongda.common.enums.WarehousingTypeEnum; -import com.jilongda.common.security.JwtTokenUtils; -import com.jilongda.common.utils.CodeGenerateUtils; -import com.jilongda.common.utils.UUIDUtil; -import com.jilongda.optometrist.dto.GetCurrentByParam; -import com.jilongda.optometrist.dto.GetCurrentByParamLens; -import com.jilongda.optometrist.dto.TWarehousingDTO; -import com.jilongda.optometrist.dto.TWarehousingLensDTO; -import com.jilongda.optometrist.query.TFrameGoodsQuery; -import com.jilongda.optometrist.query.TLensGoodsQuery; -import com.jilongda.optometrist.query.TWarehousingDetailLensQuery; -import com.jilongda.optometrist.query.TWarehousingDetailQuery; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * <p> - * 镜架-镜片出库入库表 前端控制器 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Api(tags = "镜架-镜片出库入库") -@RestController -@RequestMapping("/t-warehousing") -public class TWarehousingController { - - @Autowired - private TWarehousingService warehousingService; - @Autowired - private TFrameWarehousingDetailService frameWarehousingDetailService; - @Autowired - private TLensWarehousingDetailService lensWarehousingDetailService; - @Autowired - private TFrameGoodsService frameGoodsService; - @Autowired - private TLensGoodsService lensGoodsService; - @Autowired - private TModelService modelService; - @Autowired - private TLensSeriesService lensSeriesService; - @Autowired - private TStoreService storeService; - @Autowired - private TBrandService brandService; - /** - * 通过型号查询色号列表 - */ - @ApiOperation(value = "镜架-根据品牌id、型号名称、色号名称查询当前库存") - @PostMapping(value = "/getCurrentByParamFrame") - public ApiResult<Integer> getCurrentByParamFrame(@RequestBody GetCurrentByParam getCurrentByParam) { - // 根据型号名称 查询型号列表ids - List<Integer> collect = modelService.lambdaQuery().eq(TModel::getName, getCurrentByParam.getModel()) - .eq(TModel::getMaterialId,getCurrentByParam.getMaterialId()) - .eq(TModel::getColor,getCurrentByParam.getColor()) - .eq(TModel::getBrandId,getCurrentByParam.getBrandId()) - .list().stream().map(TModel::getId).collect(Collectors.toList()); - TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) - .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one(); - if (one!=null){ - return ApiResult.success(one.getTotal()); - - } - return ApiResult.success(0); - } - @ApiOperation(value = "镜片-根据品牌id、型号名称、色号名称、材质id查询当前库存") - @PostMapping(value = "/getCurrentByParamLens") - public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { - TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId()) - .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType()) - .eq(dto.getRefractiveIndex()!=null,TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) - .eq(dto.getBallMirror()!=null,TLensGoods::getBallMirror, dto.getBallMirror()) - .eq(dto.getColumnMirror()!=null,TLensGoods::getColumnMirror, dto.getColumnMirror()) - .one(); - if (one!=null){ - return ApiResult.success(one.getTotal()); - } - return ApiResult.success(0); - } - @ApiOperation(value = "镜架库存分页列表") - @PostMapping(value = "/frameReceiptList") - public ApiResult<PageInfo<TFrameGoodsVO>> frameReceiptList(@RequestBody TFrameGoodsQuery query) { - return ApiResult.success(frameGoodsService.lensReceiptList(query)); - } - @ApiOperation(value = "镜片库存分页列表") - @PostMapping(value = "/lensReceiptList") - public ApiResult<PageInfo<TLensGoodsVO>> lensReceiptList(@RequestBody TLensGoodsQuery query) { - return ApiResult.success(lensGoodsService.lensReceiptList(query)); - } - @ApiOperation(value = "镜片库存分页列表-启用禁用") - @PostMapping(value = "/updateStateLens") - public ApiResult updateStateLens(Integer id) { - TLensGoods byId = lensGoodsService.getById(id); - if (byId.getStatus()==1){ - byId.setStatus(2); - }else { - byId.setStatus(1); - } - return ApiResult.success(); - } - @ApiOperation(value = "镜架库存分页列表-启用禁用") - @PostMapping(value = "/updateStateFrame") - public ApiResult updateStateFrame(Integer id) { - TFrameGoods byId = frameGoodsService.getById(id); - if (byId.getStatus()==1){ - byId.setStatus(2); - }else { - byId.setStatus(1); - } - return ApiResult.success(); - } - /** - * 出入库单列表 - */ - @ApiOperation(value = "镜架出入库单列表") - @PostMapping(value = "/inventoryReceiptList") - public ApiResult<PageInfo<TWarehousingVO>> inventoryReceiptList(@RequestBody TWarehousingDetailQuery query) { - return ApiResult.success(warehousingService.inventoryReceiptList(query)); - } - @ApiOperation(value = "镜片出入库单列表") - @PostMapping(value = "/inventoryReceiptLensList") - public ApiResult<PageInfo<TWarehousingLensVO>> inventoryReceiptLensList(@RequestBody TWarehousingDetailLensQuery query) { - return ApiResult.success(warehousingService.inventoryReceiptLensList(query)); - } - - /** - * 库存明细记录列表 - */ - @ApiOperation(value = "镜架库存明细记录列表") - @PostMapping(value = "/detailList") - public ApiResult<PageInfo<TFrameWarehousingDetailVO>> detailList(@RequestBody TWarehousingDetailQuery query) { - PageInfo<TFrameWarehousingDetailVO> frameWarehousingDetailVOPageInfo = warehousingService.detailList(query); - return ApiResult.success(frameWarehousingDetailVOPageInfo); - } - /** - * 库存明细记录列表 - */ - @ApiOperation(value = "镜片库存明细记录列表--库存详情") - @PostMapping(value = "/detailLensList") - public ApiResult<TLensGoodsDetailVO> detailLensList(Integer id) { - TLensGoodsDetailVO tLensGoodsDetailVO = new TLensGoodsDetailVO(); - TLensGoods byId = lensGoodsService.getById(id); - TStore byId1 = storeService.getById(byId.getStoreId()); - if (byId1!=null){ - tLensGoodsDetailVO.setStoreName(byId1.getName()); - } - TLensSeries byId2 = lensSeriesService.getById(byId.getSeriesId()); - if (byId2!=null){ - Integer brandId = byId2.getBrandId(); - TBrand byId3 = brandService.getById(brandId); - String t1 = ""; - switch (byId.getLensType()){ - case 1: - t1="球面"; - break; - case 2: - t1="非球面"; - break; - case 3: - t1="双非"; - break; - } - tLensGoodsDetailVO.setTitle(byId3.getName()+byId2.getName()+t1+" "+byId.getRefractiveIndex()); - } - // 查询这个商品的库存明细 - List<TLensWarehousingDetail> list = lensWarehousingDetailService.lambdaQuery().eq(TLensWarehousingDetail::getSeriesId, byId.getSeriesId()) - .eq(TLensWarehousingDetail::getRefractiveIndex, byId.getRefractiveIndex()).list(); - tLensGoodsDetailVO.setList(list); - return ApiResult.success(tLensGoodsDetailVO); - } - - /** - * 添加镜架出库,入库,作废,退货 - */ - @ApiOperation(value = "添加镜架出库,入库,作废,退货") - @PostMapping(value = "/outBound") - public ApiResult outBound(@Validated @RequestBody TWarehousingDTO dto) { - // 获取当前用户 - String username = JwtTokenUtils.getUsername(); - dto.setCreateBy(username); - dto.setCreateTime(LocalDateTime.now()); - dto.setType(WarehousingTypeEnum.FRAME.getCode()); - warehousingService.save(dto); - - // 添加明细 - List<TFrameWarehousingDetail> frameWarehousingDetails = dto.getFrameWarehousingDetails(); - frameWarehousingDetails.forEach(detail -> { - detail.setWarehousingId(dto.getId()); - detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); - }); - if (dto.getStatus()==1||dto.getStatus()==3){ - List<TFrameGoods> list1 = new ArrayList<>(); - for (TFrameWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { - TFrameGoods one = frameGoodsService.lambdaQuery().eq(TFrameGoods::getModelId, frameWarehousingDetail.getModelId()) - .eq(TFrameGoods::getColor, frameWarehousingDetail.getColor()).one(); - if (one!=null){ - if (one.getTotal()-frameWarehousingDetail.getTotal()<0){ - return ApiResult.failed("库存不足"); - } - // 增加对应库存 - one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); - list1.add(one); - } - } - if (!list1.isEmpty())frameGoodsService.updateBatchById(list1); - } - frameWarehousingDetailService.saveBatch(frameWarehousingDetails); - - if (dto.getStatus()==2 || dto.getStatus()==4){ - List<TFrameGoods> list1 = new ArrayList<>(); - List<TFrameGoods> list2 = new ArrayList<>(); - for (TFrameWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { - TFrameGoods one = frameGoodsService.lambdaQuery().eq(TFrameGoods::getModelId, frameWarehousingDetail.getModelId()) - .eq(TFrameGoods::getColor, frameWarehousingDetail.getColor()).one(); - if (one!=null){ - // 增加对应库存 - one.setTotal(one.getTotal()+frameWarehousingDetail.getTotal()); - list1.add(one); - }else { - // 新增 - TFrameGoods tFrameGoods = new TFrameGoods(); - tFrameGoods.setColor(frameWarehousingDetail.getColor()); - tFrameGoods.setTotal(frameWarehousingDetail.getTotal()); - tFrameGoods.setModelId(frameWarehousingDetail.getModelId()); - tFrameGoods.setStoreId(dto.getStoreId()); - list2.add(tFrameGoods); - } - } - if (!list1.isEmpty())frameGoodsService.updateBatchById(list1); - if (!list2.isEmpty())frameGoodsService.saveBatch(list2); - } - - return ApiResult.success(dto.getId()); - } - /** - * 添加镜片出库,入库,作废,退货 - */ - @ApiOperation(value = "添加镜片出库,入库,作废,退货") - @PostMapping(value = "/outBoundLens") - public ApiResult outBoundLens(@Validated @RequestBody TWarehousingLensDTO dto) { - // 获取当前用户 - String username = JwtTokenUtils.getUsername(); - dto.setCreateBy(username); - dto.setCreateTime(LocalDateTime.now()); - dto.setType(WarehousingTypeEnum.LENS.getCode()); - warehousingService.save(dto); - // 添加明细 - List<TLensWarehousingDetail> frameWarehousingDetails = dto.getLensWarehousingDetails(); - frameWarehousingDetails.forEach(detail -> { - detail.setWarehousingId(dto.getId()); - detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); - }); - if (dto.getStatus()==1||dto.getStatus()==3){ - List<TLensGoods> list1 = new ArrayList<>(); - for (TLensWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { - TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) - .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) - .eq(TLensGoods::getLensType, frameWarehousingDetail.getType()) - .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) - .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) - .one(); - if (one!=null){ - if (one.getTotal()-frameWarehousingDetail.getTotal()<0){ - return ApiResult.failed("库存不足"); - } - // 减少对应库存 - one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); - list1.add(one); - } - } - if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); - } - lensWarehousingDetailService.saveBatch(frameWarehousingDetails); - - if (dto.getStatus()==2 || dto.getStatus()==4){ - List<TLensGoods> list1 = new ArrayList<>(); - List<TLensGoods> list2 = new ArrayList<>(); - for (TLensWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { - TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) - .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) - .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) - .eq(TLensGoods::getLensType, frameWarehousingDetail.getType()) - - .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) - .one(); - if (one!=null){ - // 增加对应库存 - one.setTotal(one.getTotal()+frameWarehousingDetail.getTotal()); - list1.add(one); - }else { - // 新增 - TLensGoods tFrameGoods = new TLensGoods(); - tFrameGoods.setLensType(frameWarehousingDetail.getType()); - tFrameGoods.setSeriesId(frameWarehousingDetail.getSeriesId()); - tFrameGoods.setBallMirror(frameWarehousingDetail.getBallMirror()); - tFrameGoods.setColumnMirror(frameWarehousingDetail.getColumnMirror()); - tFrameGoods.setRefractiveIndex(frameWarehousingDetail.getRefractiveIndex()); - tFrameGoods.setTotal(frameWarehousingDetail.getTotal()); - tFrameGoods.setStoreId(dto.getStoreId()); - list2.add(tFrameGoods); - } - } - if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); - if (!list2.isEmpty())lensGoodsService.saveBatch(list2); - } - return ApiResult.success(dto.getId()); - } - - /** - * 查询详情 - */ - @ApiOperation(value = "镜架查询详情") - @GetMapping(value = "/getDetailById") - public ApiResult<TWarehousingVO> getDetailById(@RequestParam Integer id) { - TWarehousing warehousing = warehousingService.getById(id); - TWarehousingVO vo = new TWarehousingVO(); - BeanUtils.copyProperties(warehousing, vo); - List<TFrameWarehousingDetail> list = frameWarehousingDetailService.list(Wrappers.lambdaQuery(TFrameWarehousingDetail.class) - .eq(TFrameWarehousingDetail::getWarehousingId, id)); - vo.setFrameWarehousingDetails(list); - // 统计数量 - vo.setTotalNum(list.stream().mapToInt(TFrameWarehousingDetail::getTotal).sum()); - return ApiResult.success(vo); - } - @ApiOperation(value = "镜片查询详情") - @GetMapping(value = "/getDetailLensById") - public ApiResult<TWarehousingLensVO> getDetailLensById(@RequestParam Integer id) { - TWarehousing warehousing = warehousingService.getById(id); - TWarehousingLensVO vo = new TWarehousingLensVO(); - BeanUtils.copyProperties(warehousing, vo); - List<TLensWarehousingDetail> list = lensWarehousingDetailService.list(Wrappers.lambdaQuery(TLensWarehousingDetail.class) - .eq(TLensWarehousingDetail::getWarehousingId, id)); - vo.setLensWarehousingDetails(list); - // 统计数量 - vo.setTotalNum(list.stream().mapToInt(TLensWarehousingDetail::getTotal).sum()); - return ApiResult.success(vo); - } - -} - diff --git a/optometrist/src/main/java/com/jilongda/optometrist/model/TLensWarehousingDetail.java b/optometrist/src/main/java/com/jilongda/optometrist/model/TLensWarehousingDetail.java index b1ada12..384d02d 100644 --- a/optometrist/src/main/java/com/jilongda/optometrist/model/TLensWarehousingDetail.java +++ b/optometrist/src/main/java/com/jilongda/optometrist/model/TLensWarehousingDetail.java @@ -76,6 +76,9 @@ @ApiModelProperty(value = "入库编号") @TableField("code") private String code; + @ApiModelProperty(value = "门店名称") + @TableField(exist = false) + private String storeName; } diff --git a/optometrist/src/main/java/com/jilongda/optometrist/query/TOptometryQuery.java b/optometrist/src/main/java/com/jilongda/optometrist/query/TOptometryQuery.java index 3a818c0..60a19fc 100644 --- a/optometrist/src/main/java/com/jilongda/optometrist/query/TOptometryQuery.java +++ b/optometrist/src/main/java/com/jilongda/optometrist/query/TOptometryQuery.java @@ -6,25 +6,17 @@ import lombok.Data; @Data -@ApiModel(value = "验光单查询参数") +@ApiModel(value = "验光单记录参数") public class TOptometryQuery extends BasePage { - @ApiModelProperty(value = "微信昵称") - private String name; - @ApiModelProperty(value = "姓名") - private String realName; - @ApiModelProperty(value = "手机号") - private String phone; - @ApiModelProperty(value = "出单日期 2020-11-11 - 2022-11-11") - private String createTime; - @ApiModelProperty(value = "店铺id") - private Integer storeId; - @ApiModelProperty(value = "验光师id") - private Integer optometristId; - @ApiModelProperty(value = "用户id") - private Integer userId; + @ApiModelProperty(value = "姓名或电话") + private String nameOrPhone; + + @ApiModelProperty(value = "出单日期 2020-11-11") + private String time; @ApiModelProperty(value = "开始时间 前端忽略") private String startTime; @ApiModelProperty(value = "结束时间 前端忽略") private String endTime; + } diff --git a/optometrist/src/main/java/com/jilongda/optometrist/query/TWarehousingDetailLensQuery.java b/optometrist/src/main/java/com/jilongda/optometrist/query/TWarehousingDetailLensQuery.java index 8e9a64a..264d87a 100644 --- a/optometrist/src/main/java/com/jilongda/optometrist/query/TWarehousingDetailLensQuery.java +++ b/optometrist/src/main/java/com/jilongda/optometrist/query/TWarehousingDetailLensQuery.java @@ -6,7 +6,7 @@ import lombok.Data; @Data -@ApiModel(value = "镜片明细记录查询/出入库单Query") +@ApiModel(value = "镜片明细记录查询-出入库单Query") public class TWarehousingDetailLensQuery extends TimeRangePageDTO { @ApiModelProperty(value = "品牌") private String brand; diff --git a/optometrist/src/main/java/com/jilongda/optometrist/service/impl/TWarehousingServiceImpl.java b/optometrist/src/main/java/com/jilongda/optometrist/service/impl/TWarehousingServiceImpl.java index c23b49f..6fc1c5c 100644 --- a/optometrist/src/main/java/com/jilongda/optometrist/service/impl/TWarehousingServiceImpl.java +++ b/optometrist/src/main/java/com/jilongda/optometrist/service/impl/TWarehousingServiceImpl.java @@ -39,6 +39,8 @@ @Autowired private TStoreMapper storeMapper; @Autowired + private TWarehousingMapper warehousingMapper; + @Autowired private TFrameWarehousingDetailMapper frameWarehousingDetailMapper; @Autowired private TLensWarehousingDetailMapper lensWarehousingDetailMapper; diff --git a/optometrist/src/main/java/com/jilongda/optometrist/vo/TOptometryVO.java b/optometrist/src/main/java/com/jilongda/optometrist/vo/TOptometryVO.java index a708b48..5196954 100644 --- a/optometrist/src/main/java/com/jilongda/optometrist/vo/TOptometryVO.java +++ b/optometrist/src/main/java/com/jilongda/optometrist/vo/TOptometryVO.java @@ -1,5 +1,6 @@ package com.jilongda.optometrist.vo; +import com.jilongda.common.pojo.BaseModel; import com.jilongda.optometrist.model.TOptometry; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -7,18 +8,13 @@ @Data @ApiModel(value = "验光单VO") -public class TOptometryVO extends TOptometry { +public class TOptometryVO extends BaseModel { @ApiModelProperty(value = "门店名称") private String storeName; @ApiModelProperty(value = "微信名称") - private String name; - @ApiModelProperty(value = "R值") - private String rValue; - @ApiModelProperty(value = "L值") - private String lValue; - @ApiModelProperty(value = "瞳距") - private String pupilDistance; - @ApiModelProperty(value = "验光师名称") - private String optometristName; + private String wxName; + @ApiModelProperty(value = "电话") + private String phone; + } diff --git a/optometrist/src/main/resources/mapping/LoginLogMapper.xml b/optometrist/src/main/resources/mapping/LoginLogMapper.xml new file mode 100644 index 0000000..14365f6 --- /dev/null +++ b/optometrist/src/main/resources/mapping/LoginLogMapper.xml @@ -0,0 +1,53 @@ +<?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.jilongda.optometrist.mapper.LoginLogMapper"> + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.common.model.LoginLog"> + <id column="id" property="id"/> + <result column="user_name" property="userName"/> + <result column="account" property="account"/> + <result column="work_address" property="workAddress"/> + <result column="login_address" property="loginAddress"/> + <result column="login_time" property="loginTime"/> + <result column="login_ip" property="loginIp"/> + <result column="equipment" property="equipment"/> + <result column="open_id" property="openId"/> + <result column="applet_or_manage" property="appletOrManage"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id + , user_name, account, work_address, login_address, login_time, login_ip,equipment,open_id,applet_or_manage + </sql> + + <select id="pageList" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List"> + </include> + from login_log + <where> + <if test="query.account != null and query.account != ''"> + AND account like concat('%',#{query.account},'%') + </if> + <if test="query.shortName != null and query.shortName != ''"> + AND user_name like concat('%',#{query.shortName},'%') + </if> + <if test="query.startTime != null and query.endTime != null"> + AND DATE_FORMAT(login_time, '%Y-%m-%d %H:%i:%s') >= #{query.startTime} + AND DATE_FORMAT(login_time, '%Y-%m-%d %H:%i:%s') <= #{query.endTime} + </if> + </where> + ORDER BY login_time DESC + </select> + <select id="countToday" resultType="java.lang.Long"> + select count(DISTINCT (account)) + from login_log + where login_time like concat('%', #{today,jdbcType=DATE}, '%') + </select> + <select id="countYesterday" resultType="java.lang.Long"> + select count(DISTINCT (account)) + from login_log + where login_time like concat('%', #{yesterday,jdbcType=DATE}, '%') + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/OperLogMapper.xml b/optometrist/src/main/resources/mapping/OperLogMapper.xml new file mode 100644 index 0000000..5a03d29 --- /dev/null +++ b/optometrist/src/main/resources/mapping/OperLogMapper.xml @@ -0,0 +1,44 @@ +<?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.jilongda.optometrist.mapper.OperLogMapper"> + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.common.model.OperLog"> + <id column="id" property="id"/> + <result column="oper_user_name" property="operUserName"/> + <result column="oper_account" property="operAccount"/> + <result column="oper_operation_time" property="operOperationTime"/> + <result column="oper_ip" property="operIp"/> + <result column="oper_model" property="operModel"/> + <result column="oper_type" property="operType"/> + <result column="oper_desc" property="operDesc"/> + <result column="oper_uri" property="operUri"/> + <result column="oper_method" property="operMethod"/> + <result column="oper_req_param" property="operReqParam"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id + , oper_user_name, oper_account, oper_operation_time, oper_ip, oper_model, oper_type, oper_desc, oper_uri, oper_method,oper_req_param + </sql> + + <select id="pageList" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List"> + </include> + from oper_log + <where> + <if test="query.account != null and query.account != ''"> + AND oper_account like concat('%',#{query.account},'%') + </if> + <if test="query.shortName != null and query.shortName != ''"> + AND oper_user_name like concat('%',#{query.shortName},'%') + </if> + <if test="query.startTime != null and query.endTime != null"> + AND DATE_FORMAT(oper_operation_time, '%Y-%m-%d %H:%i:%s') >= #{query.startTime} + AND DATE_FORMAT(oper_operation_time, '%Y-%m-%d %H:%i:%s') <= #{query.endTime} + </if> + </where> + ORDER BY oper_operation_time DESC + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecFeeItemsMapper.xml b/optometrist/src/main/resources/mapping/SecFeeItemsMapper.xml new file mode 100644 index 0000000..649313f --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecFeeItemsMapper.xml @@ -0,0 +1,23 @@ +<?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.jilongda.optometrist.mapper.SecFeeItemsMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.SecFeeItems"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="percent" property="percent" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, name, percent, status, createTime, updateTime, createBy, updateBy, isDelete + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecResourcesMapper.xml b/optometrist/src/main/resources/mapping/SecResourcesMapper.xml new file mode 100644 index 0000000..1109133 --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecResourcesMapper.xml @@ -0,0 +1,109 @@ +<?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.jilongda.optometrist.authority.mapper.SecResourcesMapper"> + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.authority.model.SecResources"> + <id column="id" property="id"/> + <result column="createBy" property="createBy"/> + <result column="createTime" property="createTime"/> + <result column="updateBy" property="updateBy"/> + <result column="updateTime" property="updateTime"/> + <result column="isDelete" property="isDelete"/> + <result column="parent_id" property="parentId"/> + <result column="title" property="title"/> + <result column="descriptions" property="descriptions"/> + <result column="sort" property="sort"/> + <result column="icon" property="icon"/> + <result column="name" property="name"/> + <result column="menu" property="menu"/> + <result column="component" property="component"/> + <result column="permit" property="permit"/> + <result column="cate" property="cate"/> + <result column="type" property="type"/> + <result column="hidden" property="hidden"/> + <result column="env_port" property="envPort"/> + <result column="path" property="path"/> + <result column="api_url" property="apiUrl"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + createBy + , + createTime, + updateBy, + updateTime, + isDelete, + id, parent_id, title, descriptions, sort, icon, `name`, menu, component, permit, cate, `type`, hidden, env_port, `path`, api_url + </sql> + + <sql id="Base_Column_List_By_Uid"> + re.id, re.parent_id, title, re.descriptions, re.sort, re.icon, re.name, re.menu, re.component, re.permit, + re.cate, re.type, re.hidden, re.env_port, re.path, re.api_url, + re.isDelete, re.createTime, re.updateTime + </sql> + + <select id="selectResourceByUid" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List_By_Uid"/> + from sec_user_role ur left join sec_role sr on ur.role_id = sr.id + left join sec_role_resource rr on sr.id = rr.role_id + left join sec_resources re on rr.resource_id = re.id + where + ur.user_id = #{uid,jdbcType=INTEGER} + AND re.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + ORDER BY re.sort + </select> + + <select id="getList" resultType="com.jilongda.optometrist.authority.vo.SecResourceVO"> + select sr.createBy, + sr.createTime, + sr.updateBy, + sr.updateTime, + sr.isDelete, + sr.id, + sr.parent_id, + sr.title, + sr.descriptions, + sr.sort, + sr.icon, + sr.name, + sr.menu, + sr.component, + sr.permit, + sr.cate, + sr.type, + sr.hidden, + sr.env_port, + sr.path, + sr.api_url + from sec_role_resource srr + left join sec_resources sr on srr.resource_id = sr.id + where srr.role_id = #{rid,jdbcType=VARCHAR} + </select> + <select id="allList" resultType="com.jilongda.optometrist.authority.vo.SecResourceVO"> + select createBy, + createTime, + updateBy, + updateTime, + isDelete, + id, + parent_id AS parentId, + title, + descriptions, + sort, + icon, + `name`, + menu, + component, + permit, + cate, + `type`, + hidden, + env_port AS envPort, + `path`, + api_url AS apiUrl + from sec_resources + ORDER BY parent_id + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecRoleMapper.xml b/optometrist/src/main/resources/mapping/SecRoleMapper.xml new file mode 100644 index 0000000..169ab58 --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecRoleMapper.xml @@ -0,0 +1,71 @@ +<?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.jilongda.optometrist.authority.mapper.SecRoleMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.authority.model.SecRole"> + <id column="id" property="id" /> + <result column="createBy" property="createBy"/> + <result column="createTime" property="createTime"/> + <result column="updateBy" property="updateBy"/> + <result column="updateTime" property="updateTime"/> + <result column="isDelete" property="isDelete"/> + <result column="rolename" property="rolename" /> + <result column="role_desc" property="roleDesc" /> + <result column="role_state" property="roleState" /> + <result column="sortBy" property="sortBy" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + createBy, + createTime, + updateBy, + updateTime, + isDelete, + id, rolename, role_desc, role_state + </sql> + + <!--根据用户id查询所有集合--> + <select id="selectRolesByUid" resultMap="BaseResultMap"> + select + r.createBy, + r.createTime, + r.updateBy, + r.updateTime, + r.isDelete, + r.id, r.rolename, r.role_desc AS roleDesc, r.role_state AS roleState,r.sortBy + from sec_role r,sec_user_role u + <where> + r.id = u.role_id + and u.user_id = #{uid,jdbcType=INTEGER} + and r.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + ORDER BY r.sortBy DESC + </where> + </select> + <!--通过角色查找人员--> + <select id="getUserByRole" resultType="com.jilongda.optometrist.authority.vo.SecUserVO"> + SELECT sr.id AS roleId,su.id AS userId,su.account + FROM sec_role sr + LEFT JOIN sec_user_role sur ON sr.id = sur.role_id + LEFT JOIN sec_user su ON sur.user_id = su.id + <where> + <if test="dto.id != null"> + sr.id = #{dto.id} + </if> + and sr.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + </select> + + <select id="selectResByRid" resultType="java.lang.Long"> + SELECT + resource_id + FROM sec_resources r,sec_role_resource srr + <where> + r.id = srr.resource_id + AND srr.role_id = #{rid,jdbcType=INTEGER} + AND r.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + GROUP BY r.id + </where> + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecRoleResourceMapper.xml b/optometrist/src/main/resources/mapping/SecRoleResourceMapper.xml new file mode 100644 index 0000000..e7efeb4 --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecRoleResourceMapper.xml @@ -0,0 +1,16 @@ +<?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.jilongda.optometrist.authority.mapper.SecRoleResourceMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.authority.model.SecRoleResource"> + <result column="role_id" property="roleId" /> + <result column="resource_id" property="resourceId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + role_id, resource_id + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecSettingMapper.xml b/optometrist/src/main/resources/mapping/SecSettingMapper.xml new file mode 100644 index 0000000..14acb6e --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecSettingMapper.xml @@ -0,0 +1,22 @@ +<?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.jilongda.optometrist.mapper.SecSettingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.SecSetting"> + <id column="id" property="id" /> + <result column="lensThreshold" property="lensThreshold" /> + <result column="frameThreshold" property="frameThreshold" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, lensThreshold, frameThreshold, createTime, updateTime, createBy, updateBy, isDelete + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecUserMapper.xml b/optometrist/src/main/resources/mapping/SecUserMapper.xml new file mode 100644 index 0000000..9424550 --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecUserMapper.xml @@ -0,0 +1,167 @@ +<?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.jilongda.optometrist.authority.mapper.SecUserMapper"> + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.authority.model.SecUser"> + <id column="id" property="id"/> + <result column="createBy" property="createBy"/> + <result column="createTime" property="createTime"/> + <result column="updateBy" property="updateBy"/> + <result column="updateTime" property="updateTime"/> + <result column="isDelete" property="isDelete"/> + <result column="account" property="account"/> + <result column="description" property="description"/> + <result column="password" property="password"/> + <result column="phone" property="phone"/> + <result column="state" property="state"/> + <result column="last_login_time" property="lastLoginTime"/> + <result column="nick_name" property="nickName"/> + <result column="avatar_url" property="avatarUrl"/> + <result column="province" property="province"/> + <result column="city" property="city"/> + <result column="area" property="area"/> + <result column="address" property="address"/> + <result column="birthday" property="birthday"/> + <result column="gender" property="gender"/> + <result column="deptId" property="deptId"/> + <result column="userType" property="userType"/> + <result column="storeId" property="storeId"/> + <result column="provinceCode" property="provinceCode"/> + <result column="cityCode" property="cityCode"/> + <result column="areaCode" property="areaCode"/> + <result column="pictures" property="pictures"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + createBy + , + createTime, + updateBy, + updateTime, + isDelete, + id, account, description, password, phone, `state`, last_login_time AS lastLoginTime, + nick_name AS nickName, avatar_url AS avatarUrl, province, city, area, address, birthday, gender,deptId,userType, + provinceCode, cityCode, areaCode,storeId,pictures + </sql> + + <sql id="Base_Column_List_Other"> + su.createBy, + su.createTime, + su.updateBy, + su.updateTime, + su.isDelete, + su.id, su.account, su.description, su.password, su.phone, su.`state`, su.last_login_time AS lastLoginTime, + su.nick_name AS nickName, su.avatar_url AS avatarUrl, su.province, su.city, su.area, su.address, su.birthday, su.gender,su.deptId,su.userType, + su.provinceCode, su.cityCode, su.areaCode,su.pictures + </sql> + + <select id="getSecUserList" resultType="com.jilongda.optometrist.authority.vo.SecUsersVO"> + SELECT + su.createBy, + su.createTime, + su.updateBy, + su.updateTime, + su.isDelete, + su.id, + su.`account`, + su.`description`, + su.`password`, + su.phone, + su.state, + su.roleType, + su.last_login_time AS lastLoginTime, su.nick_name AS nickName, su.avatar_url AS avatarUrl, su.province, su.city, su.area, su.address, + su.birthday, su.gender,sr.id AS roleId,sr.rolename AS rolename,su.deptId,su.userType,su.provinceCode, su.cityCode, su.areaCode,su.pictures + FROM sec_user su + LEFT JOIN sec_user_role sur ON su.id = sur.user_id + LEFT JOIN sec_role sr ON sur.role_id = sr.id + <where> + <if test="dto.nickName != null and dto.nickName != ''"> + AND su.nick_name LIKE concat('%', #{dto.nickName,jdbcType=VARCHAR}, '%') + </if> + <if test="dto.phone != null and dto.phone != ''"> + AND su.phone LIKE concat('%', #{dto.phone,jdbcType=VARCHAR}, '%') + </if> + <if test="dto.state != null"> + AND su.state = #{dto.state} + </if> + <if test="dto.storeId != null"> + AND su.storeId = #{dto.storeId} + </if> + <if test="dto.roleId != null"> + AND sr.id = #{dto.roleId} + </if> + AND su.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY su.createTime DESC + </select> + + <select id="queryLower" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List"> + </include> + from sec_user + <where> + <if test="query.userType != null and query.userType == 6"> + AND user_type = #{query.userType} + and personnel_structure_id like concat('%','DR','%') + </if> + <if test="query.userType != null and query.userType == 7"> + AND user_type = #{query.userType} + and personnel_structure_id like concat('%','HC','%') + </if> + AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + </select> + <select id="getUserByRoleId" resultType="com.jilongda.optometrist.authority.model.SecUser"> + select <include refid="Base_Column_List_Other"></include> + from sec_user_role sur + left join sec_user su on sur.user_id = su.id + where sur.role_id = #{id,jdbcType=VARCHAR} + and su.id is not null + </select> + + <select id="selectListByNamePhoneDeptId" resultType="com.jilongda.optometrist.authority.model.SecUser"> + select <include refid="Base_Column_List"></include> + from sec_user + WHERE isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + <if test="name != null and name != ''"> + AND (nick_name LIKE concat('%',#{name},'%') + OR phone LIKE concat('%',#{name},'%')) + </if> + <if test="deptId != null"> + AND deptId = #{deptId} + </if> + </select> + + <select id="selectListByNamePhoneDeptIds" resultType="com.jilongda.optometrist.authority.model.SecUser"> + select <include refid="Base_Column_List"></include> + from sec_user + WHERE isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + <if test="name != null and name != ''"> + AND (nick_name LIKE concat('%',#{name},'%') + OR phone LIKE concat('%',#{name},'%')) + </if> + <if test="deptIds != null and deptIds.size()>0"> + AND deptId IN + <foreach collection="deptIds" close=")" open="(" item="id" separator=","> + #{id} + </foreach> + </if> + </select> + <select id="selectUserById" resultType="com.jilongda.optometrist.authority.model.SecUser"> + select <include refid="Base_Column_List"></include> + from sec_user + where id = #{orderingPersonId} + </select> + <select id="queryList" resultType="com.jilongda.optometrist.authority.model.SecUser"> + select <include refid="Base_Column_List"></include> + from sec_user + </select> + + <delete id="removeById"> + delete + from sec_user + where id = #{uid} + </delete> +</mapper> diff --git a/optometrist/src/main/resources/mapping/SecUserRoleMapper.xml b/optometrist/src/main/resources/mapping/SecUserRoleMapper.xml new file mode 100644 index 0000000..fcc092a --- /dev/null +++ b/optometrist/src/main/resources/mapping/SecUserRoleMapper.xml @@ -0,0 +1,31 @@ +<?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.jilongda.optometrist.authority.mapper.SecUserRoleMapper"> + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.authority.model.SecUserRole"> + <result column="role_id" property="roleId"/> + <result column="user_id" property="userId"/> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + role_id + , user_id + </sql> + <select id="getRoleByUserId" resultType="com.jilongda.optometrist.authority.model.SecRole"> + select sr.id, + sr.rolename, + sr.role_desc, + sr.createBy, + sr.createTime, + sr.updateBy, + sr.updateTime, + sr.isDelete, + sr.role_state + from sec_user su + left join sec_user_role sur on su.id = sur.user_id + left join sec_role sr on sur.role_id = sr.id + where su.id = #{userId,jdbcType=VARCHAR} + AND su.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/TAppUserMapper.xml b/optometrist/src/main/resources/mapping/TAppUserMapper.xml new file mode 100644 index 0000000..a040356 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TAppUserMapper.xml @@ -0,0 +1,45 @@ +<?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.jilongda.optometrist.mapper.TAppUserMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TAppUser"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="phone" property="phone" /> + <result column="realName" property="realName" /> + <result column="age" property="age" /> + <result column="gender" property="gender" /> + <result column="registerTime" property="registerTime" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, name, phone, realName, age, gender, registerTime, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TAppUserVO"> + select * from + t_app_user + where 1=1 + <if test="query.name != null and query.name != ''"> + and name like concat('%',#{query.name},'%') + </if> + <if test="query.phone != null and query.phone != ''"> + and phone like concat('%',#{query.phone},'%') + </if> + <if test="query.realName != null and query.realName != ''"> + and realName like concat('%',#{query.realName},'%') + </if> + <if test="query.startTime != null and query.startTime != ''"> + and (createTime between #{query.startTime} and #{query.endTime}) + </if> + and isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TBrandMapper.xml b/optometrist/src/main/resources/mapping/TBrandMapper.xml new file mode 100644 index 0000000..f70a4ca --- /dev/null +++ b/optometrist/src/main/resources/mapping/TBrandMapper.xml @@ -0,0 +1,33 @@ +<?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.jilongda.optometrist.mapper.TBrandMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TBrand"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="type" property="type" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="isMain" property="isMain" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, `name`, `type`, status, createTime, updateTime, createBy, updateBy, isDelete, isMain + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TBrandVO"> + select <include refid="Base_Column_List"></include> + from t_brand + where isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + <if test="query.type != null"> + AND `type` = #{query.type} + </if> + ORDER BY createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TCouponMapper.xml b/optometrist/src/main/resources/mapping/TCouponMapper.xml new file mode 100644 index 0000000..777a233 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TCouponMapper.xml @@ -0,0 +1,41 @@ +<?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.jilongda.optometrist.mapper.TCouponMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TCoupon"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="type" property="type" /> + <result column="amount" property="amount" /> + <result column="storeId" property="storeId" /> + <result column="time" property="time" /> + <result column="amountCondition" property="amountCondition" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="grantStatus" property="grantStatus" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, name, type, amount, storeId, time, amountCondition, createTime, updateTime, createBy, updateBy, isDelete, grantStatus + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TCouponVO"> + select t1.* from + t_coupon t1 + where 1=1 + <if test="query.name != null and query.name != ''"> + and t1.name like concat('%',#{query.name},'%') + </if> + <if test="query.type != null and query.type != ''"> + and t1.type =#{query.type} + </if> + <if test="query.grantStatus != null and query.grantStatus != ''"> + and t1.grantStatus =#{query.grantStatus} + </if> + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TCouponReceiveMapper.xml b/optometrist/src/main/resources/mapping/TCouponReceiveMapper.xml new file mode 100644 index 0000000..4bf0870 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TCouponReceiveMapper.xml @@ -0,0 +1,35 @@ +<?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.jilongda.optometrist.mapper.TCouponReceiveMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TCouponReceive"> + <id column="id" property="id" /> + <result column="couponId" property="couponId" /> + <result column="userId" property="userId" /> + <result column="type" property="type" /> + <result column="amount" property="amount" /> + <result column="storeId" property="storeId" /> + <result column="endTime" property="endTime" /> + <result column="amountCondition" property="amountCondition" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, couponId, userId, type, amount, storeId, endTime, amountCondition, status, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TAppUserCouponVO"> + select t1.* ,t2.name as couponName from + t_coupon_receive t1 + left join t_coupon t2 on t1.couponId = t2.id + where t1.userId = #{query.id} + and t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TFrameGoods.xml b/optometrist/src/main/resources/mapping/TFrameGoods.xml new file mode 100644 index 0000000..dafc822 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TFrameGoods.xml @@ -0,0 +1,52 @@ +<?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.jilongda.optometrist.mapper.TFrameGoodsMapper"> + + + <select id="lensReceiptList" resultType="com.jilongda.optometrist.vo.TFrameGoodsVO"> + select t1.*,t2.name as model,t5.name as supplier,t3.name as material,t4.name as store, + t2.sale as sale,t2.cost as cost,t6.name as brand,t7.frameThreshold + from + t_frame_goods t1 + left join t_model t2 on t1.modelId=t2.id + left join t_material t3 on t2.materialId = t3.id + left join t_store t4 on t1.storeId = t4.id + left join t_supplier t5 on t2.supplierId = t5.id + left join t_brand t6 on t2.brandId=t6.id + left join sec_setting t7 on 1=1 + where 1=1 + <if test="query.brandId != null "> + and t2.brandId = #{query.brandId} + </if> + <if test="query.supplierId != null "> + and t2.supplierId = #{query.supplierId} + </if> + <if test="query.color != null and query.color != ''"> + and t1.color = #{query.color} + </if> + <if test="query.storeId != null "> + and t1.storeId = #{query.storeId} + </if> + <if test="query.model != null and query.model != ''"> + and t2.name = #{query.model} + </if> + <if test="query.materialId != null "> + and t2.materialId = #{query.materialId} + </if> + <if test="query.status != null "> + and t1.status = #{query.status} + </if> + <if test="query.isWarning != null and query.isWarning = 1"> + and t1.total < t7.frameThreshold + </if> + <if test="query.isWarning != null and query.isWarning = 2"> + and t1.total >= t7.frameThreshold + </if> + <if test="query.startCount != null and query.endCount != null"> + and t1.total between #{query.startCount} and #{query.endCount} + </if> + and t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + + order by t1.id + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/TFrameWarehousingDetailMapper.xml b/optometrist/src/main/resources/mapping/TFrameWarehousingDetailMapper.xml new file mode 100644 index 0000000..bee9c29 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TFrameWarehousingDetailMapper.xml @@ -0,0 +1,60 @@ +<?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.jilongda.optometrist.mapper.TFrameWarehousingDetailMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TFrameWarehousingDetail"> + <id column="id" property="id" /> + <result column="warehousingId" property="warehousingId" /> + <result column="brand" property="brand" /> + <result column="supplier" property="supplier" /> + <result column="material" property="material" /> + <result column="total" property="total" /> + <result column="color" property="color" /> + <result column="model" property="model" /> + <result column="code" property="code" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="modelId" property="modelId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, warehousingId, brand, supplier, material, total, color, model, code, createTime, updateTime, createBy, updateBy, isDelete, modelId + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TFrameWarehousingDetailVO"> + select tfwd.id, tfwd.warehousingId, tfwd.brand, tfwd.supplier, tfwd.material, tfwd.total, tfwd.color, tfwd.model, tfwd.code, tfwd.createTime, + tfwd.updateTime, tfwd.createBy, tfwd.updateBy, tfwd.isDelete, tfwd.modelId + from t_frame_warehousing_detail tfwd + left join t_warehousing tw on tfwd.warehousingId = tw.id + <where> + <if test="query.brand != null and query.brand != ''"> + and tfwd.brand = #{query.brand} + </if> + <if test="query.supplier != null and query.supplier != ''"> + and tfwd.supplier = #{query.supplier} + </if> + <if test="query.color != null and query.color != ''"> + and tfwd.color = #{query.color} + </if> + <if test="query.model != null and query.model != ''"> + and tfwd.model like concat('%',#{query.model},'%') + </if> + <if test="query.storeId != null"> + and tw.storeId = #{query.storeId} + </if> + <if test="query.status != null"> + and tw.status = #{query.status} + </if> + <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> + and tfwd.createTime between #{query.startTime} and #{query.endTime} + </if> + and tfwd.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY tfwd.createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TInventoryFrameDetailMapper.xml b/optometrist/src/main/resources/mapping/TInventoryFrameDetailMapper.xml new file mode 100644 index 0000000..5294467 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TInventoryFrameDetailMapper.xml @@ -0,0 +1,30 @@ +<?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.jilongda.optometrist.mapper.TInventoryFrameDetailMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TInventoryFrameDetail"> + <id column="id" property="id" /> + <result column="inventoryId" property="inventoryId" /> + <result column="brand" property="brand" /> + <result column="supplier" property="supplier" /> + <result column="material" property="material" /> + <result column="total" property="total" /> + <result column="category" property="category" /> + <result column="color" property="color" /> + <result column="model" property="model" /> + <result column="count" property="count" /> + <result column="diff" property="diff" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, inventoryId, brand, supplier, material, total, category, color, model, count, diff, createTime, updateTime, createBy, updateBy, isDelete + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TInventoryLensDetailMapper.xml b/optometrist/src/main/resources/mapping/TInventoryLensDetailMapper.xml new file mode 100644 index 0000000..8ea3227 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TInventoryLensDetailMapper.xml @@ -0,0 +1,30 @@ +<?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.jilongda.optometrist.mapper.TInventoryLensDetailMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TInventoryLensDetail"> + <id column="id" property="id" /> + <result column="inventoryId" property="inventoryId" /> + <result column="series" property="series" /> + <result column="type" property="type" /> + <result column="total" property="total" /> + <result column="count" property="count" /> + <result column="diff" property="diff" /> + <result column="refractiveIndex" property="refractiveIndex" /> + <result column="ballMirror" property="ballMirror" /> + <result column="columnMirror" property="columnMirror" /> + <result column="category" property="category" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, inventoryId, series, type, total, count, diff, refractiveIndex, ballMirror, columnMirror, category, createTime, updateTime, createBy, updateBy, isDelete + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TInventoryMapper.xml b/optometrist/src/main/resources/mapping/TInventoryMapper.xml new file mode 100644 index 0000000..4a7927c --- /dev/null +++ b/optometrist/src/main/resources/mapping/TInventoryMapper.xml @@ -0,0 +1,47 @@ +<?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.jilongda.optometrist.mapper.TInventoryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TInventory"> + <id column="id" property="id" /> + <result column="status" property="status" /> + <result column="type" property="type" /> + <result column="storeId" property="storeId" /> + <result column="remark" property="remark" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, status, type, storeId, remark, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TInventoryVO"> + select t1.*,t2.name as store from + t_inventory t1 + left join t_store t2 on t1.storeId = t2.id + where 1=1 + <if test="query.status != null "> + and t1.status = #{query.status} + </if> + <if test="query.createBy != null "> + and t1.createBy = #{query.createBy} + </if> + <if test="query.type != null "> + and t1.type = #{query.type} + </if> + <if test="query.storeId != null "> + and t1.storeId = #{query.storeId} + </if> + <if test="query.startTime != null and query.startTime != ''"> + and t1.createTime between #{query.startTime} and #{query.endTime} + </if> + and t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TLensGoods.xml b/optometrist/src/main/resources/mapping/TLensGoods.xml new file mode 100644 index 0000000..57b0731 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TLensGoods.xml @@ -0,0 +1,47 @@ +<?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.jilongda.optometrist.mapper.TLensGoodsMapper"> + + + <select id="lensReceiptList" resultType="com.jilongda.optometrist.vo.TLensGoodsVO"> + select t1.*,t2.name as series,t4.name as store, + t2.sphere as sphere,t2.asphericSurface as asphericSurface + ,t2.doubleNon as doubleNon + ,t6.name as brand,t7.frameThreshold + from + t_lens_goods t1 + left join t_lens_series t2 on t1.seriesId=t2.id + left join t_store t4 on t1.storeId = t4.id + left join t_brand t6 on t2.brandId=t6.id + left join sec_setting t7 on 1=1 + <where> + <if test="query.brandId != null "> + and t2.brandId = #{query.brandId} + </if> + <if test="query.seriesId != null "> + and t2.id = #{query.seriesId} + </if> + <if test="query.lensType != null "> + and t1.lensType = #{query.lensType} + </if> + <if test="query.storeId != null "> + and t1.storeId = #{query.storeId} + </if> + <if test="query.refractiveIndex != null and query.refractiveIndex != ''"> + and t1.refractiveIndex = #{query.refractiveIndex} + </if> + <if test="query.type != null "> + and t2.type = #{query.type} + </if> + <if test="query.isWarning !=null and query.isWarning==1"> + and t1.total <= t7.lensThreshold + </if> + <if test="query.isWarning !=null and query.isWarning ==2"> + and t1.total >= t7.lensThreshold + </if> + + and t1.isDelete = 0 + </where> + order by t1.id + </select> +</mapper> diff --git a/optometrist/src/main/resources/mapping/TLensSeriesMapper.xml b/optometrist/src/main/resources/mapping/TLensSeriesMapper.xml new file mode 100644 index 0000000..b1994fd --- /dev/null +++ b/optometrist/src/main/resources/mapping/TLensSeriesMapper.xml @@ -0,0 +1,45 @@ +<?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.jilongda.optometrist.mapper.TLensSeriesMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TLensSeries"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="brandId" property="brandId" /> + <result column="supplierId" property="supplierId" /> + <result column="type" property="type" /> + <result column="sphere" property="sphere" /> + <result column="asphericSurface" property="asphericSurface" /> + <result column="doubleNon" property="doubleNon" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, name, brandId, supplierId, type, sphere, asphericSurface, doubleNon, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TLensSeriesVO"> + select t1.*,t2.name as brandName + from t_lens_series t1 + left join t_brand t2 on t1.brandId = t2.id + where 1=1 + <if test="query.brandId != null and query.brandId != ''"> + and t1.brandId = #{query.brandId} + </if> + <if test="query.type != null and query.type != ''"> + and t1.type = #{query.type} + </if> + and t2.type = 2 + and t2.status = 1 + and t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + and t2.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + order by t1.id asc + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TLensWarehousingDetailMapper.xml b/optometrist/src/main/resources/mapping/TLensWarehousingDetailMapper.xml new file mode 100644 index 0000000..05375b0 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TLensWarehousingDetailMapper.xml @@ -0,0 +1,67 @@ +<?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.jilongda.optometrist.mapper.TLensWarehousingDetailMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TLensWarehousingDetail"> + <id column="id" property="id" /> + <result column="brand" property="brand" /> + <result column="supplier" property="supplier" /> + <result column="series" property="series" /> + <result column="refractiveIndex" property="refractiveIndex" /> + <result column="ballMirror" property="ballMirror" /> + <result column="columnMirror" property="columnMirror" /> + <result column="type" property="type" /> + <result column="total" property="total" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="count" property="count" /> + <result column="seriesId" property="seriesId" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, brand, supplier, series, refractiveIndex, ballMirror, columnMirror, `type`, total, createTime, updateTime, createBy, updateBy, isDelete, `count`, seriesId + </sql> + <select id="pageLensList" resultType="com.jilongda.optometrist.vo.TLensWarehousingDetailVO"> + select tlwd.id, tlwd.warehousingId, tlwd.brand, tlwd.supplier, tlwd.series, tlwd.total, tlwd.refractiveIndex, tlwd.ballMirror, tlwd.code, tlwd.createTime,tlwd.columnMirror, + tlwd.updateTime, tlwd.createBy, tlwd.updateBy, tlwd.isDelete, tlwd.`type` + from t_lens_warehousing_detail tlwd + left join t_warehousing tw on tlwd.warehousingId = tw.id + <where> + <if test="query.brand != null and query.brand != ''"> + and tlwd.brand = #{query.brand} + </if> + <if test="query.series != null and query.series != ''"> + and tlwd.series = #{query.series} + </if> + <if test="query.type != null and query.type != ''"> + and tlwd.`type` = #{query.type} + </if> + <if test="query.refractiveIndex != null and query.refractiveIndex != ''"> + and tlwd.refractiveIndex = #{query.refractiveIndex} + </if> + <if test="query.ballMirror != null and query.ballMirror != ''"> + and tlwd.ballMirror = #{query.ballMirror} + </if> + <if test="query.columnMirror != null and query.columnMirror != ''"> + and tlwd.columnMirror = #{query.columnMirror} + </if> + <if test="query.storeId != null"> + and tw.storeId = #{query.storeId} + </if> + <if test="query.status != null"> + and tw.status = #{query.status} + </if> + <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> + and tlwd.createTime between #{query.startTime} and #{query.endTime} + </if> + and tlwd.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY tlwd.createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TLineUpMapper.xml b/optometrist/src/main/resources/mapping/TLineUpMapper.xml new file mode 100644 index 0000000..5f4c455 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TLineUpMapper.xml @@ -0,0 +1,49 @@ +<?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.jilongda.optometrist.mapper.TLineUpMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TLineUp"> + <id column="id" property="id" /> + <result column="code" property="code" /> + <result column="userId" property="userId" /> + <result column="optometristId" property="optometristId" /> + <result column="storeId" property="storeId" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, code, userId, optometristId, storeId, status, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.model.TLineUp"> + select t.*,u.name,u.phone,u.age,u.gender,u.realName,s.name storeName,o.name optometrist + from t_line_up t + left join t_user u on t.userId = u.id + left join t_optometrist o on t.optometristId = o.id + left join t_store s on t.storeId = s.id + <where> + <if test="query.status != null"> + and t.status = #{query.status} + </if> + <if test="query.phone != null and query.phone != ''"> + AND u.phone like concat('%',#{query.phone},'%') + </if> + <if test="query.name != null and query.name != ''"> + AND u.name like concat('%',#{query.name},'%') + </if> + <if test="query.storeId != null"> + and s.id = #{query.storeId} + </if> + and t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + + </where> + order by t.createTime desc + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TMaterialMapper.xml b/optometrist/src/main/resources/mapping/TMaterialMapper.xml new file mode 100644 index 0000000..5a602b6 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TMaterialMapper.xml @@ -0,0 +1,28 @@ +<?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.jilongda.optometrist.mapper.TMaterialMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TMaterial"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, `name`, status, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TMaterialVO"> + select <include refid="Base_Column_List"></include> + from t_material + where isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + order by createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TModelMapper.xml b/optometrist/src/main/resources/mapping/TModelMapper.xml new file mode 100644 index 0000000..ac9758d --- /dev/null +++ b/optometrist/src/main/resources/mapping/TModelMapper.xml @@ -0,0 +1,47 @@ +<?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.jilongda.optometrist.mapper.TModelMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TModel"> + <id column="id" property="id" /> + <result column="brandId" property="brandId" /> + <result column="supplierId" property="supplierId" /> + <result column="materialId" property="materialId" /> + <result column="color" property="color" /> + <result column="sale" property="sale" /> + <result column="cost" property="cost" /> + <result column="name" property="name" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="inventory" property="inventory" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, brandId, supplierId, materialId, color, sale, cost, `name`, status, createTime, updateTime, createBy, updateBy, isDelete,inventory + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TModelVO"> + select <include refid="Base_Column_List"></include> + from t_model + <where> + <if test="query.name != null and query.name != ''"> + and `name` like concat('%',#{query.name},'%') + </if> + <if test="query.brandId != null"> + and brandId = #{query.brandId} + </if> + <if test="query.supplierId != null"> + and supplierId = #{query.supplierId} + </if> + AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + GROUP BY `name` + ORDER BY createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TOptometristMapper.xml b/optometrist/src/main/resources/mapping/TOptometristMapper.xml new file mode 100644 index 0000000..0104091 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TOptometristMapper.xml @@ -0,0 +1,65 @@ +<?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.jilongda.optometrist.mapper.TOptometristMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TOptometrist"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="phone" property="phone" /> + <result column="status" property="status" /> + <result column="storeId" property="storeId" /> + <result column="img" property="img" /> + <result column="registerTime" property="registerTime" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, `name`, phone, status, storeId, img, registerTime, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TOptometryVO"> + select t1.*,t2.name as wxName,t3.name as storeName + from t_optometry t1 + left join t_app_user t2 on t1.userId = t2.id + left join t_store t3 on t1.storeId = t3.id + <where> + <if test="query.nameOrPhone != null and query.nameOrPhone != ''"> + and (t2.`name` like concat('%',#{query.nameOrPhone},'%') + or + t2.phone like concat('%',#{query.nameOrPhone},'%') + ) + </if> + <if test="req.startTime != null and req.startTime!=''"> + and (t1.createTime between #{req.startTime} and #{req.endTime}) + </if> + AND t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY t1.createTime DESC + </select> + <select id="pageList1" resultType="com.jilongda.optometrist.vo.TOptometristVO"> + select <include refid="Base_Column_List"></include> + from t_optometrist + <where> + <if test="query.name != null and query.name != ''"> + and `name` like concat('%',#{query.name},'%') + </if> + <if test="query.phone != null and query.phone != ''"> + and phone like concat('%',#{query.phone},'%') + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + <if test="query.storeId != null"> + and storeId = #{query.storeId} + </if> + and isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TOptometryDetailMapper.xml b/optometrist/src/main/resources/mapping/TOptometryDetailMapper.xml new file mode 100644 index 0000000..a19a8b0 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TOptometryDetailMapper.xml @@ -0,0 +1,32 @@ +<?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.jilongda.optometrist.mapper.TOptometryDetailMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TOptometryDetail"> + <id column="id" property="id" /> + <result column="type" property="type" /> + <result column="optometryId" property="optometryId" /> + <result column="ballMirror" property="ballMirror" /> + <result column="columnMirror" property="columnMirror" /> + <result column="axis" property="axis" /> + <result column="add" property="add" /> + <result column="pupilHeight" property="pupilHeight" /> + <result column="pupilDistance" property="pupilDistance" /> + <result column="correct" property="correct" /> + <result column="storeId" property="storeId" /> + <result column="status" property="status" /> + <result column="registerTime" property="registerTime" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, type, optometryId, ballMirror, columnMirror, axis, add, pupilHeight, pupilDistance, correct, storeId, status, registerTime, createTime, updateTime, createBy, updateBy, isDelete + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TOptometryMapper.xml b/optometrist/src/main/resources/mapping/TOptometryMapper.xml new file mode 100644 index 0000000..2cf0948 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TOptometryMapper.xml @@ -0,0 +1,30 @@ +<?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.jilongda.optometrist.mapper.TOptometryMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TOptometry"> + <id column="id" property="id" /> + <result column="code" property="code" /> + <result column="userId" property="userId" /> + <result column="age" property="age" /> + <result column="gender" property="gender" /> + <result column="realName" property="realName" /> + <result column="phone" property="phone" /> + <result column="optometristId" property="optometristId" /> + <result column="storeId" property="storeId" /> + <result column="status" property="status" /> + <result column="registerTime" property="registerTime" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, code, userId, age, gender, realName, phone, optometristId, storeId, status, registerTime, createTime, updateTime, createBy, updateBy, isDelete + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TOrderAccountingMapper.xml b/optometrist/src/main/resources/mapping/TOrderAccountingMapper.xml new file mode 100644 index 0000000..74953f8 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TOrderAccountingMapper.xml @@ -0,0 +1,32 @@ +<?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.jilongda.optometrist.mapper.TOrderAccountingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TOrderAccounting"> + <id column="id" property="id" /> + <result column="code" property="code" /> + <result column="orderId" property="orderId" /> + <result column="rLens" property="rLens" /> + <result column="lLens" property="lLens" /> + <result column="frame" property="frame" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="commission" property="commission" /> + <result column="rLensProfit" property="rLensProfit" /> + <result column="lLensProfit" property="lLensProfit" /> + <result column="frameProfit" property="frameProfit" /> + <result column="payMoney" property="payMoney" /> + <result column="profitMoney" property="profitMoney" /> + <result column="profitRating" property="profitRating" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, code, orderId, rLens, lLens, frame, createTime, updateTime, createBy, updateBy, isDelete, commission, rLensProfit, lLensProfit, frameProfit, payMoney, profitMoney, profitRating + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TOrderAftersalesMapper.xml b/optometrist/src/main/resources/mapping/TOrderAftersalesMapper.xml new file mode 100644 index 0000000..a8aa49b --- /dev/null +++ b/optometrist/src/main/resources/mapping/TOrderAftersalesMapper.xml @@ -0,0 +1,50 @@ +<?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.jilongda.optometrist.mapper.TOrderAftersalesMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TOrderAftersales"> + <id column="id" property="id" /> + <result column="code" property="code" /> + <result column="sysId" property="sysId" /> + <result column="optometristId" property="optometristId" /> + <result column="orderId" property="orderId" /> + <result column="reason" property="reason" /> + <result column="handleResult" property="handleResult" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, code, sysId, optometristId, orderId, reason, handleResult, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TOrderAftersalesVO"> + select toa.id, toa.code, toa.sysId, toa.optometristId, toa.orderId, toa.reason, toa.handleResult, toa.createTime, toa.updateTime, + toa.createBy, toa.updateBy, toa.isDelete,tau.name, tau.phone, tau.realName, ts.storeName, o.orderMoney + from t_order_aftersales toa + left join t_app_user tau on toa.sysId = tau.id + left join t_store ts on toa.storeId = ts.id + left join t_order o on toa.orderId = o.id + <where> + <if test="query.name != null and query.name != ''"> + and tau.name like concat('%',#{query.name},'%') + </if> + <if test="query.phone != null and query.phone != ''"> + and tau.phone like concat('%',#{query.phone},'%') + </if> + <if test="query.storeId != null"> + and toa.storeId = #{query.phone} + </if> + <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> + and toa.createTime between #{query.startTime} and #{query.endTime} + </if> + and toa.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY toa.createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TOrderMapper.xml b/optometrist/src/main/resources/mapping/TOrderMapper.xml new file mode 100644 index 0000000..19ad046 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TOrderMapper.xml @@ -0,0 +1,47 @@ +<?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.jilongda.optometrist.mapper.TOrderMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TOrder"> + <id column="id" property="id" /> + <result column="code" property="code" /> + <result column="userId" property="userId" /> + <result column="optometryId" property="optometryId" /> + <result column="storeId" property="storeId" /> + <result column="modelId" property="modelId" /> + <result column="color" property="color" /> + <result column="series" property="series" /> + <result column="rLens" property="rLens" /> + <result column="lLens" property="lLens" /> + <result column="type" property="type" /> + <result column="refractiveIndex" property="refractiveIndex" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="sysId" property="sysId" /> + <result column="couponId" property="couponId" /> + <result column="itemsId" property="itemsId" /> + <result column="remark" property="remark" /> + <result column="isMail" property="isMail" /> + <result column="mailName" property="mailName" /> + <result column="mailPhone" property="mailPhone" /> + <result column="mailAddress" property="mailAddress" /> + <result column="orderMoney" property="orderMoney" /> + <result column="couponMoney" property="couponMoney" /> + <result column="payMoney" property="payMoney" /> + <result column="isMachining" property="isMachining" /> + <result column="machiningCode" property="machiningCode" /> + <result column="isAccounting" property="isAccounting" /> + <result column="accountingName" property="accountingName" /> + <result column="accountingTime" property="accountingTime" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, code, userId, optometryId, storeId, modelId, color, series, rLens, lLens, type, refractiveIndex, createTime, updateTime, createBy, updateBy, isDelete, sysId, couponId, itemsId, remark, isMail, mailName, mailPhone, mailAddress, orderMoney, couponMoney, payMoney, isMachining, machiningCode, isAccounting, accountingName, accountingTime + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TStoreMapper.xml b/optometrist/src/main/resources/mapping/TStoreMapper.xml new file mode 100644 index 0000000..a73b22d --- /dev/null +++ b/optometrist/src/main/resources/mapping/TStoreMapper.xml @@ -0,0 +1,45 @@ +<?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.jilongda.optometrist.mapper.TStoreMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TStore"> + <id column="id" property="id" /> + <result column="`name`" property="name" /> + <result column="province" property="province" /> + <result column="provinceCode" property="provinceCode" /> + <result column="city" property="city" /> + <result column="cityCode" property="cityCode" /> + <result column="area" property="area" /> + <result column="areaCode" property="areaCode" /> + <result column="address" property="address" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="lon" property="lon" /> + <result column="lat" property="lat" /> + <result column="img" property="img" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, `name`, province, provinceCode, city, cityCode, area, areaCode, address, createTime, updateTime, createBy, updateBy, isDelete, lon, lat, img,status + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TStoreVO"> + select <include refid="Base_Column_List"></include> + from t_store + <where> + <if test="query.name != null and query.name != ''"> + and `name` like concat('%',#{name},'%') + </if> + <if test="query.status != null"> + and `status` = #{query.status} + </if> + AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TSupplierMapper.xml b/optometrist/src/main/resources/mapping/TSupplierMapper.xml new file mode 100644 index 0000000..6bc7448 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TSupplierMapper.xml @@ -0,0 +1,33 @@ +<?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.jilongda.optometrist.mapper.TSupplierMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TSupplier"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="status" property="status" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, `name`, status, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TSupplierVO"> + select <include refid="Base_Column_List"></include> + from t_supplier + <where> + <if test="query.name != null and query.name != ''"> + and `name` like concat('%',#{query.name},'%') + </if> + AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY createTime DESC + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TTicketMapper.xml b/optometrist/src/main/resources/mapping/TTicketMapper.xml new file mode 100644 index 0000000..5f10a87 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TTicketMapper.xml @@ -0,0 +1,40 @@ +<?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.jilongda.optometrist.mapper.TTicketMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TTicket"> + <id column="id" property="id" /> + <result column="name" property="name" /> + <result column="type" property="type" /> + <result column="storeId" property="storeId" /> + <result column="cloudId" property="cloudId" /> + <result column="secret" property="secret" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="status" property="status" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, `name`, `type`, storeId, cloudId, secret, createTime, updateTime, createBy, updateBy, isDelete,status + </sql> + <select id="pageList" resultType="com.jilongda.optometrist.vo.TTicketVO"> + select <include refid="Base_Column_List"></include> + from t_ticket + <where> + <if test="query.storeId != null"> + and storeId = #{query.storeId} + </if> + <if test="query.type != null"> + and `type` = #{query.type} + </if> + and isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + order by createTime desc + </select> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TUserMapper.xml b/optometrist/src/main/resources/mapping/TUserMapper.xml new file mode 100644 index 0000000..47541ee --- /dev/null +++ b/optometrist/src/main/resources/mapping/TUserMapper.xml @@ -0,0 +1,53 @@ +<?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.jilongda.optometrist.mapper.TUserMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.common.model.TUser"> + <id column="id" property="id" /> + <result column="nickName" property="nickName" /> + <result column="userName" property="userName" /> + <result column="userPhone" property="userPhone" /> + <result column="password" property="password" /> + <result column="vipType" property="vipType" /> + <result column="insertTime" property="insertTime" /> + <result column="graduationInstitution" property="graduationInstitution" /> + <result column="selfIntroduction" property="selfIntroduction" /> + <result column="firstVipTime" property="firstVipTime" /> + <result column="startTime" property="startTime" /> + <result column="endTime" property="endTime" /> + <result column="consumptionAmount" property="consumptionAmount" /> + <result column="vipLevel" property="vipLevel" /> + <result column="sex" property="sex" /> + <result column="birthday" property="birthday" /> + <result column="weight" property="weight" /> + <result column="height" property="height" /> + <result column="provinceName" property="provinceName" /> + <result column="provinceCode" property="provinceCode" /> + <result column="cityName" property="cityName" /> + <result column="cityCode" property="cityCode" /> + <result column="performerCover" property="performerCover" /> + <result column="detailPicture" property="detailPicture" /> + <result column="openId" property="openId" /> + <result column="status" property="status" /> + <result column="auditStatus" property="auditStatus" /> + <result column="auditRemark" property="auditRemark" /> + <result column="lastLoginTime" property="lastLoginTime" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + <result column="hot" property="hot" /> + <result column="performerStatus" property="performerStatus" /> + <result column="vedio" property="vedio" /> + <result column="hasPay" property="hasPay" /> + <result column="advatar" property="advatar" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, nickName, userName, userPhone, password, vipType, insertTime, graduationInstitution, selfIntroduction, firstVipTime, startTime, endTime, consumptionAmount, vipLevel, sex, birthday, weight, height, provinceName, provinceCode, cityName, cityCode, performerCover, detailPicture, openId, status, auditStatus, auditRemark, lastLoginTime, createTime, updateTime, createBy, updateBy, isDelete, hot, performerStatus, vedio, hasPay, advatar + </sql> + +</mapper> diff --git a/optometrist/src/main/resources/mapping/TWarehousingMapper.xml b/optometrist/src/main/resources/mapping/TWarehousingMapper.xml new file mode 100644 index 0000000..cc88940 --- /dev/null +++ b/optometrist/src/main/resources/mapping/TWarehousingMapper.xml @@ -0,0 +1,60 @@ +<?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.jilongda.optometrist.mapper.TWarehousingMapper"> + + <!-- 通用查询映射结果 --> + <resultMap id="BaseResultMap" type="com.jilongda.optometrist.model.TWarehousing"> + <id column="id" property="id" /> + <result column="status" property="status" /> + <result column="type" property="type" /> + <result column="storeId" property="storeId" /> + <result column="remark" property="remark" /> + <result column="createTime" property="createTime" /> + <result column="updateTime" property="updateTime" /> + <result column="createBy" property="createBy" /> + <result column="updateBy" property="updateBy" /> + <result column="isDelete" property="isDelete" /> + </resultMap> + + <!-- 通用查询结果列 --> + <sql id="Base_Column_List"> + id, status, `type`, storeId, remark, createTime, updateTime, createBy, updateBy, isDelete + </sql> + <select id="inventoryReceiptList" resultType="com.jilongda.optometrist.vo.TWarehousingVO"> + select <include refid="Base_Column_List"></include> + from t_warehousing + <where> + <if test="query.storeId != null"> + and storeId = #{query.storeId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> + and createTime between #{query.startTime} and #{query.endTime} + </if> + and isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + and `type` = 1 + </where> + ORDER BY createTime DESC + </select> + <select id="inventoryReceiptLensList" resultType="com.jilongda.optometrist.vo.TWarehousingLensVO"> + select <include refid="Base_Column_List"></include> + from t_warehousing + <where> + <if test="query.storeId != null"> + and storeId = #{query.storeId} + </if> + <if test="query.status != null"> + and status = #{query.status} + </if> + <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> + and createTime between #{query.startTime} and #{query.endTime} + </if> + and `type` = 2 + and isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + </where> + ORDER BY createTime DESC + </select> + +</mapper> -- Gitblit v1.7.1