| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.sales.dto.CustomerInteractionDto; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentExeclDto; |
| | |
| | | import com.ruoyi.sales.mapper.ReceiptPaymentMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceLedger; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.YearMonth; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class ReceiptPaymentServiceImpl extends ServiceImpl<ReceiptPaymentMapper,ReceiptPayment> implements ReceiptPaymentService { |
| | |
| | | |
| | | @Autowired |
| | | private AccountIncomeService accountIncomeService; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | /** |
| | | * 回款登记新增 |
| | |
| | | accountIncome.setIncomeMoney(receiptPayment.getReceiptPaymentAmount()); |
| | | accountIncome.setIncomeMethod("0"); |
| | | accountIncome.setInputTime(new Date()); |
| | | accountIncome.setInputUser(salesLedger.getEntryPerson()); |
| | | String entryPerson = salesLedger.getEntryPerson(); |
| | | if (StringUtils.isEmpty(entryPerson) || !StringUtils.isNumeric(entryPerson)) { |
| | | throw new ServiceException("回款登记失败,销售台账录入人不能为空"); |
| | | } |
| | | SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(entryPerson)); |
| | | if (sysUser == null) { |
| | | throw new ServiceException("回款登记失败,销售台账录入人不存在"); |
| | | } |
| | | accountIncome.setInputUser(sysUser.getNickName()); |
| | | accountIncome.setIncomeDescribed("回款收入"); |
| | | accountIncome.setBusinessId(Long.parseLong(receiptPayment.getId().toString())); |
| | | accountIncome.setBusinessType(1); |