无关风月
2024-12-20 6dd0a9a11ca7ff6f71c195d8187d138e28115f2a
代码
6个文件已修改
1个文件已添加
64 ■■■■■ 已修改文件
manage/src/main/java/com/jilongda/manage/controller/TInventoryController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/dto/FrameInventoryDTO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/model/TInventoryFrameDetail.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/service/impl/TLensSeriesServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/vo/TLensSeriesVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/vo/TWarehousingLensVO.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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();
    }
}
manage/src/main/java/com/jilongda/manage/dto/FrameInventoryDTO.java
New file
@@ -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;
}
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;
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;
    }
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;
}
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;
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>