common/src/main/java/com/jilongda/common/pojo/BaseModel.java
@@ -32,7 +32,7 @@ /** * 新增执行 */ @ApiModelProperty(value = "记录创建人,前端忽略") @ApiModelProperty(value = "记录创建人(操作人),前端忽略") @TableField(value = "createBy", fill = FieldFill.INSERT) private String createBy; manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java
@@ -1,9 +1,26 @@ package com.jilongda.manage.controller; import com.jilongda.common.basic.ApiResult; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TInventoryQuery; import com.jilongda.manage.service.TInventoryFrameDetailService; import com.jilongda.manage.service.TInventoryLensDetailService; import com.jilongda.manage.service.TInventoryService; import com.jilongda.manage.utils.LoginInfoUtil; import com.jilongda.manage.vo.TFrameGoodsVO; import com.jilongda.manage.vo.TInventoryVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * <p> @@ -14,8 +31,26 @@ * @since 2024-12-09 */ @RestController @Api(tags = "盘点管理") @RequestMapping("/t-inventory") public class TInventoryController { @Resource private TInventoryService inventoryService; @Resource private TInventoryFrameDetailService inventoryFrameDetailService; @Resource private TInventoryLensDetailService inventoryLensDetailService; @Resource private LoginInfoUtil loginInfoUtil; @ApiOperation(value = "盘点分页列表") @PostMapping(value = "/pageList") public ApiResult<PageInfo<TInventoryVO>> pageList(@RequestBody TInventoryQuery query) { if (StringUtils.hasLength(query.getStartTime())){ query.setStartTime(query.getStartTime()+" 00:00:00"); query.setEndTime(query.getEndTime()+" 23:59:59"); } return ApiResult.success(inventoryService.pageList(query)); } } manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java
@@ -1,6 +1,8 @@ package com.jilongda.manage.controller; import com.alibaba.fastjson.JSONObject; import com.google.gson.JsonArray; import com.jilongda.common.basic.ApiResult; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TLensSeries; @@ -15,6 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; /** * <p> @@ -69,5 +74,57 @@ lensSeriesService.updateById(byId); return ApiResult.success(); } @ApiOperation(value = "通过品牌id查询镜片系列列表") @GetMapping(value = "/seriesList") public ApiResult<List<TLensSeries>> seriesList(Integer brandId) { return ApiResult.success(lensSeriesService.lambdaQuery().eq(TLensSeries::getBrandId,brandId).list()); } @ApiOperation(value = "通过系列id查询球/非球 返回参数1为球 2非球 3双飞") @GetMapping(value = "/lensTypeList") public ApiResult<List<Integer>> lensTypeList(Integer id) { TLensSeries byId = lensSeriesService.getById(id); List<Integer> integers = new ArrayList<>(); if (StringUtils.hasLength(byId.getSphere())){ integers.add(1); } if (StringUtils.hasLength(byId.getAsphericSurface())){ integers.add(2); } if (StringUtils.hasLength(byId.getDoubleNon())){ integers.add(3); } return ApiResult.success(integers); } @ApiOperation(value = "根据系列id + 球/非球查询折射率列表 球/非球入参数1为球 2非球 3双飞") @GetMapping(value = "/refractiveIndexList") public ApiResult<List<String>> refractiveIndexList(Integer id, Integer lensType) { TLensSeries byId = lensSeriesService.getById(id); if (lensType==1){ String sphere = byId.getSphere(); // 将字符串化为jsonArray if (StringUtils.hasLength(sphere)) { JSONObject.parseArray(sphere); } else { return ApiResult.success(new ArrayList<String>()); } } if (lensType==2){ String asphericSurface = byId.getAsphericSurface(); if (StringUtils.hasLength(asphericSurface)) { JSONObject.parseArray(asphericSurface); } else { return ApiResult.success(new ArrayList<String>()); } } if (lensType==3){ String doubleNon = byId.getDoubleNon(); if (StringUtils.hasLength(doubleNon)) { JSONObject.parseArray(doubleNon); } else { return ApiResult.success(new ArrayList<String>()); } } return ApiResult.success(new ArrayList<String>()); } } manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java
@@ -8,16 +8,17 @@ import com.jilongda.common.enums.WarehousingTypeEnum; import com.jilongda.common.security.JwtTokenUtils; import com.jilongda.common.utils.CodeGenerateUtils; import com.jilongda.manage.dto.GetCurrentByParam; import com.jilongda.manage.dto.GetCurrentByParamLens; import com.jilongda.manage.dto.TWarehousingDTO; import com.jilongda.manage.dto.TWarehousingLensDTO; import com.jilongda.manage.model.*; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TLensGoodsQuery; import com.jilongda.manage.query.TWarehousingDetailLensQuery; import com.jilongda.manage.query.TWarehousingDetailQuery; import com.jilongda.manage.service.*; import com.jilongda.manage.vo.TFrameWarehousingDetailVO; import com.jilongda.manage.vo.TLensWarehousingDetailVO; import com.jilongda.manage.vo.TWarehousingLensVO; import com.jilongda.manage.vo.TWarehousingVO; import com.jilongda.manage.vo.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; @@ -28,6 +29,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * <p> @@ -52,7 +54,53 @@ private TFrameGoodsService frameGoodsService; @Autowired private TLensGoodsService lensGoodsService; @Autowired private TModelService modelService; @Autowired private TLensSeriesService lensSeriesService; /** * 通过型号查询色号列表 */ @ApiOperation(value = "镜架-根据品牌id、型号名称、色号名称查询当前库存") @PostMapping(value = "/getCurrentByParamFrame") public ApiResult<Integer> getCurrentByParamFrame(@RequestBody GetCurrentByParam getCurrentByParam) { // 根据型号名称 查询型号列表ids List<Integer> collect = modelService.lambdaQuery().eq(TModel::getName, getCurrentByParam.getModel()) .eq(TModel::getColor,getCurrentByParam.getColor()) .eq(TModel::getBrandId,getCurrentByParam.getBrandId()) .list().stream().map(TModel::getId).collect(Collectors.toList()); TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) .eq(TFrameGoods::getColor, getCurrentByParam).one(); if (one!=null){ return ApiResult.success(one.getTotal()); } return ApiResult.success(0); } @ApiOperation(value = "镜片-根据品牌id、系列id、球/非球、折射率、球镜、柱镜查询当前库存") @PostMapping(value = "/getCurrentByParamLens") public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId()) .eq(TLensGoods::getLensType, dto.getLensType()) .eq(TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) .eq(TLensGoods::getBallMirror, dto.getBallMirror()) .eq(TLensGoods::getColumnMirror, dto.getColumnMirror()) .one(); if (one!=null){ return ApiResult.success(one.getTotal()); } return ApiResult.success(0); } @ApiOperation(value = "镜架库存分页列表") @PostMapping(value = "/frameReceiptList") public ApiResult<PageInfo<TFrameGoodsVO>> frameReceiptList(@RequestBody TFrameGoodsQuery query) { return ApiResult.success(frameGoodsService.lensReceiptList(query)); } @ApiOperation(value = "镜片库存分页列表") @PostMapping(value = "/lensReceiptList") public ApiResult<PageInfo<TLensGoodsVO>> lensReceiptList(@RequestBody TLensGoodsQuery query) { return ApiResult.success(lensGoodsService.lensReceiptList(query)); } /** * 出入库单列表 */ @@ -91,7 +139,7 @@ */ @ApiOperation(value = "添加镜架出库,入库,作废,退货") @PostMapping(value = "/outBound") public ApiResult<Integer> outBound(@Validated @RequestBody TWarehousingDTO dto) { public ApiResult outBound(@Validated @RequestBody TWarehousingDTO dto) { // 获取当前用户 String username = JwtTokenUtils.getUsername(); dto.setCreateBy(username); @@ -105,13 +153,15 @@ detail.setWarehousingId(dto.getId()); detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); }); frameWarehousingDetailService.saveBatch(frameWarehousingDetails); if (dto.getStatus()==1||dto.getStatus()==3){ List<TFrameGoods> list1 = new ArrayList<>(); for (TFrameWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { TFrameGoods one = frameGoodsService.lambdaQuery().eq(TFrameGoods::getModelId, frameWarehousingDetail.getModelId()) .eq(TFrameGoods::getColor, frameWarehousingDetail.getColor()).one(); if (one!=null){ if (one.getTotal()-frameWarehousingDetail.getTotal()<0){ return ApiResult.failed("库存不足"); } // 增加对应库存 one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); list1.add(one); @@ -119,6 +169,8 @@ } if (!list1.isEmpty())frameGoodsService.updateBatchById(list1); } frameWarehousingDetailService.saveBatch(frameWarehousingDetails); if (dto.getStatus()==2 || dto.getStatus()==4){ List<TFrameGoods> list1 = new ArrayList<>(); List<TFrameGoods> list2 = new ArrayList<>(); @@ -150,7 +202,7 @@ */ @ApiOperation(value = "添加镜片出库,入库,作废,退货") @PostMapping(value = "/outBoundLens") public ApiResult<String> outBoundLens(@Validated @RequestBody TWarehousingLensDTO dto) { public ApiResult outBoundLens(@Validated @RequestBody TWarehousingLensDTO dto) { // 获取当前用户 String username = JwtTokenUtils.getUsername(); dto.setCreateBy(username); @@ -163,16 +215,19 @@ detail.setWarehousingId(dto.getId()); detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); }); lensWarehousingDetailService.saveBatch(frameWarehousingDetails); if (dto.getStatus()==1||dto.getStatus()==3){ List<TLensGoods> list1 = new ArrayList<>(); for (TLensWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) .eq(TLensGoods::getLensType, frameWarehousingDetail.getType()) .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) .one(); if (one!=null){ if (one.getTotal()-frameWarehousingDetail.getTotal()<0){ return ApiResult.failed("库存不足"); } // 减少对应库存 one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); list1.add(one); @@ -180,6 +235,8 @@ } if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); } lensWarehousingDetailService.saveBatch(frameWarehousingDetails); if (dto.getStatus()==2 || dto.getStatus()==4){ List<TLensGoods> list1 = new ArrayList<>(); List<TLensGoods> list2 = new ArrayList<>(); @@ -187,6 +244,8 @@ TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) .eq(TLensGoods::getLensType, frameWarehousingDetail.getType()) .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) .one(); if (one!=null){ @@ -196,6 +255,7 @@ }else { // 新增 TLensGoods tFrameGoods = new TLensGoods(); tFrameGoods.setLensType(frameWarehousingDetail.getType()); tFrameGoods.setSeriesId(frameWarehousingDetail.getSeriesId()); tFrameGoods.setBallMirror(frameWarehousingDetail.getBallMirror()); tFrameGoods.setColumnMirror(frameWarehousingDetail.getColumnMirror()); @@ -208,7 +268,7 @@ if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); if (!list2.isEmpty())lensGoodsService.saveBatch(list2); } return ApiResult.success(); return ApiResult.success(dto.getId()); } /** manage/src/main/java/com/jilongda/manage/dto/GetCurrentByParam.java
New file @@ -0,0 +1,21 @@ 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.util.List; @Data @ApiModel(value = "镜架查询当前库存DTO") public class GetCurrentByParam { @ApiModelProperty(value = "镜架型号名称") private String model; @ApiModelProperty(value = "色号") private String color; @ApiModelProperty(value = "品牌id") private Integer brandId; } manage/src/main/java/com/jilongda/manage/dto/GetCurrentByParamLens.java
New file @@ -0,0 +1,24 @@ package com.jilongda.manage.dto; import com.jilongda.manage.model.TModel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "镜片查询当前库存DTO") public class GetCurrentByParamLens { @ApiModelProperty(value = "系列id") private Integer seriesId; @ApiModelProperty(value = "1球2非球3双非") private Integer lensType; @ApiModelProperty(value = "品牌id") private Integer brandId; @ApiModelProperty(value = "折射率") private String refractiveIndex; @ApiModelProperty(value = "球镜") private String ballMirror; @ApiModelProperty(value = "柱镜") private String columnMirror; } manage/src/main/java/com/jilongda/manage/mapper/TFrameGoodsMapper.java
@@ -5,7 +5,11 @@ import com.jilongda.manage.model.TAppUser; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.query.TAppUserQuery; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TOptometryQuery; import com.jilongda.manage.vo.TAppUserVO; import com.jilongda.manage.vo.TFrameGoodsVO; import com.jilongda.manage.vo.TOptometryVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -21,4 +25,5 @@ public interface TFrameGoodsMapper extends BaseMapper<TFrameGoods> { List<TFrameGoodsVO> lensReceiptList(@Param("query")TFrameGoodsQuery query, @Param("pageInfo")PageInfo<TFrameGoodsVO> pageInfo); } manage/src/main/java/com/jilongda/manage/mapper/TInventoryMapper.java
@@ -1,7 +1,15 @@ package com.jilongda.manage.mapper; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TInventory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jilongda.manage.query.TInventoryQuery; import com.jilongda.manage.query.TLensGoodsQuery; import com.jilongda.manage.vo.TInventoryVO; import com.jilongda.manage.vo.TLensGoodsVO; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> @@ -13,4 +21,5 @@ */ public interface TInventoryMapper extends BaseMapper<TInventory> { List<TInventoryVO> pageList(@Param("query")TInventoryQuery query, @Param("pageInfo")PageInfo<TInventoryVO> pageInfo); } manage/src/main/java/com/jilongda/manage/mapper/TLensGoodsMapper.java
@@ -1,8 +1,16 @@ package com.jilongda.manage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TLensGoodsQuery; import com.jilongda.manage.vo.TFrameGoodsVO; import com.jilongda.manage.vo.TLensGoodsVO; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> @@ -15,4 +23,6 @@ public interface TLensGoodsMapper extends BaseMapper<TLensGoods> { List<TLensGoodsVO> lensReceiptList(@Param("query")TLensGoodsQuery query, @Param("pageInfo")PageInfo<TLensGoodsVO> pageInfo); } manage/src/main/java/com/jilongda/manage/model/TFrameGoods.java
@@ -39,5 +39,7 @@ @ApiModelProperty(value = "门店id") @TableField("storeId") private Integer storeId; @ApiModelProperty(value = "1启用2禁用") @TableField("status") private Integer status; } manage/src/main/java/com/jilongda/manage/model/TLensGoods.java
@@ -45,5 +45,11 @@ @ApiModelProperty(value = "门店id") @TableField("storeId") private Integer storeId; @ApiModelProperty(value = "1启用2禁用") @TableField("status") private Integer status; @ApiModelProperty(value = "1球2非球3双非") @TableField("lensType") private Integer lensType; } manage/src/main/java/com/jilongda/manage/query/TFrameGoodsQuery.java
New file @@ -0,0 +1,34 @@ package com.jilongda.manage.query; import com.jilongda.common.dto.TimeRangePageDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "镜架库存Query") public class TFrameGoodsQuery extends TimeRangePageDTO { @ApiModelProperty(value = "品牌id") private String brandId; @ApiModelProperty(value = "供应商") private String supplierId; @ApiModelProperty(value = "色号") private String color; @ApiModelProperty(value = "店铺id") private Integer storeId; @ApiModelProperty(value = "镜架型号") private String model; @ApiModelProperty(value = "材质id") private String materialId; @ApiModelProperty(value = "状态1启用 2禁用") private Integer status; @ApiModelProperty(value = "是否低库存 1是2否") private Integer isWarning; @ApiModelProperty(value = "库存起始数量") private Integer startCount; @ApiModelProperty(value = "库存结束数量") private Integer endCount; } manage/src/main/java/com/jilongda/manage/query/TInventoryQuery.java
New file @@ -0,0 +1,23 @@ package com.jilongda.manage.query; import com.jilongda.common.dto.TimeRangePageDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "盘点Query") public class TInventoryQuery extends TimeRangePageDTO { @ApiModelProperty(value = "盘点品类 1镜架2镜片") private Integer type; @ApiModelProperty(value = "盘点类型 1型号2品牌3材质4球/柱镜5折射率6系列 123属于镜架 456属于镜片") private Integer status; @ApiModelProperty(value = "店铺id") private Integer storeId; @ApiModelProperty(value = "操作人") private String createBy; @ApiModelProperty(value = "盘点日期起始时间2022-11-11") private String startTime; @ApiModelProperty(value = "盘点日期结束时间2023-11-11") private String endTime; } manage/src/main/java/com/jilongda/manage/query/TLensGoodsQuery.java
New file @@ -0,0 +1,28 @@ package com.jilongda.manage.query; import com.jilongda.common.dto.TimeRangePageDTO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "镜片库存Query") public class TLensGoodsQuery extends TimeRangePageDTO { @ApiModelProperty(value = "品牌id") private String brandId; @ApiModelProperty(value = "系列id") private String seriesId; @ApiModelProperty(value = "1球2非球3双非") private Integer lensType; @ApiModelProperty(value = "店铺id") private Integer storeId; @ApiModelProperty(value = "折射率") private String refractiveIndex; @ApiModelProperty(value = "库存类型 1库存 2非库存") private Integer type; @ApiModelProperty(value = "状态1启用 2禁用") private Integer status; @ApiModelProperty(value = "是否低库存 1是2否") private Integer isWarning; } manage/src/main/java/com/jilongda/manage/service/TFrameGoodsService.java
@@ -5,7 +5,9 @@ import com.jilongda.manage.model.TAppUser; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.query.TAppUserQuery; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.vo.TAppUserVO; import com.jilongda.manage.vo.TFrameGoodsVO; /** * <p> @@ -17,4 +19,6 @@ */ public interface TFrameGoodsService extends IService<TFrameGoods> { PageInfo<TFrameGoodsVO> lensReceiptList(TFrameGoodsQuery query); } manage/src/main/java/com/jilongda/manage/service/TInventoryService.java
@@ -1,7 +1,10 @@ package com.jilongda.manage.service; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TInventory; import com.baomidou.mybatisplus.extension.service.IService; import com.jilongda.manage.query.TInventoryQuery; import com.jilongda.manage.vo.TInventoryVO; /** * <p> @@ -13,4 +16,6 @@ */ public interface TInventoryService extends IService<TInventory> { PageInfo<TInventoryVO> pageList(TInventoryQuery query); } manage/src/main/java/com/jilongda/manage/service/TLensGoodsService.java
@@ -1,8 +1,12 @@ package com.jilongda.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TLensGoodsQuery; import com.jilongda.manage.vo.TLensGoodsVO; /** * <p> @@ -14,4 +18,6 @@ */ public interface TLensGoodsService extends IService<TLensGoods> { PageInfo<TLensGoodsVO> lensReceiptList(TLensGoodsQuery query); } manage/src/main/java/com/jilongda/manage/service/impl/TFrameGoodsServiceImpl.java
@@ -3,19 +3,25 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.mapper.SecSettingMapper; import com.jilongda.manage.mapper.TAppUserMapper; import com.jilongda.manage.mapper.TFrameGoodsMapper; import com.jilongda.manage.mapper.TOrderMapper; import com.jilongda.manage.model.SecSetting; import com.jilongda.manage.model.TAppUser; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TOrder; import com.jilongda.manage.query.TAppUserQuery; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.service.TAppUserService; import com.jilongda.manage.service.TFrameGoodsService; import com.jilongda.manage.vo.TAppUserVO; import com.jilongda.manage.vo.TFrameGoodsVO; import com.jilongda.manage.vo.TOptometryVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** @@ -30,4 +36,19 @@ public class TFrameGoodsServiceImpl extends ServiceImpl<TFrameGoodsMapper, TFrameGoods> implements TFrameGoodsService { @Resource private SecSettingMapper secSettingMapper; @Override public PageInfo<TFrameGoodsVO> lensReceiptList(TFrameGoodsQuery query) { PageInfo<TFrameGoodsVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<TFrameGoodsVO> list = this.baseMapper.lensReceiptList(query,pageInfo); SecSetting secSetting = secSettingMapper.selectOne(null); for (TFrameGoodsVO tFrameGoodsVO : list) { if (tFrameGoodsVO.getTotal()<secSetting.getFrameThreshold()){ tFrameGoodsVO.setIsWarning(1); } } pageInfo.setRecords(list); return pageInfo; } } manage/src/main/java/com/jilongda/manage/service/impl/TInventoryServiceImpl.java
@@ -1,10 +1,17 @@ package com.jilongda.manage.service.impl; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.model.SecSetting; import com.jilongda.manage.model.TInventory; import com.jilongda.manage.mapper.TInventoryMapper; import com.jilongda.manage.query.TInventoryQuery; import com.jilongda.manage.service.TInventoryService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jilongda.manage.vo.TInventoryVO; import com.jilongda.manage.vo.TLensGoodsVO; import org.springframework.stereotype.Service; import java.util.List; /** * <p> @@ -17,4 +24,11 @@ @Service public class TInventoryServiceImpl extends ServiceImpl<TInventoryMapper, TInventory> implements TInventoryService { @Override public PageInfo<TInventoryVO> pageList(TInventoryQuery query) { PageInfo<TInventoryVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<TInventoryVO> list = this.baseMapper.pageList(query, pageInfo); pageInfo.setRecords(list); return pageInfo; } } manage/src/main/java/com/jilongda/manage/service/impl/TLensGoodsServiceImpl.java
@@ -1,13 +1,23 @@ package com.jilongda.manage.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jilongda.common.basic.PageInfo; import com.jilongda.manage.mapper.SecSettingMapper; import com.jilongda.manage.mapper.TFrameGoodsMapper; import com.jilongda.manage.mapper.TLensGoodsMapper; import com.jilongda.manage.model.SecSetting; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TLensGoodsQuery; import com.jilongda.manage.service.TFrameGoodsService; import com.jilongda.manage.service.TLensGoodsService; import com.jilongda.manage.vo.TFrameGoodsVO; import com.jilongda.manage.vo.TLensGoodsVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -21,4 +31,19 @@ public class TLensGoodsServiceImpl extends ServiceImpl<TLensGoodsMapper, TLensGoods> implements TLensGoodsService { @Resource private SecSettingMapper secSettingMapper; @Override public PageInfo<TLensGoodsVO> lensReceiptList(TLensGoodsQuery query) { PageInfo<TLensGoodsVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<TLensGoodsVO> list = this.baseMapper.lensReceiptList(query, pageInfo); SecSetting secSetting = secSettingMapper.selectOne(null); for (TLensGoodsVO tFrameGoodsVO : list) { if (tFrameGoodsVO.getTotal() < secSetting.getLensThreshold()) { tFrameGoodsVO.setIsWarning(1); } } pageInfo.setRecords(list); return pageInfo; } } manage/src/main/java/com/jilongda/manage/vo/TFrameGoodsVO.java
New file @@ -0,0 +1,33 @@ package com.jilongda.manage.vo; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TFrameWarehousingDetail; import com.jilongda.manage.model.TWarehousing; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @Data @ApiModel(value = "镜架库存VO") public class TFrameGoodsVO extends TFrameGoods { @ApiModelProperty(value = "品牌名称") private String brand; @ApiModelProperty(value = "供应商名称") private String supplier; @ApiModelProperty(value = "材质名称") private String material; @ApiModelProperty(value = "型号名称") private String model; @ApiModelProperty(value = "单价/副") private String sales; @ApiModelProperty(value = "成本价/副") private String cost; @ApiModelProperty(value = "店铺名称") private String store; @ApiModelProperty(value = "是否低库存") private Integer isWarning; } manage/src/main/java/com/jilongda/manage/vo/TInventoryVO.java
New file @@ -0,0 +1,14 @@ package com.jilongda.manage.vo; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TInventory; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "盘点VO") public class TInventoryVO extends TInventory { @ApiModelProperty(value = "店铺名称") private String store; } manage/src/main/java/com/jilongda/manage/vo/TLensGoodsVO.java
New file @@ -0,0 +1,27 @@ package com.jilongda.manage.vo; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "镜片库存VO") public class TLensGoodsVO extends TLensGoods { @ApiModelProperty(value = "品牌名称") private String brand; @ApiModelProperty(value = "系列名称") private String series; @ApiModelProperty(value = "单价/片") private String sale; @ApiModelProperty(value = "成本/片") private String cost; @ApiModelProperty(value = "库存类型 1库存 2非库存") private Integer type; @ApiModelProperty(value = "是否低库存") private Integer isWarning; } manage/src/main/resources/mapping/TFrameGoods.xml
@@ -3,4 +3,48 @@ <mapper namespace="com.jilongda.manage.mapper.TFrameGoodsMapper"> <select id="lensReceiptList" resultType="com.jilongda.manage.vo.TFrameGoodsVO"> select t1.*,t2.name as model,t5.name as supplier,t3.name as material,t4.name as store, t2.sale as sale,t2.cost as cost,t6.name as brand,t7.frameThreshold from t_frame_goods t1 left join t_model t2 on t1.modelId=t2.id left join t_material t3 on t2.materialId = t3.id left join t_store t4 on t1.storeId = t4.id left join t_supplier t5 on t2.supplierId = t5.id left join t_brand t6 on t2.brandId=t6.id left join sec_setting t7 on 1=1 where 1=1 <if test="query.brandId != null "> and t2.brandId = #{query.brandId} </if> <if test="query.supplierId != null "> and t2.supplierId = #{query.supplierId} </if> <if test="query.color != null and query.color != ''"> and t1.color = #{query.color} </if> <if test="query.storeId != null "> and t1.storeId = #{query.storeId} </if> <if test="query.model != null and query.model != ''"> and t2.name = #{query.model} </if> <if test="query.materialId != null "> and t2.materialId = #{query.materialId} </if> <if test="query.status != null "> and t1.status = #{query.status} </if> <if test="query.isWarning != null and query.isWarning = 1"> and t1.total < t7.frameThreshold </if> <if test="query.isWarning != null and query.isWarning = 2"> and t1.total >= t7.frameThreshold </if> <if test="query.startCount != null and query.endCount != null"> and t1.total between #{query.startCount} and #{query.endCount} </if> order by t1.id </select> </mapper> manage/src/main/resources/mapping/TInventoryMapper.xml
@@ -20,5 +20,26 @@ <sql id="Base_Column_List"> id, status, type, storeId, remark, createTime, updateTime, createBy, updateBy, isDelete </sql> <select id="pageList" resultType="com.jilongda.manage.vo.TInventoryVO"> select t1.*,t2.name as store from t_inventory t1 left join t_store t2 on t1.storeId = t2.id where 1=1 <if test="query.status != null "> and t1.status = #{query.status} </if> <if test="query.createBy != null "> and t1.createBy = #{query.createBy} </if> <if test="query.type != null "> and t1.type = #{query.type} </if> <if test="query.storeId != null "> and t1.storeId = #{query.storeId} </if> <if test="query.startTime != null and query.startTime != ''"> and t1.createTime between #{query.startTime} and #{query.endTime} </if> </select> </mapper> manage/src/main/resources/mapping/TLensGoods.xml
@@ -3,4 +3,40 @@ <mapper namespace="com.jilongda.manage.mapper.TLensGoodsMapper"> <select id="lensReceiptList" resultType="com.jilongda.manage.vo.TLensGoodsVO"> select t1.*,t2.name as series,t4.name as store, t2.sale as sale,t2.cost as cost,t6.name as brand,t7.frameThreshold from t_lens_goods t1 left join t_lens_series t2 on t1.seriesId=t2.id left join t_store t4 on t1.storeId = t4.id left join t_brand t6 on t2.brandId=t6.id left join sec_setting t7 on 1=1 where 1=1 <if test="query.brandId != null "> and t2.brandId = #{query.brandId} </if> <if test="query.seriesId != null "> and t2.id = #{query.seriesId} </if> <if test="query.lensType != null "> and t1.lensType = #{query.lensType} </if> <if test="query.storeId != null "> and t1.storeId = #{query.storeId} </if> <if test="query.refractiveIndex != null and query.refractiveIndex != ''"> and t1.refractiveIndex = #{query.refractiveIndex} </if> <if test="query.type != null "> and t2.type = #{query.type} </if> <if test="query.isWarning != null and query.isWarning = 1"> and t1.total < t7.lensThreshold </if> <if test="query.isWarning != null and query.isWarning = 2"> and t1.total >= t7.lensThreshold </if> order by t1.id </select> </mapper>