manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
manage/src/main/java/com/jilongda/manage/mapper/TLensGoodsMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
manage/src/main/java/com/jilongda/manage/model/TLensGoods.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
manage/src/main/java/com/jilongda/manage/service/TLensGoodsService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
manage/src/main/java/com/jilongda/manage/service/impl/TLensGoodsServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
manage/src/main/resources/mapping/TLensGoods.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java
@@ -10,16 +10,10 @@ import com.jilongda.common.utils.CodeGenerateUtils; import com.jilongda.manage.dto.TWarehousingDTO; import com.jilongda.manage.dto.TWarehousingLensDTO; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TFrameWarehousingDetail; import com.jilongda.manage.model.TLensWarehousingDetail; import com.jilongda.manage.model.TWarehousing; import com.jilongda.manage.model.*; import com.jilongda.manage.query.TWarehousingDetailLensQuery; import com.jilongda.manage.query.TWarehousingDetailQuery; import com.jilongda.manage.service.TFrameGoodsService; import com.jilongda.manage.service.TFrameWarehousingDetailService; import com.jilongda.manage.service.TLensWarehousingDetailService; import com.jilongda.manage.service.TWarehousingService; import com.jilongda.manage.service.*; import com.jilongda.manage.vo.TFrameWarehousingDetailVO; import com.jilongda.manage.vo.TLensWarehousingDetailVO; import com.jilongda.manage.vo.TWarehousingLensVO; @@ -56,6 +50,8 @@ private TLensWarehousingDetailService lensWarehousingDetailService; @Autowired private TFrameGoodsService frameGoodsService; @Autowired private TLensGoodsService lensGoodsService; /** * 出入库单列表 @@ -168,6 +164,50 @@ 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::getBallMirror, frameWarehousingDetail.getBallMirror()) .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) .one(); if (one!=null){ // 减少对应库存 one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); list1.add(one); } } if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); } if (dto.getStatus()==2 || dto.getStatus()==4){ List<TLensGoods> list1 = new ArrayList<>(); List<TLensGoods> list2 = new ArrayList<>(); for (TLensWarehousingDetail frameWarehousingDetail : frameWarehousingDetails) { TLensGoods one = lensGoodsService.lambdaQuery().eq(TLensGoods::getSeriesId, frameWarehousingDetail.getSeriesId()) .eq(TLensGoods::getRefractiveIndex, frameWarehousingDetail.getRefractiveIndex()) .eq(TLensGoods::getBallMirror, frameWarehousingDetail.getBallMirror()) .eq(TLensGoods::getColumnMirror, frameWarehousingDetail.getColumnMirror()) .one(); if (one!=null){ // 增加对应库存 one.setTotal(one.getTotal()+frameWarehousingDetail.getTotal()); list1.add(one); }else { // 新增 TLensGoods tFrameGoods = new TLensGoods(); tFrameGoods.setSeriesId(frameWarehousingDetail.getSeriesId()); tFrameGoods.setBallMirror(frameWarehousingDetail.getBallMirror()); tFrameGoods.setColumnMirror(frameWarehousingDetail.getColumnMirror()); tFrameGoods.setRefractiveIndex(frameWarehousingDetail.getRefractiveIndex()); tFrameGoods.setTotal(frameWarehousingDetail.getTotal()); tFrameGoods.setStoreId(dto.getStoreId()); list2.add(tFrameGoods); } } if (!list1.isEmpty())lensGoodsService.updateBatchById(list1); if (!list2.isEmpty())lensGoodsService.saveBatch(list2); } return ApiResult.success(); } manage/src/main/java/com/jilongda/manage/mapper/TLensGoodsMapper.java
New file @@ -0,0 +1,18 @@ package com.jilongda.manage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; /** * <p> * 用户表 Mapper 接口 * </p> * * @author 无关风月 * @since 2024-12-09 */ public interface TLensGoodsMapper extends BaseMapper<TLensGoods> { } manage/src/main/java/com/jilongda/manage/model/TLensGoods.java
New file @@ -0,0 +1,49 @@ package com.jilongda.manage.model; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.jilongda.common.pojo.BaseModel; 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("t_lens_goods") @ApiModel(value="TLensGoods对象", description="用户表") public class TLensGoods extends BaseModel { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键id") @TableId(value = "id", type = IdType.AUTO) private Integer id; @ApiModelProperty(value = "系列id") @TableField("seriesId") private Integer seriesId; @ApiModelProperty(value = "球镜") @TableField("ballMirror") private String ballMirror; @ApiModelProperty(value = "柱镜") @TableField("columnMirror") private String columnMirror; @ApiModelProperty(value = "折射率") @TableField("refractiveIndex") private String refractiveIndex; @ApiModelProperty(value = "库存") @TableField("total") private Integer total; @ApiModelProperty(value = "门店id") @TableField("storeId") private Integer storeId; } manage/src/main/java/com/jilongda/manage/service/TLensGoodsService.java
New file @@ -0,0 +1,17 @@ package com.jilongda.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; /** * <p> * 用户表 服务类 * </p> * * @author 无关风月 * @since 2024-12-09 */ public interface TLensGoodsService extends IService<TLensGoods> { } manage/src/main/java/com/jilongda/manage/service/impl/TLensGoodsServiceImpl.java
New file @@ -0,0 +1,24 @@ package com.jilongda.manage.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jilongda.manage.mapper.TFrameGoodsMapper; import com.jilongda.manage.mapper.TLensGoodsMapper; import com.jilongda.manage.model.TFrameGoods; import com.jilongda.manage.model.TLensGoods; import com.jilongda.manage.service.TFrameGoodsService; import com.jilongda.manage.service.TLensGoodsService; import org.springframework.stereotype.Service; /** * <p> * 用户表 服务实现类 * </p> * * @author 无关风月 * @since 2024-12-09 */ @Service public class TLensGoodsServiceImpl extends ServiceImpl<TLensGoodsMapper, TLensGoods> implements TLensGoodsService { } manage/src/main/resources/mapping/TLensGoods.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.jilongda.manage.mapper.TLensGoodsMapper"> </mapper>