二级入库回调web端的处理逻辑修改

master
liuqingkun 2 months ago
parent e8ba1390cc
commit c3b549da11
  1. 1
      src/main/java/com/nov/KgLowDurable/mapper/LdConsumerFormMapper.java
  2. 3
      src/main/java/com/nov/KgLowDurable/mapper/LdDurableFormMapper.java
  3. 1
      src/main/java/com/nov/KgLowDurable/service/ILdConsumerFormService.java
  4. 3
      src/main/java/com/nov/KgLowDurable/service/ILdDurableFormService.java
  5. 5
      src/main/java/com/nov/KgLowDurable/service/Impl/LdConsumerFormServiceImpl.java
  6. 6
      src/main/java/com/nov/KgLowDurable/service/Impl/LdDurableFormServiceImpl.java
  7. 13
      src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoInventoryRecordServiceImpl.java
  8. 3
      src/main/resources/mapper/LdConsumerFormMapper.xml
  9. 3
      src/main/resources/mapper/LdDurableFormMapper.xml

@ -14,6 +14,7 @@ public interface LdConsumerFormMapper extends BaseMapper<LdConsumerForm> {
LdConsumerForm selectByMaterialId(@Param("materialId") Long materialId, @Param("demandDepartment") String demandDepartment);
LdConsumerForm selectByMaterialCode(@Param("materialCode") String materialCode);
List<LdConsumerForm> selectByDepartmentId(@Param("departmentId") String departmentId);

@ -1,5 +1,6 @@
package com.nov.KgLowDurable.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nov.KgLowDurable.pojo.entity.LdConsumerForm;
import com.nov.KgLowDurable.pojo.entity.LdDurableForm;
import com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO;
import org.apache.ibatis.annotations.Param;
@ -16,6 +17,6 @@ public interface LdDurableFormMapper extends BaseMapper<LdDurableForm> {
List<LdDurableForm> selectDurableFormList(@Param("departmentId") String departmentId, @Param("materialName") String materialName, @Param("num") Integer num);
List<LdDurableForm> selectByMaterialId(@Param("materialId") Long materialId, @Param("departmentId") String departmentId);
LdDurableForm selectByMaterialCode(@Param("materialCode") String materialCode);
List<LdTwoInventoryVO> selectByIds(@Param("durableIds") List<Long> durableIds);
}

@ -21,6 +21,7 @@ public interface ILdConsumerFormService extends IService<LdConsumerForm> {
* @return
*/
LdConsumerForm getByMaterialId(Long materialId, String demandDepartment);
LdConsumerForm getByMaterialCode(String materialCode);
/**
* 获取二级出库物资列表

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.nov.KgLowDurable.pojo.dto.LdDurableFormDto;
import com.nov.KgLowDurable.pojo.entity.LdDurableForm;
import com.nov.KgLowDurable.pojo.entity.LdTwoInventoryRecord;
import com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO;
import java.util.List;
@ -41,6 +42,8 @@ public interface ILdDurableFormService extends IService<LdDurableForm> {
*/
List<LdDurableForm> getByMaterialId(Long materialId, String departmentId);
LdDurableForm getByMaterialCode(String materialCode);
/**
* 根据IDS 擦汗讯
* @param durableIds

@ -42,6 +42,11 @@ public class LdConsumerFormServiceImpl extends ServiceImpl<LdConsumerFormMapper,
return consumerFormMapper.selectByMaterialId(materialId,demandDepartment);
}
@Override
public LdConsumerForm getByMaterialCode(String materialCode) {
return consumerFormMapper.selectByMaterialCode(materialCode);
}
@Override
public List<LdConsumerForm> getConsumerFormByDeptId(String departmentId) {
return consumerFormMapper.selectByDepartmentId(departmentId);

@ -7,6 +7,7 @@ import com.nov.KgLowDurable.exception.CustomerException;
import com.nov.KgLowDurable.mapper.LdDurableFormMapper;
import com.nov.KgLowDurable.pojo.dto.LdDurableFormDto;
import com.nov.KgLowDurable.pojo.entity.LdDurableForm;
import com.nov.KgLowDurable.pojo.entity.LdTwoInventoryRecord;
import com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO;
import com.nov.KgLowDurable.service.ILdDurableFormService;
import lombok.AllArgsConstructor;
@ -63,6 +64,11 @@ public class LdDurableFormServiceImpl extends ServiceImpl<LdDurableFormMapper, L
return durableFormMapper.selectByMaterialId(materialId,departmentId);
}
@Override
public LdDurableForm getByMaterialCode(String materialCode) {
return durableFormMapper.selectByMaterialCode(materialCode);
}
@Override
public List<LdTwoInventoryVO> getByIds(List<Long> durableIds) {
return durableFormMapper.selectByIds(durableIds);

@ -1,27 +1,20 @@
package com.nov.KgLowDurable.service.Impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nov.KgLowDurable.constant.BatchConstant;
import com.nov.KgLowDurable.exception.CustomerException;
import com.nov.KgLowDurable.mapper.LdInventoryRecordMapper;
import com.nov.KgLowDurable.mapper.LdTwoInventoryRecordMapper;
import com.nov.KgLowDurable.pojo.dto.ApproveDto;
import com.nov.KgLowDurable.pojo.entity.*;
import com.nov.KgLowDurable.service.*;
import com.nov.KgLowDurable.util.Func;
import com.nov.KgLowDurable.util.StringUtils;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Wrapper;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -137,7 +130,7 @@ public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryR
ldErstockOutService.updateById(ldErstockOut);
}
List<LdErstockOutForm> outFormList = ldErstockOutFromService.listByOutId(approveDto.getTwoOutStorageId());
List<LdErstockOutForm> outFormList = ldErstockOutFromService.listByOutId(ldErstockOut.getId());
for (LdErstockOutForm ldErstockOutForm : outFormList) {
// 物资编码
String code = "";
@ -148,7 +141,7 @@ public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryR
if (BatchConstant.CONSUMER.equals(code)) {
// 获取二级库存
LdConsumerForm consumerForm = consumerFormService.getById(ldErstockOutForm.getStockId());
LdConsumerForm consumerForm = consumerFormService.getByMaterialCode(ldErstockOutForm.getStockId());
BigDecimal num = new BigDecimal(ldErstockOutForm.getNum());
//计算差值
BigDecimal difference = consumerForm.getNum().subtract(num);
@ -172,7 +165,7 @@ public class LdTwoInventoryRecordServiceImpl extends ServiceImpl<LdTwoInventoryR
throw new CustomerException("出库记录保存失败");
}
} else {
LdDurableForm durableForm = durableFormService.getById(ldErstockOutForm.getStockId());
LdDurableForm durableForm = durableFormService.getByMaterialCode(ldErstockOutForm.getStockId());
durableForm.setIsBorrow(BatchConstant.LEND);
durableForm.setNum(new BigDecimal(0));
boolean updateDurableForm = durableFormService.updateById(durableForm);

@ -23,6 +23,9 @@
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm">
select * from ld_consumer_form where material_id = #{materialId} and department_id = #{demandDepartment}
</select>
<select id="selectByMaterialCode" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm">
select * from ld_consumer_form where material_code = #{materialCode}
</select>
<select id="selectByDepartmentId" resultType="com.nov.KgLowDurable.pojo.entity.LdConsumerForm">
select * from ld_consumer_form where department_id = #{departmentId}
</select>

@ -37,6 +37,9 @@
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdDurableForm">
select * from ld_durable_form where material_id = #{materialId} and department_id =#{departmentId}
</select>
<select id="selectByMaterialCode" resultType="com.nov.KgLowDurable.pojo.entity.LdDurableForm">
select * from ld_durable_form where material_code = #{materialCode}
</select>
<select id="selectByIds" resultType="com.nov.KgLowDurable.pojo.vo.LdTwoInventoryVO">
select * from ld_durable_form where id in
<foreach collection="durableIds" item="id" open="(" separator="," close=")">

Loading…
Cancel
Save