|
@@ -0,0 +1,83 @@
|
|
|
|
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
|
|
+import com.yh.saas.common.support.util.IdGenerator;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.CustomerInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.InventoryCostInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.SaleOrder;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.mapper.InventoryCostInfoMapper;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IInventoryCostInfoService;
|
|
|
|
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * <p>
|
|
|
|
+ * 库点费用信息 服务实现类
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @author Gdc
|
|
|
|
+ * @since 2021-10-08
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class InventoryCostInfoServiceImpl extends ServiceImpl<InventoryCostInfoMapper, InventoryCostInfo> implements IInventoryCostInfoService {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 列表
|
|
|
|
+ *
|
|
|
|
+ * @param inventoryCostInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public Page<InventoryCostInfo> selectInventoryCostInfo(InventoryCostInfo inventoryCostInfo) {
|
|
|
|
+ Page<InventoryCostInfo> inventoryCostInfoPage = this.selectPage(inventoryCostInfo.getQueryPage(), new EntityWrapper<InventoryCostInfo>()
|
|
|
|
+ .eq("warehouse_id", inventoryCostInfo.getWarehouseId())
|
|
|
|
+ .eq("cost_date", inventoryCostInfo.getYear()));
|
|
|
|
+ int count = this.selectCount( new EntityWrapper<InventoryCostInfo>()
|
|
|
|
+ .eq("warehouse_id", inventoryCostInfo.getWarehouseId())
|
|
|
|
+ .eq("cost_date", inventoryCostInfo.getYear()));
|
|
|
|
+ inventoryCostInfoPage.setSize(count);
|
|
|
|
+ return inventoryCostInfoPage;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 添加信息
|
|
|
|
+ *
|
|
|
|
+ * @param inventoryCostInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String addInventoryCostInfo(InventoryCostInfo inventoryCostInfo) {
|
|
|
|
+ //新增主键id
|
|
|
|
+ inventoryCostInfo.setId(IdGenerator.generateUUID());
|
|
|
|
+ // 操作主表数据
|
|
|
|
+ boolean one = this.insert(inventoryCostInfo);
|
|
|
|
+ if (one) {
|
|
|
|
+ return "OK";
|
|
|
|
+ } else {
|
|
|
|
+ return "NG";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 编辑信息
|
|
|
|
+ *
|
|
|
|
+ * @param inventoryCostInfo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String editInventoryCostInfo(InventoryCostInfo inventoryCostInfo) {
|
|
|
|
+ boolean one = this.updateById(inventoryCostInfo);
|
|
|
|
+ if (one) {
|
|
|
|
+ return "OK";
|
|
|
|
+ } else {
|
|
|
|
+ return "NG";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|