| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.MaterialProductHistoryMapper; |
| | | import com.whyc.pojo.MaterialProductApproving; |
| | | import com.whyc.pojo.MaterialProductHistory; |
| | | import com.whyc.pojo.ProductBom; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | mapper.insertBatchSomeColumn(newHistoryList); |
| | | } |
| | | |
| | | public List<MaterialProductHistory> getLatestExistListByMaterialId(Integer MaterialId) { |
| | | return mapper.getLatestExistListByMaterialId(MaterialId); |
| | | public List<MaterialProductHistory> getLatestExistListByMaterialId(Integer materialId) { |
| | | return mapper.getLatestExistListByMaterialId(materialId); |
| | | } |
| | | |
| | | /** |
| | | * 解除关联: |
| | | * 终止版本-1即可 |
| | | * @param removedList 解除关联列表 |
| | | */ |
| | | public void updateVersionSubtractBatch(List<MaterialProductApproving> removedList) { |
| | | mapper.updateVersionSubtractBatch(removedList); |
| | | } |
| | | |
| | | public List<MaterialProductHistory> getListByParentCodeAndCustomCodeAndVersion(String parentCode, String customCode, Integer version) { |
| | | QueryWrapper<MaterialProductHistory> query = Wrappers.query(); |
| | | query.eq("parent_code",parentCode).eq("custom_code",customCode) |
| | | .le("s_version",version) |
| | | .ge("e_version",version); |
| | | return mapper.selectList(query); |
| | | } |
| | | |
| | | public List<MaterialProductHistory> getListWithMaterialInfo(List<MaterialProductHistory> mpList) { |
| | | return mapper.getListWithMaterialInfo(mpList); |
| | | } |
| | | |
| | | public List<MaterialProductHistory> getListByParentCodeAndCustomCodeAndSubMaterialIdAndVersion(String parentCode, String customCode, List<ProductBom> bomList, int currentVersion) { |
| | | return mapper.getListByParentCodeAndCustomCodeAndSubMaterialIdAndVersion(parentCode,customCode,bomList,currentVersion); |
| | | } |
| | | } |