From 6dd0a9a11ca7ff6f71c195d8187d138e28115f2a Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 20 十二月 2024 14:40:02 +0800 Subject: [PATCH] 代码 --- manage/src/main/java/com/jilongda/manage/dto/FrameInventoryDTO.java | 20 ++++++++++ manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java | 2 manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml | 2 manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java | 25 ++++++++++++ manage/src/main/java/com/jilongda/manage/service/impl/TLensSeriesServiceImpl.java | 9 ++++ manage/src/main/java/com/jilongda/manage/vo/TLensSeriesVO.java | 2 + manage/src/main/java/com/jilongda/manage/vo/TWarehousingLensVO.java | 4 + 7 files changed, 61 insertions(+), 3 deletions(-) diff --git a/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java b/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java index e827e60..2c0f5e8 100644 --- a/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java +++ b/manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java @@ -3,6 +3,9 @@ import com.jilongda.common.basic.ApiResult; import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.dto.FrameInventoryDTO; +import com.jilongda.manage.model.TInventory; +import com.jilongda.manage.model.TInventoryFrameDetail; import com.jilongda.manage.query.TFrameGoodsQuery; import com.jilongda.manage.query.TInventoryQuery; import com.jilongda.manage.service.TInventoryFrameDetailService; @@ -13,6 +16,7 @@ import com.jilongda.manage.vo.TInventoryVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -52,5 +56,26 @@ } return ApiResult.success(inventoryService.pageList(query)); } + @ApiOperation(value = "镜架添加盘点") + @PostMapping(value = "/addFrameInventory") + public ApiResult<PageInfo<TInventoryVO>> addFrameInventory(@RequestBody TInventoryQuery query) { + if (StringUtils.hasLength(query.getStartTime())){ + query.setStartTime(query.getStartTime()+" 00:00:00"); + query.setEndTime(query.getEndTime()+" 23:59:59"); + } + return ApiResult.success(inventoryService.pageList(query)); + } + @ApiOperation(value = "镜片添加盘点") + @PostMapping(value = "/addLensInventory") + public ApiResult addLensInventory(@RequestBody FrameInventoryDTO query) { + TInventory tInventory = new TInventory(); + BeanUtils.copyProperties(query, tInventory); + inventoryService.save(tInventory); + for (TInventoryFrameDetail tInventoryFrameDetail : query.getList()) { + tInventoryFrameDetail.setInventoryId(tInventory.getId()); + } + inventoryFrameDetailService.saveBatch(query.getList()); + return ApiResult.success(); + } } diff --git a/manage/src/main/java/com/jilongda/manage/dto/FrameInventoryDTO.java b/manage/src/main/java/com/jilongda/manage/dto/FrameInventoryDTO.java new file mode 100644 index 0000000..ff1de09 --- /dev/null +++ b/manage/src/main/java/com/jilongda/manage/dto/FrameInventoryDTO.java @@ -0,0 +1,20 @@ +package com.jilongda.manage.dto; + +import com.jilongda.manage.model.TInventory; +import com.jilongda.manage.model.TInventoryFrameDetail; +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 FrameInventoryDTO extends TInventory { + + @ApiModelProperty(value = "镜架明细") + private List<TInventoryFrameDetail> list; + +} 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 2235f9d..2830b4d 100644 --- a/manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java +++ b/manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java @@ -33,7 +33,7 @@ @TableId(value = "id", type = IdType.AUTO) private Integer id; - @ApiModelProperty(value = "盘点表id") + @ApiModelProperty(value = "盘点表id 前端忽略") @TableField("inventoryId") private Integer inventoryId; diff --git a/manage/src/main/java/com/jilongda/manage/service/impl/TLensSeriesServiceImpl.java b/manage/src/main/java/com/jilongda/manage/service/impl/TLensSeriesServiceImpl.java index 2f72a63..0b25a2b 100644 --- a/manage/src/main/java/com/jilongda/manage/service/impl/TLensSeriesServiceImpl.java +++ b/manage/src/main/java/com/jilongda/manage/service/impl/TLensSeriesServiceImpl.java @@ -1,8 +1,10 @@ package com.jilongda.manage.service.impl; import com.jilongda.common.basic.PageInfo; +import com.jilongda.manage.mapper.TSupplierMapper; import com.jilongda.manage.model.TLensSeries; import com.jilongda.manage.mapper.TLensSeriesMapper; +import com.jilongda.manage.model.TSupplier; import com.jilongda.manage.query.TLensSeriesQuery; import com.jilongda.manage.service.TLensSeriesService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -10,6 +12,7 @@ import com.jilongda.manage.vo.TOptometristVO; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; /** @@ -23,10 +26,16 @@ @Service public class TLensSeriesServiceImpl extends ServiceImpl<TLensSeriesMapper, TLensSeries> implements TLensSeriesService { + @Resource + private TSupplierMapper supplierMapper; @Override public PageInfo<TLensSeriesVO> pageList(TLensSeriesQuery query) { PageInfo<TLensSeriesVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List<TLensSeriesVO> list = this.baseMapper.pageList(query,pageInfo); + for (TLensSeriesVO tLensSeriesVO : list) { + TSupplier tSupplier = supplierMapper.selectById(tLensSeriesVO.getSupplierId()); + if (tSupplier!=null)tLensSeriesVO.setSupplier(tSupplier.getName()); + } pageInfo.setRecords(list); return pageInfo; } diff --git a/manage/src/main/java/com/jilongda/manage/vo/TLensSeriesVO.java b/manage/src/main/java/com/jilongda/manage/vo/TLensSeriesVO.java index a2654fe..d81cd18 100644 --- a/manage/src/main/java/com/jilongda/manage/vo/TLensSeriesVO.java +++ b/manage/src/main/java/com/jilongda/manage/vo/TLensSeriesVO.java @@ -16,5 +16,7 @@ private String typeName; @ApiModelProperty(value = "折射率") private String refractiveIndex; + @ApiModelProperty(value = "供应商名称") + private String supplier; } diff --git a/manage/src/main/java/com/jilongda/manage/vo/TWarehousingLensVO.java b/manage/src/main/java/com/jilongda/manage/vo/TWarehousingLensVO.java index 208014c..42acded 100644 --- a/manage/src/main/java/com/jilongda/manage/vo/TWarehousingLensVO.java +++ b/manage/src/main/java/com/jilongda/manage/vo/TWarehousingLensVO.java @@ -10,11 +10,13 @@ import java.util.List; @Data -@ApiModel(value = "镜架/镜片出库入库VO") +@ApiModel(value = "镜片出库入库VO") public class TWarehousingLensVO extends TWarehousing { @ApiModelProperty(value = "出库/入库合计数量") private Integer totalNum=0; + @ApiModelProperty(value = "门店名称") + private String storeName; @ApiModelProperty(value = "出库/入库明细") private List<TLensWarehousingDetail> lensWarehousingDetails; diff --git a/manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml b/manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml index 809d55b..712a06c 100644 --- a/manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml +++ b/manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml @@ -28,7 +28,7 @@ </sql> <select id="pageLensList" resultType="com.jilongda.manage.vo.TLensWarehousingDetailVO"> select tlwd.id, tlwd.warehousingId, tlwd.brand, tlwd.supplier, tlwd.series, tlwd.total, tlwd.refractiveIndex, tlwd.ballMirror, tlwd.code, tlwd.createTime,tlwd.columnMirror, - tlwd.updateTime, tlwd.createBy, tlwd.updateBy, tlwd.isDelete, tlwd.modelId, tlwd.type + tlwd.updateTime, tlwd.createBy, tlwd.updateBy, tlwd.isDelete, tlwd.type from t_lens_warehousing_detail tlwd left join t_warehousing tw on tlwd.warehousingId = tw.id <where> -- Gitblit v1.7.1