From 25835dde83a66dcf135226134fe9f70a2c3bb289 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期二, 10 十二月 2024 18:07:51 +0800 Subject: [PATCH] 镜架管理 --- manage/src/main/java/com/jilongda/manage/query/TSupplierQuery.java | 15 manage/src/main/java/com/jilongda/manage/model/TInventory.java | 22 manage/src/main/java/com/jilongda/manage/model/TOrder.java | 22 manage/src/main/java/com/jilongda/manage/controller/TMaterialController.java | 96 +++ manage/src/main/java/com/jilongda/manage/model/TSupplier.java | 25 manage/src/main/resources/mapping/TMaterialMapper.xml | 8 manage/src/main/java/com/jilongda/manage/model/TLineUp.java | 23 manage/src/main/java/com/jilongda/manage/controller/TSupplierController.java | 95 +++ manage/src/main/java/com/jilongda/manage/model/TWarehousing.java | 23 manage/src/main/java/com/jilongda/manage/mapper/TMaterialMapper.java | 13 manage/src/main/java/com/jilongda/manage/model/TCouponReceive.java | 23 manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java | 44 + manage/src/main/resources/mapping/SecUserMapper.xml | 3 manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java | 22 manage/src/main/java/com/jilongda/manage/query/TBrandQuery.java | 10 manage/src/main/java/com/jilongda/manage/controller/TModelController.java | 141 +++++ manage/src/main/resources/mapping/TSupplierMapper.xml | 13 manage/src/main/java/com/jilongda/manage/service/TModelService.java | 26 manage/src/main/java/com/jilongda/manage/service/impl/TMaterialServiceImpl.java | 33 + manage/src/main/java/com/jilongda/manage/query/TMaterialQuery.java | 13 manage/src/main/java/com/jilongda/manage/service/impl/TBrandServiceImpl.java | 13 manage/src/main/java/com/jilongda/manage/service/TBrandService.java | 9 manage/src/main/java/com/jilongda/manage/dto/TModelDTO.java | 20 manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java | 22 manage/src/main/java/com/jilongda/manage/model/TModel.java | 27 manage/src/main/java/com/jilongda/manage/model/SecFeeItems.java | 22 manage/src/main/java/com/jilongda/manage/service/impl/TModelServiceImpl.java | 63 ++ manage/src/main/java/com/jilongda/manage/vo/TSupplierVO.java | 12 manage/src/main/java/com/jilongda/manage/controller/TBrandController.java | 64 ++ common/pom.xml | 2 manage/src/main/java/com/jilongda/manage/mapper/TModelMapper.java | 13 manage/src/main/java/com/jilongda/manage/vo/TModelVO.java | 20 manage/src/main/java/com/jilongda/manage/model/TFrameWarehousingDetail.java | 22 manage/src/main/java/com/jilongda/manage/model/TOptometry.java | 23 manage/src/main/java/com/jilongda/manage/model/TLensWarehousingDetail.java | 22 optometry/pom.xml | 6 manage/src/main/java/com/jilongda/manage/mapper/TSupplierMapper.java | 15 manage/src/main/java/com/jilongda/manage/service/TSupplierService.java | 25 manage/src/main/java/com/jilongda/manage/vo/TBrandVO.java | 11 manage/src/main/java/com/jilongda/manage/model/SecSetting.java | 22 manage/src/main/java/com/jilongda/manage/model/TMaterial.java | 23 pom.xml | 41 - manage/src/main/java/com/jilongda/manage/model/TCoupon.java | 22 manage/src/main/java/com/jilongda/manage/query/TModelQuery.java | 21 manage/src/main/java/com/jilongda/manage/model/TOptometrist.java | 23 manage/src/main/java/com/jilongda/manage/model/TInventoryLensDetail.java | 23 manage/src/main/java/com/jilongda/manage/model/TAppUser.java | 22 manage/src/main/java/com/jilongda/manage/authority/model/SecUser.java | 5 manage/src/main/java/com/jilongda/manage/mapper/TBrandMapper.java | 15 manage/src/main/java/com/jilongda/manage/service/impl/TSupplierServiceImpl.java | 38 + manage/src/main/resources/mapping/TModelMapper.xml | 21 applet/pom.xml | 2 generator/pom.xml | 2 manage/pom.xml | 2 manage/src/main/java/com/jilongda/manage/controller/TOrderController.java | 2 manage/src/main/java/com/jilongda/manage/model/TOrderAftersales.java | 23 manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java | 23 manage/src/main/java/com/jilongda/manage/vo/TMaterialVO.java | 10 /dev/null | 36 - manage/src/main/java/com/jilongda/manage/service/TMaterialService.java | 28 + manage/src/main/resources/mapping/TBrandMapper.xml | 8 manage/src/main/java/com/jilongda/manage/model/TLensSeries.java | 22 manage/src/main/java/com/jilongda/manage/model/TTicket.java | 22 manage/src/main/java/com/jilongda/manage/model/TBrand.java | 27 64 files changed, 998 insertions(+), 566 deletions(-) diff --git a/applet/pom.xml b/applet/pom.xml index 162b8aa..912ef1c 100644 --- a/applet/pom.xml +++ b/applet/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> - <artifactId>sales</artifactId> + <artifactId>eyes</artifactId> <groupId>com</groupId> <version>0.0.1-SNAPSHOT</version> </parent> diff --git a/common/pom.xml b/common/pom.xml index f72331c..f276c02 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -3,7 +3,7 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> - <artifactId>sales</artifactId> + <artifactId>eyes</artifactId> <groupId>com</groupId> <version>0.0.1-SNAPSHOT</version> </parent> diff --git a/generator/pom.xml b/generator/pom.xml index 2600074..a5e81d9 100644 --- a/generator/pom.xml +++ b/generator/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> - <artifactId>sales</artifactId> + <artifactId>eyes</artifactId> <groupId>com</groupId> <version>0.0.1-SNAPSHOT</version> </parent> diff --git a/manage/pom.xml b/manage/pom.xml index cd8a58a..1989622 100644 --- a/manage/pom.xml +++ b/manage/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> - <artifactId>sales</artifactId> + <artifactId>eyes</artifactId> <groupId>com</groupId> <version>0.0.1-SNAPSHOT</version> </parent> diff --git a/manage/src/main/java/com/jilongda/manage/authority/model/SecUser.java b/manage/src/main/java/com/jilongda/manage/authority/model/SecUser.java index cfe59d1..3d0c685 100644 --- a/manage/src/main/java/com/jilongda/manage/authority/model/SecUser.java +++ b/manage/src/main/java/com/jilongda/manage/authority/model/SecUser.java @@ -103,9 +103,12 @@ @TableField("deptId") private Long deptId; - @ApiModelProperty(value = "用户类型 1=平台管理员,2=验光师") + @ApiModelProperty(value = "类型1平台管理员2验光师3员工") @TableField("userType") private Integer userType; + @ApiModelProperty(value = "门店id") + @TableField("storeId") + private Integer storeId; @ApiModelProperty(value = "省code") @TableField("provinceCode") private String provinceCode; diff --git a/manage/src/main/java/com/jilongda/manage/controller/TBrandController.java b/manage/src/main/java/com/jilongda/manage/controller/TBrandController.java index e1c18d2..e4a7b3c 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TBrandController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TBrandController.java @@ -1,9 +1,21 @@ package com.jilongda.manage.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.jilongda.common.basic.ApiResult; +import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.model.TBrand; +import com.jilongda.manage.query.TBrandQuery; +import com.jilongda.manage.service.TBrandService; +import com.jilongda.manage.utils.LoginInfoUtil; +import com.jilongda.manage.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 org.springframework.web.bind.annotation.RestController; +import java.util.List; +import java.util.Objects; /** * <p> @@ -13,9 +25,57 @@ * @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/manage/src/main/java/com/jilongda/manage/controller/TMaterialController.java b/manage/src/main/java/com/jilongda/manage/controller/TMaterialController.java index 280236c..1c1923b 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TMaterialController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TMaterialController.java @@ -1,21 +1,111 @@ package com.jilongda.manage.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.jilongda.common.basic.ApiResult; +import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.model.TMaterial; +import com.jilongda.manage.query.TMaterialQuery; +import com.jilongda.manage.service.TMaterialService; +import com.jilongda.manage.vo.TMaterialVO; +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 org.springframework.web.bind.annotation.RestController; +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/manage/src/main/java/com/jilongda/manage/controller/TModelController.java b/manage/src/main/java/com/jilongda/manage/controller/TModelController.java index c0eab4b..c9a945e 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TModelController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TModelController.java @@ -1,9 +1,24 @@ package com.jilongda.manage.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.jilongda.common.basic.ApiResult; +import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.dto.TModelDTO; +import com.jilongda.manage.model.TModel; +import com.jilongda.manage.query.TModelQuery; +import com.jilongda.manage.service.TModelService; +import com.jilongda.manage.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 org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; /** * <p> @@ -13,9 +28,131 @@ * @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.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/manage/src/main/java/com/jilongda/manage/controller/TOrderController.java b/manage/src/main/java/com/jilongda/manage/controller/TOrderController.java index ebffdbd..56d4fe5 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TOrderController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TOrderController.java @@ -1,6 +1,7 @@ package com.jilongda.manage.controller; +import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -13,6 +14,7 @@ * @author 无关风月 * @since 2024-12-09 */ +@Api(tags = "") @RestController @RequestMapping("/t-order") public class TOrderController { diff --git a/manage/src/main/java/com/jilongda/manage/controller/TSupplierController.java b/manage/src/main/java/com/jilongda/manage/controller/TSupplierController.java index 857e6a1..110dce0 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TSupplierController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TSupplierController.java @@ -1,9 +1,21 @@ package com.jilongda.manage.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.jilongda.common.basic.ApiResult; +import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.model.TSupplier; +import com.jilongda.manage.query.TSupplierQuery; +import com.jilongda.manage.service.TSupplierService; +import com.jilongda.manage.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 org.springframework.web.bind.annotation.RestController; +import java.util.List; /** * <p> @@ -13,9 +25,88 @@ * @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/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java index dfd4ff4..9c8b853 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java @@ -1,8 +1,16 @@ package com.jilongda.manage.controller; +import com.jilongda.common.basic.ApiResult; +import com.jilongda.manage.model.TWarehousing; +import com.jilongda.manage.service.TWarehousingService; +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.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; - import org.springframework.web.bind.annotation.RestController; /** @@ -13,9 +21,43 @@ * @author 无关风月 * @since 2024-12-09 */ +@Api(tags = "镜架/镜片出库入库") @RestController @RequestMapping("/t-warehousing") public class TWarehousingController { + @Autowired + private TWarehousingService warehousingService; + + /** + * 获取镜架/镜片出库入库列表 + */ +// @ApiOperation(value = "获取镜架/镜片出库入库分页列表") +// @PostMapping(value = "/pageList") +// public ApiResult<PageInfo<TWarehousingVO>> pageList(@RequestBody TWarehousingQuery query) { +// return ApiResult.success(warehousingService.pageList(query)); +// } + +// /** +// * 获取镜架/镜片出库入库列表 +// */ +// @ApiOperation(value = "获取镜架/镜片出库入库列表") +// @PostMapping(value = "/list") +// public ApiResult<List<TWarehousing>> list(@RequestBody TWarehousingQuery query) { +// List<TWarehousing> list = warehousingService.list(Wrappers.lambdaQuery(TWarehousing.class) +// .eq(TWarehousing::getStatus, 1)); +// return ApiResult.success(list); +// } + + /** + * 添加镜架/镜片出库入库 + */ + @ApiOperation(value = "添加镜架/镜片出库入库") + @PostMapping(value = "/add") + public ApiResult<String> add(@Validated @RequestBody TWarehousing dto) { + warehousingService.save(dto); + return ApiResult.success(); + } + } diff --git a/manage/src/main/java/com/jilongda/manage/dto/TModelDTO.java b/manage/src/main/java/com/jilongda/manage/dto/TModelDTO.java new file mode 100644 index 0000000..38fa4a8 --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/dto/TModelDTO.java @@ -0,0 +1,20 @@ +package com.jilongda.manage.dto; + +import com.jilongda.manage.model.TModel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@Data +@ApiModel(value = "镜架型号DTO") +public class TModelDTO extends TModel { + + @NotNull(message = "镜架型号不能为空") + @ApiModelProperty(value = "色号集合") + private List<String> colorList; + +} diff --git a/manage/src/main/java/com/jilongda/manage/mapper/TBrandMapper.java b/manage/src/main/java/com/jilongda/manage/mapper/TBrandMapper.java index ad93378..0680fee 100644 --- a/manage/src/main/java/com/jilongda/manage/mapper/TBrandMapper.java +++ b/manage/src/main/java/com/jilongda/manage/mapper/TBrandMapper.java @@ -1,7 +1,14 @@ package com.jilongda.manage.mapper; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TBrand; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jilongda.manage.query.TBrandQuery; +import com.jilongda.manage.vo.TBrandVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * <p> @@ -11,6 +18,14 @@ * @author 无关风月 * @since 2024-12-09 */ +@Mapper public interface TBrandMapper extends BaseMapper<TBrand> { + /** + * 分页查询 + * @param query + * @param pageInfo + * @return + */ + List<TBrandVO> pageList(@Param("query") TBrandQuery query, @Param("pageInfo")PageInfo<TBrandVO> pageInfo); } diff --git a/manage/src/main/java/com/jilongda/manage/mapper/TMaterialMapper.java b/manage/src/main/java/com/jilongda/manage/mapper/TMaterialMapper.java index 5aba40f..195b756 100644 --- a/manage/src/main/java/com/jilongda/manage/mapper/TMaterialMapper.java +++ b/manage/src/main/java/com/jilongda/manage/mapper/TMaterialMapper.java @@ -1,7 +1,13 @@ package com.jilongda.manage.mapper; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TMaterial; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jilongda.manage.query.TMaterialQuery; +import com.jilongda.manage.vo.TMaterialVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * <p> @@ -13,4 +19,11 @@ */ public interface TMaterialMapper extends BaseMapper<TMaterial> { + /** + * 分页查询 + * @param query + * @param pageInfo + * @return + */ + List<TMaterialVO> pageList(@Param("query") TMaterialQuery query, @Param("pageInfo")PageInfo<TMaterialVO> pageInfo); } diff --git a/manage/src/main/java/com/jilongda/manage/mapper/TModelMapper.java b/manage/src/main/java/com/jilongda/manage/mapper/TModelMapper.java index edd4454..0c460b6 100644 --- a/manage/src/main/java/com/jilongda/manage/mapper/TModelMapper.java +++ b/manage/src/main/java/com/jilongda/manage/mapper/TModelMapper.java @@ -1,7 +1,13 @@ package com.jilongda.manage.mapper; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TModel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jilongda.manage.query.TModelQuery; +import com.jilongda.manage.vo.TModelVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * <p> @@ -13,4 +19,11 @@ */ public interface TModelMapper extends BaseMapper<TModel> { + /** + * 分页查询镜架型号 + * @param query + * @param pageInfo + * @return + */ + List<TModelVO> pageList(@Param("query") TModelQuery query, @Param("pageInfo")PageInfo<TModelVO> pageInfo); } diff --git a/manage/src/main/java/com/jilongda/manage/mapper/TSupplierMapper.java b/manage/src/main/java/com/jilongda/manage/mapper/TSupplierMapper.java index 8c45eb9..8d1bff0 100644 --- a/manage/src/main/java/com/jilongda/manage/mapper/TSupplierMapper.java +++ b/manage/src/main/java/com/jilongda/manage/mapper/TSupplierMapper.java @@ -1,7 +1,14 @@ package com.jilongda.manage.mapper; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TSupplier; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jilongda.manage.query.TSupplierQuery; +import com.jilongda.manage.vo.TSupplierVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * <p> @@ -11,6 +18,14 @@ * @author 无关风月 * @since 2024-12-09 */ +@Mapper public interface TSupplierMapper extends BaseMapper<TSupplier> { + /** + * 分页查询 + * @param query + * @param pageInfo + * @return + */ + List<TSupplierVO> pageList(@Param("query") TSupplierQuery query, @Param("pageInfo")PageInfo<TSupplierVO> pageInfo); } diff --git a/manage/src/main/java/com/jilongda/manage/model/SecFeeItems.java b/manage/src/main/java/com/jilongda/manage/model/SecFeeItems.java index 261b37c..215ed04 100644 --- a/manage/src/main/java/com/jilongda/manage/model/SecFeeItems.java +++ b/manage/src/main/java/com/jilongda/manage/model/SecFeeItems.java @@ -7,6 +7,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("sec_fee_items") @ApiModel(value="SecFeeItems对象", description="系统设置-收费项设置 ") -public class SecFeeItems implements Serializable { +public class SecFeeItems extends BaseModel { private static final long serialVersionUID = 1L; @@ -43,24 +45,6 @@ @ApiModelProperty(value = "状态 1启用 2禁用") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/SecResources.java b/manage/src/main/java/com/jilongda/manage/model/SecResources.java deleted file mode 100644 index f611681..0000000 --- a/manage/src/main/java/com/jilongda/manage/model/SecResources.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.jilongda.manage.model; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * <p> - * 资源表 - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@TableName("sec_resources") -@ApiModel(value="SecResources对象", description="资源表") -public class SecResources implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "主键") - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - @ApiModelProperty(value = "父级id") - @TableField("parent_id") - private String parentId; - - @ApiModelProperty(value = "资源名") - @TableField("title") - private String title; - - @ApiModelProperty(value = "资源描述") - @TableField("descriptions") - private String descriptions; - - @ApiModelProperty(value = "排序,数字越大越靠后,最小值为0,最大值为100000") - @TableField("sort") - private Integer sort; - - @ApiModelProperty(value = "菜单或按钮图标") - @TableField("icon") - private String icon; - - @ApiModelProperty(value = "前端页面名称") - @TableField("name") - private String name; - - @ApiModelProperty(value = "menu") - @TableField("menu") - private String menu; - - @ApiModelProperty(value = "前端文件路径") - @TableField("component") - private String component; - - @ApiModelProperty(value = "针对请求地址是否允许通过,默认不通过,设为通过则不会校验其权限") - @TableField("permit") - private Boolean permit; - - @ApiModelProperty(value = "权限类型,页面-1,按钮-2 默认页面") - @TableField("cate") - private Integer cate; - - @ApiModelProperty(value = "权限类型") - @TableField("type") - private Integer type; - - @ApiModelProperty(value = "页面是否隐藏,1是 0否(默认)") - @TableField("hidden") - private Boolean hidden; - - @ApiModelProperty(value = "1前台 2后台") - @TableField("env_port") - private Integer envPort; - - @ApiModelProperty(value = "前端页面路径") - @TableField("path") - private String path; - - @ApiModelProperty(value = "相关接口,多个逗号隔开") - @TableField("api_url") - private String apiUrl; - - @ApiModelProperty(value = "创建人") - @TableField("createBy") - private String createBy; - - @ApiModelProperty(value = "创建时间(注册时间)") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改人") - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @ApiModelProperty(value = "是否删除/禁用 1删除 0否(默认)") - @TableField("isDelete") - private Boolean isDelete; - - -} diff --git a/manage/src/main/java/com/jilongda/manage/model/SecRole.java b/manage/src/main/java/com/jilongda/manage/model/SecRole.java deleted file mode 100644 index b439989..0000000 --- a/manage/src/main/java/com/jilongda/manage/model/SecRole.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.jilongda.manage.model; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * <p> - * - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@TableName("sec_role") -@ApiModel(value="SecRole对象", description="") -public class SecRole implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - @ApiModelProperty(value = "用户组名称") - @TableField("rolename") - private String rolename; - - @ApiModelProperty(value = "角色描述") - @TableField("role_desc") - private String roleDesc; - - @ApiModelProperty(value = "是否启用 1启用 0禁用") - @TableField("role_state") - private Boolean roleState; - - @ApiModelProperty(value = "创建人") - @TableField("createBy") - private String createBy; - - @ApiModelProperty(value = "创建时间(注册时间)") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改人") - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @ApiModelProperty(value = "是否删除/禁用 1删除 0否(默认)") - @TableField("isDelete") - private Boolean isDelete; - - @ApiModelProperty(value = "排序 倒序") - @TableField("sortBy") - private Integer sortBy; - - -} diff --git a/manage/src/main/java/com/jilongda/manage/model/SecRoleResource.java b/manage/src/main/java/com/jilongda/manage/model/SecRoleResource.java deleted file mode 100644 index 19dcc8d..0000000 --- a/manage/src/main/java/com/jilongda/manage/model/SecRoleResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.jilongda.manage.model; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * <p> - * - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@TableName("sec_role_resource") -@ApiModel(value="SecRoleResource对象", description="") -public class SecRoleResource implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableField("role_id") - private Long roleId; - - @TableField("resource_id") - private Long resourceId; - - -} diff --git a/manage/src/main/java/com/jilongda/manage/model/SecSetting.java b/manage/src/main/java/com/jilongda/manage/model/SecSetting.java index df441ac..33e71ba 100644 --- a/manage/src/main/java/com/jilongda/manage/model/SecSetting.java +++ b/manage/src/main/java/com/jilongda/manage/model/SecSetting.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("sec_setting") @ApiModel(value="SecSetting对象", description="系统设置 ") -public class SecSetting implements Serializable { +public class SecSetting extends BaseModel { private static final long serialVersionUID = 1L; @@ -38,24 +40,6 @@ @ApiModelProperty(value = "镜架警告阈值") @TableField("frameThreshold") private Integer frameThreshold; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/SecUser.java b/manage/src/main/java/com/jilongda/manage/model/SecUser.java deleted file mode 100644 index c2e720f..0000000 --- a/manage/src/main/java/com/jilongda/manage/model/SecUser.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.jilongda.manage.model; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * <p> - * - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@TableName("sec_user") -@ApiModel(value="SecUser对象", description="") -public class SecUser implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - @ApiModelProperty(value = "账户") - @TableField("account") - private String account; - - @ApiModelProperty(value = "用户描述") - @TableField("description") - private String description; - - @ApiModelProperty(value = "密码") - @TableField("password") - private String password; - - @ApiModelProperty(value = "手机号码") - @TableField("phone") - private String phone; - - @ApiModelProperty(value = "账户状态 是否禁用") - @TableField("state") - private Boolean state; - - @ApiModelProperty(value = "最近一次登陆时间") - @TableField("last_login_time") - private LocalDateTime lastLoginTime; - - @ApiModelProperty(value = "创建人") - @TableField("createBy") - private String createBy; - - @ApiModelProperty(value = "创建时间(注册时间)") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改人") - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @ApiModelProperty(value = "是否删除/禁用 1删除 0否(默认)") - @TableField("isDelete") - private Boolean isDelete; - - @ApiModelProperty(value = "用户昵称") - @TableField("nick_name") - private String nickName; - - @ApiModelProperty(value = "头像地址") - @TableField("avatar_url") - private String avatarUrl; - - @ApiModelProperty(value = "省") - @TableField("province") - private String province; - - @ApiModelProperty(value = "市") - @TableField("city") - private String city; - - @ApiModelProperty(value = "区") - @TableField("area") - private String area; - - @ApiModelProperty(value = "详细地址") - @TableField("address") - private String address; - - @ApiModelProperty(value = "生日") - @TableField("birthday") - private LocalDateTime birthday; - - @ApiModelProperty(value = "1男2女0未知") - @TableField("gender") - private Integer gender; - - @ApiModelProperty(value = "部门id") - @TableField("deptId") - private Long deptId; - - @ApiModelProperty(value = "类型1平台管理员2验光师") - @TableField("userType") - private Integer userType; - - @ApiModelProperty(value = "省code") - @TableField("provinceCode") - private String provinceCode; - - @ApiModelProperty(value = "市code") - @TableField("cityCode") - private String cityCode; - - @ApiModelProperty(value = "区code") - @TableField("areaCode") - private String areaCode; - - -} diff --git a/manage/src/main/java/com/jilongda/manage/model/SecUserRole.java b/manage/src/main/java/com/jilongda/manage/model/SecUserRole.java deleted file mode 100644 index fed84d2..0000000 --- a/manage/src/main/java/com/jilongda/manage/model/SecUserRole.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.jilongda.manage.model; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * <p> - * - * </p> - * - * @author 无关风月 - * @since 2024-12-09 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@TableName("sec_user_role") -@ApiModel(value="SecUserRole对象", description="") -public class SecUserRole implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "角色id") - @TableField("role_id") - private Long roleId; - - @ApiModelProperty(value = "用户id") - @TableField("user_id") - private Long userId; - - -} diff --git a/manage/src/main/java/com/jilongda/manage/model/TAppUser.java b/manage/src/main/java/com/jilongda/manage/model/TAppUser.java index feda451..01b5596 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TAppUser.java +++ b/manage/src/main/java/com/jilongda/manage/model/TAppUser.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_app_user") @ApiModel(value="TAppUser对象", description="用户表") -public class TAppUser implements Serializable { +public class TAppUser extends BaseModel { private static final long serialVersionUID = 1L; @@ -57,24 +59,6 @@ @ApiModelProperty(value = "注册时间") @TableField("registerTime") private LocalDateTime registerTime; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/TBrand.java b/manage/src/main/java/com/jilongda/manage/model/TBrand.java index 11f27f1..5cc16fa 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TBrand.java +++ b/manage/src/main/java/com/jilongda/manage/model/TBrand.java @@ -6,10 +6,15 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotNull; /** * <p> @@ -23,7 +28,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_brand") @ApiModel(value="TBrand对象", description="镜架/镜片品牌表") -public class TBrand implements Serializable { +public class TBrand extends BaseModel { private static final long serialVersionUID = 1L; @@ -32,34 +37,18 @@ private Integer id; @ApiModelProperty(value = "品牌名称") + @Length(max = 15,message = "品牌名称不能超过15个字符") @TableField("name") private String name; @ApiModelProperty(value = "类型 1镜架 2镜片") + @NotNull(message = "品牌类型不能为空") @TableField("type") private Integer type; @ApiModelProperty(value = "状态 1启用 2禁用") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; @ApiModelProperty(value = "是否为主要品牌 1是2否") @TableField("isMain") diff --git a/manage/src/main/java/com/jilongda/manage/model/TCoupon.java b/manage/src/main/java/com/jilongda/manage/model/TCoupon.java index 7b464e9..d3296f8 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TCoupon.java +++ b/manage/src/main/java/com/jilongda/manage/model/TCoupon.java @@ -7,6 +7,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_coupon") @ApiModel(value="TCoupon对象", description="优惠券领取记录") -public class TCoupon implements Serializable { +public class TCoupon extends BaseModel { private static final long serialVersionUID = 1L; @@ -55,24 +57,6 @@ @ApiModelProperty(value = "优惠条件金额 为0则表示通用券") @TableField("amountCondition") private BigDecimal amountCondition; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; @ApiModelProperty(value = "发放状态1发放中 2暂停发放 只有发放方式为1和4的时候存储") @TableField("grantStatus") diff --git a/manage/src/main/java/com/jilongda/manage/model/TCouponReceive.java b/manage/src/main/java/com/jilongda/manage/model/TCouponReceive.java index 4bc9566..8cbcd7f 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TCouponReceive.java +++ b/manage/src/main/java/com/jilongda/manage/model/TCouponReceive.java @@ -7,6 +7,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_coupon_receive") @ApiModel(value="TCouponReceive对象", description="优惠券") -public class TCouponReceive implements Serializable { +public class TCouponReceive extends BaseModel { private static final long serialVersionUID = 1L; @@ -63,24 +65,5 @@ @ApiModelProperty(value = "1待使用 2已使用 3已过期") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TFrameWarehousingDetail.java b/manage/src/main/java/com/jilongda/manage/model/TFrameWarehousingDetail.java index 310b27f..96401cf 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TFrameWarehousingDetail.java +++ b/manage/src/main/java/com/jilongda/manage/model/TFrameWarehousingDetail.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_frame_warehousing_detail") @ApiModel(value="TFrameWarehousingDetail对象", description="镜架出库入库详细表") -public class TFrameWarehousingDetail implements Serializable { +public class TFrameWarehousingDetail extends BaseModel { private static final long serialVersionUID = 1L; @@ -66,24 +68,6 @@ @ApiModelProperty(value = "入库编号") @TableField("code") private String code; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; @ApiModelProperty(value = "型号id") @TableField("modelId") diff --git a/manage/src/main/java/com/jilongda/manage/model/TInventory.java b/manage/src/main/java/com/jilongda/manage/model/TInventory.java index 2e1e0f2..214eeae 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TInventory.java +++ b/manage/src/main/java/com/jilongda/manage/model/TInventory.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_inventory") @ApiModel(value="TInventory对象", description="盘点表") -public class TInventory implements Serializable { +public class TInventory extends BaseModel { private static final long serialVersionUID = 1L; @@ -46,24 +48,6 @@ @ApiModelProperty(value = "备注") @TableField("remark") private String remark; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java b/manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java index ece8955..2235f9d 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java +++ b/manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_inventory_frame_detail") @ApiModel(value="TInventoryFrameDetail对象", description="材质表") -public class TInventoryFrameDetail implements Serializable { +public class TInventoryFrameDetail extends BaseModel { private static final long serialVersionUID = 1L; @@ -70,24 +72,6 @@ @ApiModelProperty(value = "差值") @TableField("diff") private Integer diff; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/TInventoryLensDetail.java b/manage/src/main/java/com/jilongda/manage/model/TInventoryLensDetail.java index 24cf576..2b60b81 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TInventoryLensDetail.java +++ b/manage/src/main/java/com/jilongda/manage/model/TInventoryLensDetail.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_inventory_lens_detail") @ApiModel(value="TInventoryLensDetail对象", description="镜架盘点详细表") -public class TInventoryLensDetail implements Serializable { +public class TInventoryLensDetail extends BaseModel { private static final long serialVersionUID = 1L; @@ -70,24 +72,5 @@ @ApiModelProperty(value = "盘点类型 1球/柱镜2折射率3系列") @TableField("category") private Integer category; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TLensSeries.java b/manage/src/main/java/com/jilongda/manage/model/TLensSeries.java index d57f73e..7e6731c 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TLensSeries.java +++ b/manage/src/main/java/com/jilongda/manage/model/TLensSeries.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_lens_series") @ApiModel(value="TLensSeries对象", description="镜片系列表") -public class TLensSeries implements Serializable { +public class TLensSeries extends BaseModel { private static final long serialVersionUID = 1L; @@ -58,24 +60,6 @@ @ApiModelProperty(value = "双非") @TableField("doubleNon") private String doubleNon; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/TLensWarehousingDetail.java b/manage/src/main/java/com/jilongda/manage/model/TLensWarehousingDetail.java index d13f74f..bdedb63 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TLensWarehousingDetail.java +++ b/manage/src/main/java/com/jilongda/manage/model/TLensWarehousingDetail.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_lens_warehousing_detail") @ApiModel(value="TLensWarehousingDetail对象", description="镜片出库入库明细表") -public class TLensWarehousingDetail implements Serializable { +public class TLensWarehousingDetail extends BaseModel { private static final long serialVersionUID = 1L; @@ -62,24 +64,6 @@ @ApiModelProperty(value = "入库/出库数量") @TableField("total") private Integer total; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; @ApiModelProperty(value = "在库数量(出库没有该字段)") @TableField("count") diff --git a/manage/src/main/java/com/jilongda/manage/model/TLineUp.java b/manage/src/main/java/com/jilongda/manage/model/TLineUp.java index 9e8028d..8e02f7c 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TLineUp.java +++ b/manage/src/main/java/com/jilongda/manage/model/TLineUp.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_line_up") @ApiModel(value="TLineUp对象", description="排号管理") -public class TLineUp implements Serializable { +public class TLineUp extends BaseModel { private static final long serialVersionUID = 1L; @@ -50,24 +52,5 @@ @ApiModelProperty(value = "状态1排队中2验光中3已完成4已过号5已取消") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TMaterial.java b/manage/src/main/java/com/jilongda/manage/model/TMaterial.java index cf502aa..65a81cc 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TMaterial.java +++ b/manage/src/main/java/com/jilongda/manage/model/TMaterial.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_material") @ApiModel(value="TMaterial对象", description="镜架/镜片品牌表") -public class TMaterial implements Serializable { +public class TMaterial extends BaseModel { private static final long serialVersionUID = 1L; @@ -38,24 +40,5 @@ @ApiModelProperty(value = "状态 1启用 2禁用") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TModel.java b/manage/src/main/java/com/jilongda/manage/model/TModel.java index 7bbe1ab..78f3c1c 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TModel.java +++ b/manage/src/main/java/com/jilongda/manage/model/TModel.java @@ -7,6 +7,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_model") @ApiModel(value="TModel对象", description="镜架型号表") -public class TModel implements Serializable { +public class TModel extends BaseModel { private static final long serialVersionUID = 1L; @@ -63,24 +65,7 @@ @ApiModelProperty(value = "状态 1启用 2禁用") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - - + @ApiModelProperty(value = "库存") + @TableField("inventory") + private Integer inventory; } diff --git a/manage/src/main/java/com/jilongda/manage/model/TOptometrist.java b/manage/src/main/java/com/jilongda/manage/model/TOptometrist.java index 17dbeed..6872bf1 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TOptometrist.java +++ b/manage/src/main/java/com/jilongda/manage/model/TOptometrist.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_optometrist") @ApiModel(value="TOptometrist对象", description="验光师表") -public class TOptometrist implements Serializable { +public class TOptometrist extends BaseModel { private static final long serialVersionUID = 1L; @@ -54,24 +56,5 @@ @ApiModelProperty(value = "注册时间") @TableField("registerTime") private LocalDateTime registerTime; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TOptometry.java b/manage/src/main/java/com/jilongda/manage/model/TOptometry.java index d4984ca..7cc5037 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TOptometry.java +++ b/manage/src/main/java/com/jilongda/manage/model/TOptometry.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_optometry") @ApiModel(value="TOptometry对象", description="验光单") -public class TOptometry implements Serializable { +public class TOptometry extends BaseModel { private static final long serialVersionUID = 1L; @@ -70,24 +72,5 @@ @ApiModelProperty(value = "注册时间") @TableField("registerTime") private LocalDateTime registerTime; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java b/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java index b4dbd91..e50a8a3 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java +++ b/manage/src/main/java/com/jilongda/manage/model/TOptometryDetail.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_optometry_detail") @ApiModel(value="TOptometryDetail对象", description="验光单详情") -public class TOptometryDetail implements Serializable { +public class TOptometryDetail extends BaseModel { private static final long serialVersionUID = 1L; @@ -78,24 +80,5 @@ @ApiModelProperty(value = "注册时间") @TableField("registerTime") private LocalDateTime registerTime; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TOrder.java b/manage/src/main/java/com/jilongda/manage/model/TOrder.java index 8de65b8..b32d119 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TOrder.java +++ b/manage/src/main/java/com/jilongda/manage/model/TOrder.java @@ -7,6 +7,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_order") @ApiModel(value="TOrder对象", description="销售订单表") -public class TOrder implements Serializable { +public class TOrder extends BaseModel { private static final long serialVersionUID = 1L; @@ -75,24 +77,6 @@ @ApiModelProperty(value = "折射率") @TableField("refractiveIndex") private String refractiveIndex; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; @ApiModelProperty(value = "店铺员工id") @TableField("sysId") diff --git a/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java b/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java index 3d08591..f90621d 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java +++ b/manage/src/main/java/com/jilongda/manage/model/TOrderAccounting.java @@ -7,6 +7,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -24,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_order_accounting") @ApiModel(value="TOrderAccounting对象", description="订单核算表") -public class TOrderAccounting implements Serializable { +public class TOrderAccounting extends BaseModel { private static final long serialVersionUID = 1L; @@ -51,24 +53,6 @@ @ApiModelProperty(value = "镜架核算成本价") @TableField("frame") private BigDecimal frame; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; @ApiModelProperty(value = "手续费") @TableField("commission") diff --git a/manage/src/main/java/com/jilongda/manage/model/TOrderAftersales.java b/manage/src/main/java/com/jilongda/manage/model/TOrderAftersales.java index 347c4aa..7a1097d 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TOrderAftersales.java +++ b/manage/src/main/java/com/jilongda/manage/model/TOrderAftersales.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_order_aftersales") @ApiModel(value="TOrderAftersales对象", description="订单售后表") -public class TOrderAftersales implements Serializable { +public class TOrderAftersales extends BaseModel { private static final long serialVersionUID = 1L; @@ -54,24 +56,5 @@ @ApiModelProperty(value = "处理结果") @TableField("handleResult") private String handleResult; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TSupplier.java b/manage/src/main/java/com/jilongda/manage/model/TSupplier.java index 38e318a..de9c2d7 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TSupplier.java +++ b/manage/src/main/java/com/jilongda/manage/model/TSupplier.java @@ -6,10 +6,13 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.hibernate.validator.constraints.Length; /** * <p> @@ -23,7 +26,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_supplier") @ApiModel(value="TSupplier对象", description="供应商") -public class TSupplier implements Serializable { +public class TSupplier extends BaseModel { private static final long serialVersionUID = 1L; @@ -32,30 +35,12 @@ private Integer id; @ApiModelProperty(value = "供应商名称") + @Length(max = 25, message = "供应商名称长度不能超过25") @TableField("name") private String name; @ApiModelProperty(value = "状态 1启用 2禁用") @TableField("status") private Integer status; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/model/TTicket.java b/manage/src/main/java/com/jilongda/manage/model/TTicket.java index 3bf73d6..1c27162 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TTicket.java +++ b/manage/src/main/java/com/jilongda/manage/model/TTicket.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_ticket") @ApiModel(value="TTicket对象", description="小票机") -public class TTicket implements Serializable { +public class TTicket extends BaseModel { private static final long serialVersionUID = 1L; @@ -50,24 +52,6 @@ @ApiModelProperty(value = "密钥") @TableField("secret") private String secret; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; } diff --git a/manage/src/main/java/com/jilongda/manage/model/TWarehousing.java b/manage/src/main/java/com/jilongda/manage/model/TWarehousing.java index 01aff84..1fe930c 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TWarehousing.java +++ b/manage/src/main/java/com/jilongda/manage/model/TWarehousing.java @@ -6,6 +6,8 @@ import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; + +import com.jilongda.common.pojo.BaseModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -23,7 +25,7 @@ @EqualsAndHashCode(callSuper = false) @TableName("t_warehousing") @ApiModel(value="TWarehousing对象", description="镜架/镜片出库入库表") -public class TWarehousing implements Serializable { +public class TWarehousing extends BaseModel { private static final long serialVersionUID = 1L; @@ -46,24 +48,5 @@ @ApiModelProperty(value = "备注") @TableField("remark") private String remark; - - @ApiModelProperty(value = "创建时间") - @TableField("createTime") - private LocalDateTime createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("updateTime") - private LocalDateTime updateTime; - - @TableField("createBy") - private String createBy; - - @TableField("updateBy") - private String updateBy; - - @ApiModelProperty(value = "是否删除 0否1是") - @TableField("isDelete") - private Integer isDelete; - } diff --git a/manage/src/main/java/com/jilongda/manage/query/TBrandQuery.java b/manage/src/main/java/com/jilongda/manage/query/TBrandQuery.java new file mode 100644 index 0000000..391eb5c --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/query/TBrandQuery.java @@ -0,0 +1,10 @@ +package com.jilongda.manage.query; + +import com.jilongda.common.pojo.BasePage; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "镜架/镜片品牌查询参数") +public class TBrandQuery extends BasePage { +} diff --git a/manage/src/main/java/com/jilongda/manage/query/TMaterialQuery.java b/manage/src/main/java/com/jilongda/manage/query/TMaterialQuery.java new file mode 100644 index 0000000..5e94755 --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/query/TMaterialQuery.java @@ -0,0 +1,13 @@ +package com.jilongda.manage.query; + +import com.jilongda.common.pojo.BasePage; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "材质Query") +public class TMaterialQuery extends BasePage { + + + +} diff --git a/manage/src/main/java/com/jilongda/manage/query/TModelQuery.java b/manage/src/main/java/com/jilongda/manage/query/TModelQuery.java new file mode 100644 index 0000000..ee5d29b --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/query/TModelQuery.java @@ -0,0 +1,21 @@ +package com.jilongda.manage.query; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.jilongda.common.pojo.BasePage; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "镜架型号查询Query") +public class TModelQuery extends BasePage { + + @ApiModelProperty(value = "品牌id") + private Integer brandId; + + @ApiModelProperty(value = "供应商id") + private Integer supplierId; + + @ApiModelProperty(value = "型号") + private String name; +} diff --git a/manage/src/main/java/com/jilongda/manage/query/TSupplierQuery.java b/manage/src/main/java/com/jilongda/manage/query/TSupplierQuery.java new file mode 100644 index 0000000..ba0b8d2 --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/query/TSupplierQuery.java @@ -0,0 +1,15 @@ +package com.jilongda.manage.query; + +import com.jilongda.common.pojo.BasePage; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "供应商查询参数") +public class TSupplierQuery extends BasePage { + + @ApiModelProperty(value = "供应商名称") + private String name; + +} diff --git a/manage/src/main/java/com/jilongda/manage/service/TBrandService.java b/manage/src/main/java/com/jilongda/manage/service/TBrandService.java index d0a8e88..1b519ef 100644 --- a/manage/src/main/java/com/jilongda/manage/service/TBrandService.java +++ b/manage/src/main/java/com/jilongda/manage/service/TBrandService.java @@ -1,7 +1,10 @@ package com.jilongda.manage.service; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TBrand; import com.baomidou.mybatisplus.extension.service.IService; +import com.jilongda.manage.query.TBrandQuery; +import com.jilongda.manage.vo.TBrandVO; /** * <p> @@ -13,4 +16,10 @@ */ public interface TBrandService extends IService<TBrand> { + /** + * 获取镜架/镜片品牌分页列表 + * @param query + * @return + */ + PageInfo<TBrandVO> pageList(TBrandQuery query); } diff --git a/manage/src/main/java/com/jilongda/manage/service/TMaterialService.java b/manage/src/main/java/com/jilongda/manage/service/TMaterialService.java index a1a3d0b..9835806 100644 --- a/manage/src/main/java/com/jilongda/manage/service/TMaterialService.java +++ b/manage/src/main/java/com/jilongda/manage/service/TMaterialService.java @@ -1,11 +1,15 @@ package com.jilongda.manage.service; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TMaterial; import com.baomidou.mybatisplus.extension.service.IService; +import com.jilongda.manage.query.TMaterialQuery; +import com.jilongda.manage.vo.TMaterialVO; +import com.sun.org.apache.xpath.internal.operations.Bool; /** * <p> - * 镜架/镜片品牌表 服务类 + * 材质表 服务类 * </p> * * @author 无关风月 @@ -13,4 +17,26 @@ */ public interface TMaterialService extends IService<TMaterial> { + /** + * 判断材质是否存在 + * @param id + * @param name + * @return + */ + Boolean isExit(Integer id, String name); + + /** + * 材质启用禁用 + * @param id + * @param status + * @return + */ + Boolean upAndDown(Long id, Integer status); + + /** + * 获取材质分页列表 + * @param query + * @return + */ + PageInfo<TMaterialVO> pageList(TMaterialQuery query); } diff --git a/manage/src/main/java/com/jilongda/manage/service/TModelService.java b/manage/src/main/java/com/jilongda/manage/service/TModelService.java index 167b86f..5586451 100644 --- a/manage/src/main/java/com/jilongda/manage/service/TModelService.java +++ b/manage/src/main/java/com/jilongda/manage/service/TModelService.java @@ -1,7 +1,10 @@ package com.jilongda.manage.service; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TModel; import com.baomidou.mybatisplus.extension.service.IService; +import com.jilongda.manage.query.TModelQuery; +import com.jilongda.manage.vo.TModelVO; /** * <p> @@ -13,4 +16,27 @@ */ public interface TModelService extends IService<TModel> { + /** + * 镜架型号上下架 + * @param name + * @param status + * @return + */ + Boolean upAndDown(String name, Integer status); + + /** + * 镜架型号颜色上下架 + * @param name + * @param color + * @param status + * @return + */ + Boolean upAndDownColor(String name, String color, Integer status); + + /** + * 获取镜架型号分页列表 + * @param query + * @return + */ + PageInfo<TModelVO> pageList(TModelQuery query); } diff --git a/manage/src/main/java/com/jilongda/manage/service/TSupplierService.java b/manage/src/main/java/com/jilongda/manage/service/TSupplierService.java index cc99f87..4171108 100644 --- a/manage/src/main/java/com/jilongda/manage/service/TSupplierService.java +++ b/manage/src/main/java/com/jilongda/manage/service/TSupplierService.java @@ -1,7 +1,10 @@ package com.jilongda.manage.service; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TSupplier; import com.baomidou.mybatisplus.extension.service.IService; +import com.jilongda.manage.query.TSupplierQuery; +import com.jilongda.manage.vo.TSupplierVO; /** * <p> @@ -13,4 +16,26 @@ */ public interface TSupplierService extends IService<TSupplier> { + /** + * 获取供应商分页列表 + * @param query + * @return + */ + PageInfo<TSupplierVO> pageList(TSupplierQuery query); + + /** + * 判断供应商是否存在 + * @param id + * @param name + * @return + */ + Boolean isExit(Integer id, String name); + + /** + * 启用禁用供应商 + * @param id + * @param status + * @return + */ + Boolean upAndDown(Long id, Integer status); } diff --git a/manage/src/main/java/com/jilongda/manage/service/impl/TBrandServiceImpl.java b/manage/src/main/java/com/jilongda/manage/service/impl/TBrandServiceImpl.java index 7f0a3ca..e2e21aa 100644 --- a/manage/src/main/java/com/jilongda/manage/service/impl/TBrandServiceImpl.java +++ b/manage/src/main/java/com/jilongda/manage/service/impl/TBrandServiceImpl.java @@ -1,10 +1,16 @@ package com.jilongda.manage.service.impl; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TBrand; import com.jilongda.manage.mapper.TBrandMapper; +import com.jilongda.manage.query.TBrandQuery; import com.jilongda.manage.service.TBrandService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jilongda.manage.vo.TBrandVO; +import com.jilongda.manage.vo.TStoreVO; import org.springframework.stereotype.Service; + +import java.util.List; /** * <p> @@ -17,4 +23,11 @@ @Service public class TBrandServiceImpl extends ServiceImpl<TBrandMapper, TBrand> implements TBrandService { + @Override + public PageInfo<TBrandVO> pageList(TBrandQuery query) { + PageInfo<TBrandVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); + List<TBrandVO> list = this.baseMapper.pageList(query,pageInfo); + pageInfo.setRecords(list); + return pageInfo; + } } diff --git a/manage/src/main/java/com/jilongda/manage/service/impl/TMaterialServiceImpl.java b/manage/src/main/java/com/jilongda/manage/service/impl/TMaterialServiceImpl.java index da1ef39..6b882b7 100644 --- a/manage/src/main/java/com/jilongda/manage/service/impl/TMaterialServiceImpl.java +++ b/manage/src/main/java/com/jilongda/manage/service/impl/TMaterialServiceImpl.java @@ -1,10 +1,19 @@ package com.jilongda.manage.service.impl; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TMaterial; import com.jilongda.manage.mapper.TMaterialMapper; +import com.jilongda.manage.model.TSupplier; +import com.jilongda.manage.query.TMaterialQuery; import com.jilongda.manage.service.TMaterialService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jilongda.manage.vo.TMaterialVO; +import com.jilongda.manage.vo.TSupplierVO; import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; /** * <p> @@ -17,4 +26,28 @@ @Service public class TMaterialServiceImpl extends ServiceImpl<TMaterialMapper, TMaterial> implements TMaterialService { + @Override + public Boolean isExit(Integer id, String name) { + if(Objects.nonNull(id)){ + return this.lambdaQuery().ne(TMaterial::getId, id).eq(TMaterial::getName, name).count() > 0; + }else { + // 如果是新增,则判断名称是否存在 + return count(new LambdaQueryChainWrapper<>(getBaseMapper()).eq(TMaterial::getName, name)) > 0; + } + } + + @Override + public Boolean upAndDown(Long id, Integer status) { + TMaterial material = this.baseMapper.selectById(id); + material.setStatus(status); + return this.updateById(material); + } + + @Override + public PageInfo<TMaterialVO> pageList(TMaterialQuery query) { + PageInfo<TMaterialVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); + List<TMaterialVO> list = this.baseMapper.pageList(query,pageInfo); + pageInfo.setRecords(list); + return pageInfo; + } } diff --git a/manage/src/main/java/com/jilongda/manage/service/impl/TModelServiceImpl.java b/manage/src/main/java/com/jilongda/manage/service/impl/TModelServiceImpl.java index d348641..d0e2ee2 100644 --- a/manage/src/main/java/com/jilongda/manage/service/impl/TModelServiceImpl.java +++ b/manage/src/main/java/com/jilongda/manage/service/impl/TModelServiceImpl.java @@ -1,10 +1,24 @@ package com.jilongda.manage.service.impl; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.mapper.TBrandMapper; +import com.jilongda.manage.mapper.TSupplierMapper; +import com.jilongda.manage.model.TBrand; import com.jilongda.manage.model.TModel; import com.jilongda.manage.mapper.TModelMapper; +import com.jilongda.manage.model.TSupplier; +import com.jilongda.manage.query.TModelQuery; import com.jilongda.manage.service.TModelService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jilongda.manage.vo.TBrandVO; +import com.jilongda.manage.vo.TModelVO; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * <p> @@ -17,4 +31,53 @@ @Service public class TModelServiceImpl extends ServiceImpl<TModelMapper, TModel> implements TModelService { + @Autowired + private TBrandMapper brandMapper; + @Autowired + private TSupplierMapper supplierMapper; + + @Override + public Boolean upAndDown(String name, Integer status) { + List<TModel> models = this.baseMapper.selectList(Wrappers.lambdaQuery(TModel.class) + .eq(TModel::getName,name)); + models.stream().filter(Objects::nonNull).forEach(model -> model.setStatus(status)); + return this.updateBatchById(models); + } + + @Override + public Boolean upAndDownColor(String name, String color, Integer status) { + TModel model = this.baseMapper.selectOne(Wrappers.lambdaQuery(TModel.class) + .eq(TModel::getName,name) + .eq(TModel::getColor,color) + .last("LIMIT1 ")); + if (Objects.nonNull(model)){ + model.setStatus(status); + return this.updateById(model); + } + return false; + } + + @Override + public PageInfo<TModelVO> pageList(TModelQuery query) { + PageInfo<TModelVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); + List<TModelVO> list = this.baseMapper.pageList(query,pageInfo); + List<Integer> brandIds = list.stream().map(TModel::getBrandId).collect(Collectors.toList()); + List<Integer> supplierIds= list.stream().map(TModel::getSupplierId).collect(Collectors.toList()); + List<TBrand> tBrands = brandMapper.selectList(Wrappers.lambdaQuery(TBrand.class) + .in(TBrand::getId, brandIds)); + List<TSupplier> tSuppliers = supplierMapper.selectList(Wrappers.lambdaQuery(TSupplier.class) + .in(TSupplier::getId, supplierIds)); + for (TModelVO modelVO : list) { + TBrand tBrand = tBrands.stream().filter(brand -> brand.getId().equals(modelVO.getBrandId())).findFirst().orElse(null); + if(Objects.nonNull(tBrand)){ + modelVO.setBrandName(tBrand.getName()); + } + TSupplier tSupplier = tSuppliers.stream().filter(supplier -> supplier.getId().equals(modelVO.getSupplierId())).findFirst().orElse(null); + if(Objects.nonNull(tSupplier)){ + modelVO.setSupplierName(tSupplier.getName()); + } + } + pageInfo.setRecords(list); + return pageInfo; + } } diff --git a/manage/src/main/java/com/jilongda/manage/service/impl/TSupplierServiceImpl.java b/manage/src/main/java/com/jilongda/manage/service/impl/TSupplierServiceImpl.java index efeaf26..beef3d4 100644 --- a/manage/src/main/java/com/jilongda/manage/service/impl/TSupplierServiceImpl.java +++ b/manage/src/main/java/com/jilongda/manage/service/impl/TSupplierServiceImpl.java @@ -1,10 +1,23 @@ package com.jilongda.manage.service.impl; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.model.TBrand; +import com.jilongda.manage.model.TMaterial; +import com.jilongda.manage.model.TModel; import com.jilongda.manage.model.TSupplier; import com.jilongda.manage.mapper.TSupplierMapper; +import com.jilongda.manage.query.TSupplierQuery; import com.jilongda.manage.service.TSupplierService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jilongda.manage.vo.TModelVO; +import com.jilongda.manage.vo.TSupplierVO; import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * <p> @@ -17,4 +30,29 @@ @Service public class TSupplierServiceImpl extends ServiceImpl<TSupplierMapper, TSupplier> implements TSupplierService { + @Override + public PageInfo<TSupplierVO> pageList(TSupplierQuery query) { + PageInfo<TSupplierVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); + List<TSupplierVO> list = this.baseMapper.pageList(query,pageInfo); + pageInfo.setRecords(list); + return pageInfo; + } + + @Override + public Boolean isExit(Integer id, String name) { + if(Objects.nonNull(id)){ + return this.lambdaQuery().ne(TSupplier::getId, id).eq(TSupplier::getName, name).count() > 0; + }else { + // 如果是新增,则判断名称是否存在 + return count(new LambdaQueryChainWrapper<>(getBaseMapper()).eq(TSupplier::getName, name)) > 0; + } + } + + @Override + public Boolean upAndDown(Long id, Integer status) { + TSupplier supplier = this.baseMapper.selectById(id); + supplier.setStatus(status); + return this.updateById(supplier); + } + } diff --git a/manage/src/main/java/com/jilongda/manage/vo/TBrandVO.java b/manage/src/main/java/com/jilongda/manage/vo/TBrandVO.java new file mode 100644 index 0000000..c0ee10f --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/vo/TBrandVO.java @@ -0,0 +1,11 @@ +package com.jilongda.manage.vo; + +import com.jilongda.common.pojo.BasePage; +import com.jilongda.manage.model.TBrand; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "镜架/镜片品牌VO") +public class TBrandVO extends TBrand { +} diff --git a/manage/src/main/java/com/jilongda/manage/vo/TMaterialVO.java b/manage/src/main/java/com/jilongda/manage/vo/TMaterialVO.java new file mode 100644 index 0000000..0ef9003 --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/vo/TMaterialVO.java @@ -0,0 +1,10 @@ +package com.jilongda.manage.vo; + +import com.jilongda.manage.model.TMaterial; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "材质VO") +public class TMaterialVO extends TMaterial { +} diff --git a/manage/src/main/java/com/jilongda/manage/vo/TModelVO.java b/manage/src/main/java/com/jilongda/manage/vo/TModelVO.java new file mode 100644 index 0000000..66ad9ba --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/vo/TModelVO.java @@ -0,0 +1,20 @@ +package com.jilongda.manage.vo; + +import com.jilongda.manage.model.TModel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +@ApiModel(value = "镜架型号VO") +public class TModelVO extends TModel { + + @ApiModelProperty(value = "色号集合") + private List<String> colorList; + @ApiModelProperty(value = "品牌名称") + private String brandName; + @ApiModelProperty(value = "供应商") + private String supplierName; +} diff --git a/manage/src/main/java/com/jilongda/manage/vo/TSupplierVO.java b/manage/src/main/java/com/jilongda/manage/vo/TSupplierVO.java new file mode 100644 index 0000000..8fe9c43 --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/vo/TSupplierVO.java @@ -0,0 +1,12 @@ +package com.jilongda.manage.vo; + +import com.jilongda.manage.model.TSupplier; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +@Data +@ApiModel(value = "供应商VO") +public class TSupplierVO extends TSupplier { + + +} diff --git a/manage/src/main/resources/mapping/SecUserMapper.xml b/manage/src/main/resources/mapping/SecUserMapper.xml index 634b301..d341d4d 100644 --- a/manage/src/main/resources/mapping/SecUserMapper.xml +++ b/manage/src/main/resources/mapping/SecUserMapper.xml @@ -25,6 +25,7 @@ <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"/> @@ -40,7 +41,7 @@ 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 + provinceCode, cityCode, areaCode,storeId </sql> <sql id="Base_Column_List_Other"> diff --git a/manage/src/main/resources/mapping/TBrandMapper.xml b/manage/src/main/resources/mapping/TBrandMapper.xml index 7051115..975c09b 100644 --- a/manage/src/main/resources/mapping/TBrandMapper.xml +++ b/manage/src/main/resources/mapping/TBrandMapper.xml @@ -18,7 +18,13 @@ <!-- 通用查询结果列 --> <sql id="Base_Column_List"> - id, name, type, status, createTime, updateTime, createBy, updateBy, isDelete, isMain + id, `name`, `type`, status, createTime, updateTime, createBy, updateBy, isDelete, isMain </sql> + <select id="pageList" resultType="com.jilongda.manage.vo.TBrandVO"> + select <include refid="Base_Column_List"></include> + from t_brand + where isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} + ORDER BY createTime DESC + </select> </mapper> diff --git a/manage/src/main/resources/mapping/TMaterialMapper.xml b/manage/src/main/resources/mapping/TMaterialMapper.xml index 3a7295b..b998cb2 100644 --- a/manage/src/main/resources/mapping/TMaterialMapper.xml +++ b/manage/src/main/resources/mapping/TMaterialMapper.xml @@ -16,7 +16,13 @@ <!-- 通用查询结果列 --> <sql id="Base_Column_List"> - id, name, status, createTime, updateTime, createBy, updateBy, isDelete + id, `name`, status, createTime, updateTime, createBy, updateBy, isDelete </sql> + <select id="pageList" resultType="com.jilongda.manage.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/manage/src/main/resources/mapping/TModelMapper.xml b/manage/src/main/resources/mapping/TModelMapper.xml index dd419d4..e2a025d 100644 --- a/manage/src/main/resources/mapping/TModelMapper.xml +++ b/manage/src/main/resources/mapping/TModelMapper.xml @@ -18,11 +18,30 @@ <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 + id, brandId, supplierId, materialId, color, sale, cost, `name`, status, createTime, updateTime, createBy, updateBy, isDelete,inventory </sql> + <select id="pageList" resultType="com.jilongda.manage.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/manage/src/main/resources/mapping/TSupplierMapper.xml b/manage/src/main/resources/mapping/TSupplierMapper.xml index 1539771..988a1dc 100644 --- a/manage/src/main/resources/mapping/TSupplierMapper.xml +++ b/manage/src/main/resources/mapping/TSupplierMapper.xml @@ -16,7 +16,18 @@ <!-- 通用查询结果列 --> <sql id="Base_Column_List"> - id, name, status, createTime, updateTime, createBy, updateBy, isDelete + id, `name`, status, createTime, updateTime, createBy, updateBy, isDelete </sql> + <select id="pageList" resultType="com.jilongda.manage.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/optometry/pom.xml b/optometry/pom.xml index 4cdba5a..401cd4b 100644 --- a/optometry/pom.xml +++ b/optometry/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> - <artifactId>sales</artifactId> + <artifactId>eyes</artifactId> <groupId>com</groupId> <version>0.0.1-SNAPSHOT</version> </parent> @@ -73,7 +73,7 @@ </dependencies> <build> - <finalName>applet</finalName> + <finalName>optometry</finalName> <plugins> <plugin> @@ -87,7 +87,7 @@ <artifactId>lombok</artifactId> </exclude> </excludes> - <mainClass>com.jilongda.applet.AppletApplication</mainClass> + <mainClass>com.jilongda.optometry.AppletApplication</mainClass> </configuration> </plugin> diff --git a/pom.xml b/pom.xml index 4c8a6ee..0365742 100644 --- a/pom.xml +++ b/pom.xml @@ -17,10 +17,10 @@ <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com</groupId> - <artifactId>sales</artifactId> + <artifactId>eyes</artifactId> <version>0.0.1-SNAPSHOT</version> - <name>sales</name> - <description>sales</description> + <name>eyes</name> + <description>eyes</description> <properties> <java.version>1.8</java.version> <spring.boot.version>2.7.0</spring.boot.version> @@ -61,40 +61,5 @@ </dependencies> - - <!--<build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <version>${spring.boot.version}</version> - <configuration> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - <mainClass>com.sales.applet.AppletApplication</mainClass> - <mainClass>com.jilongda.manage.ManageApplication</mainClass> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - <encoding>UTF-8</encoding> - <optimize>true</optimize> - <useIncrementalCompilation>false</useIncrementalCompilation> - <!– 去除泛型编译告警 –> - <compilerArgument>-Xlint:unchecked</compilerArgument> - </configuration> - </plugin> - </plugins> - </build>--> </project> -- Gitblit v1.7.1