|
|
|
@ -16,6 +16,7 @@ import com.nov.KgLowDurable.pojo.vo.*; |
|
|
|
import com.nov.KgLowDurable.service.*; |
|
|
|
import com.nov.KgLowDurable.service.*; |
|
|
|
import com.nov.KgLowDurable.util.SerialNumberUtil; |
|
|
|
import com.nov.KgLowDurable.util.SerialNumberUtil; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -31,6 +32,7 @@ import java.util.stream.Collectors; |
|
|
|
* 服务实现类 |
|
|
|
* 服务实现类 |
|
|
|
* @author liweidong |
|
|
|
* @author liweidong |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
@AllArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
public class LdTwoOutStorageServiceImpl extends ServiceImpl<LdTwoOutStorageMapper, LdTwoOutStorage> implements ILdTwoOutStorageService { |
|
|
|
public class LdTwoOutStorageServiceImpl extends ServiceImpl<LdTwoOutStorageMapper, LdTwoOutStorage> implements ILdTwoOutStorageService { |
|
|
|
@ -112,13 +114,14 @@ public class LdTwoOutStorageServiceImpl extends ServiceImpl<LdTwoOutStorageMappe |
|
|
|
ldTwoOutStorageDetail.setOptTime(new Date()); |
|
|
|
ldTwoOutStorageDetail.setOptTime(new Date()); |
|
|
|
//处理剩余库存
|
|
|
|
//处理剩余库存
|
|
|
|
BigDecimal num = null; |
|
|
|
BigDecimal num = null; |
|
|
|
if(BatchConstant.CONSUMER.equals(ldTwoOutStorageDetail.getType())){ |
|
|
|
if (BatchConstant.CONSUMER.equals(ldTwoOutStorageDetail.getType())) { |
|
|
|
LdConsumerForm consumerForm = consumerFormService.getById(ldTwoOutStorageDetail.getTwoInventoryId()); |
|
|
|
LdConsumerForm consumerForm = consumerFormService.getById(ldTwoOutStorageDetail.getTwoInventoryId()); |
|
|
|
num = consumerForm.getNum(); |
|
|
|
num = consumerForm.getNum(); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
LdDurableForm durableForm = durableFormService.getById(ldTwoOutStorageDetail.getTwoInventoryId()); |
|
|
|
LdDurableForm durableForm = durableFormService.getById(ldTwoOutStorageDetail.getTwoInventoryId()); |
|
|
|
num = durableForm.getNum(); |
|
|
|
num = durableForm.getNum(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal result = num.subtract(ldTwoOutStorageDetail.getNum()); |
|
|
|
BigDecimal result = num.subtract(ldTwoOutStorageDetail.getNum()); |
|
|
|
ldTwoOutStorageDetail.setResidueNum(result); |
|
|
|
ldTwoOutStorageDetail.setResidueNum(result); |
|
|
|
|
|
|
|
|
|
|
|
@ -131,9 +134,10 @@ public class LdTwoOutStorageServiceImpl extends ServiceImpl<LdTwoOutStorageMappe |
|
|
|
|
|
|
|
|
|
|
|
//获取审批人
|
|
|
|
//获取审批人
|
|
|
|
try { |
|
|
|
try { |
|
|
|
boolean approver = userService.getApprover(ldTwoOutStorage.getDepartmentId(), |
|
|
|
String approvers = userService.getApprover(ldTwoOutStorage.getDepartmentId(), |
|
|
|
"1", ldTwoOutStorage.getId()); |
|
|
|
"1", ldTwoOutStorage.getId()); |
|
|
|
|
|
|
|
ldTwoOutStorage.setApprovers(approvers); |
|
|
|
|
|
|
|
twoOutStorageMapper.updateById(ldTwoOutStorage); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
throw new CustomerException("获取审批人失败: " + e.getMessage()); |
|
|
|
throw new CustomerException("获取审批人失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -174,7 +178,8 @@ public class LdTwoOutStorageServiceImpl extends ServiceImpl<LdTwoOutStorageMappe |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXT_RECEIVER, Value.textValue(dto.getLdTwoOutStorage().getProposerName())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXT_RECEIVER, Value.textValue(dto.getLdTwoOutStorage().getProposerName())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXT_DEPARTMENT, Value.textValue(dto.getLdTwoOutStorage().getDepartment())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXT_DEPARTMENT, Value.textValue(dto.getLdTwoOutStorage().getDepartment())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXT_ORDER_NO, Value.textValue(dto.getLdTwoOutStorage().getOrderNo())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXT_ORDER_NO, Value.textValue(dto.getLdTwoOutStorage().getOrderNo())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.OUT_GROUP, Value.textValue(dto.getLdTwoOutStorage().getGroupName().equals("自由出库") ? null : dto.getLdTwoOutStorage().getGroupName())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.OUT_GROUP, Value.textValue("自由出库".equals(dto.getLdTwoOutStorage().getGroupName()) ? null : |
|
|
|
|
|
|
|
dto.getLdTwoOutStorage().getGroupName())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXTAREA_REASON, Value.textValue(dto.getLdTwoOutStorage().getReason())), |
|
|
|
new Content(TwoOutApproverConstant.TEXT, TwoOutApproverConstant.TEXTAREA_REASON, Value.textValue(dto.getLdTwoOutStorage().getReason())), |
|
|
|
new Content(TwoOutApproverConstant.TABLE, TwoOutApproverConstant.TABLE_MATERIAL_LIST, |
|
|
|
new Content(TwoOutApproverConstant.TABLE, TwoOutApproverConstant.TABLE_MATERIAL_LIST, |
|
|
|
Value.tableValue(tableRowList)) |
|
|
|
Value.tableValue(tableRowList)) |
|
|
|
|