package com.changhong.epc.admin.service.account.impl;
|
|
import com.changhong.epc.admin.mapper.centen.account.AccountMapper;
|
import com.changhong.epc.admin.mapper.centen.asset.AssetDepreciationMapper;
|
import com.changhong.epc.admin.service.account.AccountService;
|
import com.changhong.epc.bean.admin.Account;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
import java.util.Objects;
|
|
@Service
|
public class AccountServiceImpl implements AccountService {
|
|
@Resource
|
private AccountMapper accountMapper;
|
|
@Resource
|
private AssetDepreciationMapper assetDepreciationMapper;
|
|
@Override
|
public List<Account> selectByDataStart() {
|
return accountMapper.selectByDataStart();
|
}
|
|
@Override
|
public int addAccount(Account li) {
|
return accountMapper.insert(li);
|
|
}
|
|
@Override
|
public int updateState(Account account) {
|
return Objects.nonNull(account.getId()) ? accountMapper.updateState(account) : -1;
|
}
|
|
@Override
|
public Account selectAccount(String orderCode) {
|
// System.out.println("code参数:"+orderCode);
|
return accountMapper.selectOneAccount(orderCode);
|
|
}
|
|
@Override
|
public int repetitionAccount(Account account) {
|
return accountMapper.repetitionAccount(account);
|
}
|
|
@Override
|
public Integer updateVoucherCode(Account account) {
|
if(account.getFlag()) {
|
//通用修改回写
|
return accountMapper.updateVoucherCode(account.getVoucherCode(), account.getOrderCode());
|
}else{
|
//固定资产回写
|
return assetDepreciationMapper.updateVoucherCode(account.getVoucherCode(), account.getOrderCode());
|
}
|
}
|
|
@Override
|
public int delete(Account account) {
|
Account p = new Account();
|
p.setId(account.getId());
|
return accountMapper.delete(p);
|
}
|
}
|