123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package com.steerinfo.dil.service.impl;
- import com.steerinfo.dil.mapper.TmstruckReceiveResultMapper;
- import com.steerinfo.dil.model.TmstruckReceiptResult;
- import com.steerinfo.dil.model.TmstruckReceiveResult;
- import com.steerinfo.dil.service.ITmstruckReceiveResultService;
- import com.steerinfo.framework.mapper.IBaseMapper;
- import com.steerinfo.framework.service.impl.BaseServiceImpl;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.math.BigDecimal;
- /**
- * TmstruckReceiveResult服务实现:
- * @author generator
- * @version 1.0-SNAPSHORT 2022-03-29 06:27
- * 类描述
- * 修订历史:
- * 日期:2022-03-29
- * 作者:generator
- * 参考:
- * 描述:TmstruckReceiveResult服务实现
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @Service(value = "tmstruckReceiveResultService")
- public class TmstruckReceiveResultServiceImpl{
- @Autowired
- private TmstruckReceiveResultMapper tmstruckReceiveResultMapper;
- /**
- * 新增一条虚拟收货实绩
- * @param {resultTotalId:总实绩ID}
- * @return
- */
- public int addReceiveResult(BigDecimal resultTotalId){
- //根据总实绩ID查询收货实绩查看是否已收货
- BigDecimal receiveResult = tmstruckReceiveResultMapper.getReceiveResult(resultTotalId);
- if(receiveResult != null){
- return 0;
- }
- //新增完卸车实绩后新增一条收货实绩
- TmstruckReceiveResult tmstruckReceiveResult = new TmstruckReceiveResult();
- tmstruckReceiveResult.setId(tmstruckReceiveResultMapper.selectMaxId());//添加主键
- tmstruckReceiveResult.setResultTotalId(resultTotalId);//添加总实绩Id
- tmstruckReceiveResult.setStatus(new BigDecimal(0)); // 卸货完成后添加的为虚拟收货实绩
- return tmstruckReceiveResultMapper.insertSelective(tmstruckReceiveResult);
- }
- }
|