|
@@ -21,6 +21,10 @@ import com.ruoyi.common.utils.poi.ExcelUtils;
|
|
import com.ruoyi.finance.domain.TFee;
|
|
import com.ruoyi.finance.domain.TFee;
|
|
import com.ruoyi.finance.domain.TFeeDo;
|
|
import com.ruoyi.finance.domain.TFeeDo;
|
|
import com.ruoyi.finance.domain.TWareHouseFees;
|
|
import com.ruoyi.finance.domain.TWareHouseFees;
|
|
|
|
+import com.ruoyi.finance.domain.dto.FeeDTO;
|
|
|
|
+import com.ruoyi.finance.domain.excel.GeneralLedgerDetailExcel;
|
|
|
|
+import com.ruoyi.finance.domain.excel.GeneralLedgerExcel;
|
|
|
|
+import com.ruoyi.finance.domain.vo.FeeVO;
|
|
import com.ruoyi.finance.excel.Charge;
|
|
import com.ruoyi.finance.excel.Charge;
|
|
import com.ruoyi.finance.excel.Contrast;
|
|
import com.ruoyi.finance.excel.Contrast;
|
|
import com.ruoyi.finance.excel.Detailed;
|
|
import com.ruoyi.finance.excel.Detailed;
|
|
@@ -596,7 +600,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
if (tFee.getfAccountId() != null) {
|
|
if (tFee.getfAccountId() != null) {
|
|
TFee fee = tFeeMapper.selectTFeeById(tFee.getfAccountId());
|
|
TFee fee = tFeeMapper.selectTFeeById(tFee.getfAccountId());
|
|
fee.setfMake(0);
|
|
fee.setfMake(0);
|
|
- int updateTFee = tFeeMapper.updateTFee(fee);
|
|
|
|
|
|
+ tFeeMapper.updateTFee(fee);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return tFeeMapper.deleteTFeeByIds(fIds);
|
|
return tFeeMapper.deleteTFeeByIds(fIds);
|
|
@@ -617,7 +621,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees, String billsType) {
|
|
public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees, String billsType) {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("tWareHouseFees", tWareHouseFees);
|
|
map.put("tWareHouseFees", tWareHouseFees);
|
|
- List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String, Object>> mapList;
|
|
if (billsType.equals("DZ") || billsType.equals("KHDZ")) {
|
|
if (billsType.equals("DZ") || billsType.equals("KHDZ")) {
|
|
mapList = tFeeMapper.warehouseBillsFeesListAccamount(map);
|
|
mapList = tFeeMapper.warehouseBillsFeesListAccamount(map);
|
|
updateBillTypeName(mapList, tWareHouseFees.getfBilltype());
|
|
updateBillTypeName(mapList, tWareHouseFees.getfBilltype());
|
|
@@ -628,6 +632,10 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
} else if (billsType.equals("ApplyFP")) {
|
|
} else if (billsType.equals("ApplyFP")) {
|
|
mapList = tFeeMapper.warehouseApplyFPFeesList(map);
|
|
mapList = tFeeMapper.warehouseApplyFPFeesList(map);
|
|
return mapList;
|
|
return mapList;
|
|
|
|
+ } else if (FeesTypeEnum.INVOICE.getType().equals(billsType)) {
|
|
|
|
+ // 查询发票
|
|
|
|
+ mapList = tFeeMapper.queryApplyInvoiceFeesList(map);
|
|
|
|
+ return mapList;
|
|
} else {
|
|
} else {
|
|
mapList = tFeeMapper.warehouseBillsFeesList(map);
|
|
mapList = tFeeMapper.warehouseBillsFeesList(map);
|
|
updateBillTypeName(mapList, tWareHouseFees.getfBilltype());
|
|
updateBillTypeName(mapList, tWareHouseFees.getfBilltype());
|
|
@@ -677,10 +685,9 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
- public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees) {
|
|
|
|
- return tFeeMapper.warehouseBillsFeesList1(tWareHouseFees);
|
|
|
|
|
|
+ public List<FeeVO> warehouseBillsFeesList(TWareHouseFees tWareHouseFees) {
|
|
|
|
+ return tFeeMapper.selectFinancialLedgerList(tWareHouseFees);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -722,11 +729,11 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
key = "warehouse.kaiHePayment.ApprovalFlow";
|
|
key = "warehouse.kaiHePayment.ApprovalFlow";
|
|
}
|
|
}
|
|
SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique(key);
|
|
SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique(key);
|
|
- if (StringUtils.isNull(sysConfig)) {
|
|
|
|
|
|
+ if (StringUtils.isNull(sysConfig) && !fBilltype.equals(FeesTypeEnum.INVOICE.getType())) {
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
return AjaxResult.error("系统参数异常,未找到开启审批流参数");
|
|
return AjaxResult.error("系统参数异常,未找到开启审批流参数");
|
|
}
|
|
}
|
|
- if ("0".equals(sysConfig.getConfigValue())) {
|
|
|
|
|
|
+ if ("0".equals(sysConfig.getConfigValue()) && !fBilltype.equals(FeesTypeEnum.INVOICE.getType())) {
|
|
isApprove = true;
|
|
isApprove = true;
|
|
}
|
|
}
|
|
TFee tFee = JSONArray.parseObject(tfee, TFee.class);
|
|
TFee tFee = JSONArray.parseObject(tfee, TFee.class);
|
|
@@ -762,8 +769,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
|
|
List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
|
|
for (TFeeDo tFeeDo : tFeeDoList) {
|
|
for (TFeeDo tFeeDo : tFeeDoList) {
|
|
Map<String, Object> map = this.judgeMoney(tFeeDo.getfSrcid(), tFeeDo.getfAmt(), fBilltype, tFeeDo.getfFeeid());
|
|
Map<String, Object> map = this.judgeMoney(tFeeDo.getfSrcid(), tFeeDo.getfAmt(), fBilltype, tFeeDo.getfFeeid());
|
|
- boolean b = (Boolean) map.get("flag");
|
|
|
|
- if (b == false) {
|
|
|
|
|
|
+ if (!(Boolean) map.get("flag")) {
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
return AjaxResult.error(map.get("message").toString());
|
|
return AjaxResult.error(map.get("message").toString());
|
|
}
|
|
}
|
|
@@ -1268,10 +1274,19 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<Payable> payableExport(TWareHouseFees tWareHouseFees) throws Exception {
|
|
|
|
- List<Map<String, Object>> list = tFeeMapper.warehouseBillsFeesList1(tWareHouseFees);
|
|
|
|
- List<Payable> list1 = ListMapToBeanUtils.castMapToBean(list, Payable.class);
|
|
|
|
- return list1;
|
|
|
|
|
|
+ public List<GeneralLedgerExcel> payableExport(TWareHouseFees tWareHouseFees) throws Exception {
|
|
|
|
+ List<GeneralLedgerExcel> ledgerExcelList = new ArrayList<>();
|
|
|
|
+ List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerList(tWareHouseFees);
|
|
|
|
+ feeVOList.forEach(vo -> {
|
|
|
|
+ GeneralLedgerExcel ledgerExcel = new GeneralLedgerExcel();
|
|
|
|
+ ledgerExcel.setFMblno(vo.getFMblno());
|
|
|
|
+ ledgerExcel.setFAmount(vo.getFAmount());
|
|
|
|
+ ledgerExcel.setFFeesName(vo.getFFeesName());
|
|
|
|
+ ledgerExcel.setNnfinished(vo.getNnfinished());
|
|
|
|
+ ledgerExcel.setFStlamount(vo.getFStlamount());
|
|
|
|
+ ledgerExcelList.add(ledgerExcel);
|
|
|
|
+ });
|
|
|
|
+ return ledgerExcelList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1291,22 +1306,19 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
@Override
|
|
@Override
|
|
public List<Payment> paymentExport(TFee tFee) throws Exception {
|
|
public List<Payment> paymentExport(TFee tFee) throws Exception {
|
|
List<Map<String, Object>> list = tFeeMapper.selectFeeList(tFee);
|
|
List<Map<String, Object>> list = tFeeMapper.selectFeeList(tFee);
|
|
- List<Payment> list1 = ListMapToBeanUtils.castMapToBean(list, Payment.class);
|
|
|
|
- return list1;
|
|
|
|
|
|
+ return ListMapToBeanUtils.castMapToBean(list, Payment.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<Charge> chargeExport(TFee tFee) throws Exception {
|
|
public List<Charge> chargeExport(TFee tFee) throws Exception {
|
|
List<Map<String, Object>> list = tFeeMapper.selectFeeList(tFee);
|
|
List<Map<String, Object>> list = tFeeMapper.selectFeeList(tFee);
|
|
- List<Charge> list1 = ListMapToBeanUtils.castMapToBean(list, Charge.class);
|
|
|
|
- return list1;
|
|
|
|
|
|
+ return ListMapToBeanUtils.castMapToBean(list, Charge.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<Account> accountExport(TFee tFee) throws Exception {
|
|
public List<Account> accountExport(TFee tFee) throws Exception {
|
|
List<Map<String, Object>> list = tFeeMapper.webVersionTFee(tFee);
|
|
List<Map<String, Object>> list = tFeeMapper.webVersionTFee(tFee);
|
|
- List<Account> accountList = ListMapToBeanUtils.castMapToBean(list, Account.class);
|
|
|
|
- return accountList;
|
|
|
|
|
|
+ return ListMapToBeanUtils.castMapToBean(list, Account.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1333,7 +1345,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
sysDictData.setStatus("0");
|
|
sysDictData.setStatus("0");
|
|
sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
|
|
sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
|
|
}
|
|
}
|
|
- if (null != sysDictDataListIn && sysDictDataListIn.size() > 0) {
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(sysDictDataListIn)) {
|
|
tWareHouseExcelItem.setfBusinessType(sysDictDataListIn.get(0).getDictLabel());
|
|
tWareHouseExcelItem.setfBusinessType(sysDictDataListIn.get(0).getDictLabel());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1722,6 +1734,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 导出财务对账数据
|
|
* 导出财务对账数据
|
|
|
|
+ *
|
|
* @param fId
|
|
* @param fId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -1737,23 +1750,23 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
//查询财务主数据
|
|
//查询财务主数据
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
TFee fee = tFeeMapper.selectTFeeById(fId);
|
|
TFee fee = tFeeMapper.selectTFeeById(fId);
|
|
- if (fee != null){
|
|
|
|
|
|
+ if (fee != null) {
|
|
corpName = fee.getfCtrlcorpid();
|
|
corpName = fee.getfCtrlcorpid();
|
|
- if (fee.getfFromDate() != null){
|
|
|
|
|
|
+ if (fee.getfFromDate() != null) {
|
|
fFromDate = simpleDateFormat.format(fee.getfFromDate());
|
|
fFromDate = simpleDateFormat.format(fee.getfFromDate());
|
|
}
|
|
}
|
|
- if (fee.getfToDate() != null){
|
|
|
|
|
|
+ if (fee.getfToDate() != null) {
|
|
fToDate = simpleDateFormat.format(fee.getfToDate());
|
|
fToDate = simpleDateFormat.format(fee.getfToDate());
|
|
}
|
|
}
|
|
- if (fee.getfVslid() != null){
|
|
|
|
|
|
+ if (fee.getfVslid() != null) {
|
|
TVessel vessel = tVesselMapper.selectTVesselById(fee.getfVslid());
|
|
TVessel vessel = tVesselMapper.selectTVesselById(fee.getfVslid());
|
|
- if (vessel != null && StringUtils.isNotEmpty(vessel.getfName())){
|
|
|
|
|
|
+ if (vessel != null && StringUtils.isNotEmpty(vessel.getfName())) {
|
|
shipsName = vessel.getfName();
|
|
shipsName = vessel.getfName();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (fee.getfVoyid() != null){
|
|
|
|
|
|
+ if (fee.getfVoyid() != null) {
|
|
TVoyage tVoyage = tVoyageMapper.selectTVoyageById(fee.getfVoyid());
|
|
TVoyage tVoyage = tVoyageMapper.selectTVoyageById(fee.getfVoyid());
|
|
- if (tVoyage != null && StringUtils.isNotEmpty(tVoyage.getfNo())){
|
|
|
|
|
|
+ if (tVoyage != null && StringUtils.isNotEmpty(tVoyage.getfNo())) {
|
|
voyage = tVoyage.getfNo();
|
|
voyage = tVoyage.getfNo();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1850,20 +1863,20 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
c05.setCellValue("船名航次:");
|
|
c05.setCellValue("船名航次:");
|
|
c05.setCellStyle(contentStyle);
|
|
c05.setCellStyle(contentStyle);
|
|
HSSFCell c051 = row3.createCell(1);
|
|
HSSFCell c051 = row3.createCell(1);
|
|
- c051.setCellValue(shipsName+voyage);
|
|
|
|
|
|
+ c051.setCellValue(shipsName + voyage);
|
|
c051.setCellStyle(contentStyle);
|
|
c051.setCellStyle(contentStyle);
|
|
HSSFCell c052 = row3.createCell(3);
|
|
HSSFCell c052 = row3.createCell(3);
|
|
c052.setCellValue("离港日期:");
|
|
c052.setCellValue("离港日期:");
|
|
c052.setCellStyle(contentStyle);
|
|
c052.setCellStyle(contentStyle);
|
|
String message = "";
|
|
String message = "";
|
|
HSSFCell c053 = row3.createCell(5);
|
|
HSSFCell c053 = row3.createCell(5);
|
|
- if (StringUtils.isNotEmpty(fFromDate)){
|
|
|
|
- if (StringUtils.isNotEmpty(fFromDate)){
|
|
|
|
- message = fFromDate+"-"+fToDate;
|
|
|
|
- }else {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(fFromDate)) {
|
|
|
|
+ if (StringUtils.isNotEmpty(fFromDate)) {
|
|
|
|
+ message = fFromDate + "-" + fToDate;
|
|
|
|
+ } else {
|
|
message = fFromDate;
|
|
message = fFromDate;
|
|
}
|
|
}
|
|
- }else if (StringUtils.isNotEmpty(fToDate)){
|
|
|
|
|
|
+ } else if (StringUtils.isNotEmpty(fToDate)) {
|
|
message = fToDate;
|
|
message = fToDate;
|
|
}
|
|
}
|
|
c053.setCellValue(message);
|
|
c053.setCellValue(message);
|
|
@@ -1891,7 +1904,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
}
|
|
}
|
|
//查询费用明细数据
|
|
//查询费用明细数据
|
|
List<ExportFinancial> list = tFeeMapper.exportFinancial(fId);
|
|
List<ExportFinancial> list = tFeeMapper.exportFinancial(fId);
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
HSSFRow tempRow = sheet.createRow(rowNum++);
|
|
HSSFRow tempRow = sheet.createRow(rowNum++);
|
|
tempRow.setHeight((short) 500);
|
|
tempRow.setHeight((short) 500);
|
|
@@ -1960,7 +1973,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
HSSFCell c07 = row7.createCell(0);
|
|
HSSFCell c07 = row7.createCell(0);
|
|
c07.setCellValue(message7);
|
|
c07.setCellValue(message7);
|
|
c07.setCellStyle(endStyle);
|
|
c07.setCellStyle(endStyle);
|
|
- sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 0, 8));//标题合并单元格操作,总列数为9
|
|
|
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 8));//标题合并单元格操作,总列数为9
|
|
//导出excel
|
|
//导出excel
|
|
|
|
|
|
String fileName = "客户对账单.xls";
|
|
String fileName = "客户对账单.xls";
|
|
@@ -1979,6 +1992,57 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
return AjaxResult.error("导出Excel失败");
|
|
return AjaxResult.error("导出Excel失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据结算单位、费用状态、审核日期查询应付总帐明细
|
|
|
|
+ *
|
|
|
|
+ * @param feeDTO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public AjaxResult financialLedgerDetails(FeeDTO feeDTO) {
|
|
|
|
+ TFees ccf = tFeesMapper.seletFeesByCCF();
|
|
|
|
+ if (Objects.isNull(ccf)) {
|
|
|
|
+ throw new WarehouseException("未找到仓储费费用信息");
|
|
|
|
+ }
|
|
|
|
+ feeDTO.setFeesId(ccf.getfId());
|
|
|
|
+ List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
+ feeVOList.forEach(vo -> {
|
|
|
|
+ WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(vo.getfBilltype(), "storageType");
|
|
|
|
+ vo.setfBilltype(storageType.getName());
|
|
|
|
+ });
|
|
|
|
+ return AjaxResult.success(feeVOList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询应付总帐明细
|
|
|
|
+ *
|
|
|
|
+ * @param feeDTO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<GeneralLedgerDetailExcel> financialLedgerDetailsExport(FeeDTO feeDTO) {
|
|
|
|
+ List<GeneralLedgerDetailExcel> detailExcelList = new ArrayList<>();
|
|
|
|
+ List<FeeVO> feeVOList = tFeeMapper.selectFinancialLedgerDetails(feeDTO);
|
|
|
|
+ feeVOList.forEach(vo -> {
|
|
|
|
+ GeneralLedgerDetailExcel detailExcel = new GeneralLedgerDetailExcel();
|
|
|
|
+ WarehouseTypeEnum storageType = WarehouseTypeEnum.fromTypeAndBusinessType(vo.getfBilltype(), "storageType");
|
|
|
|
+ detailExcel.setFMblno(vo.getFMblno());
|
|
|
|
+ detailExcel.setFMarks(vo.getFMarks());
|
|
|
|
+ detailExcel.setFAmount(vo.getFAmount());
|
|
|
|
+ detailExcel.setOtherFee(vo.getOtherFee());
|
|
|
|
+ detailExcel.setFFeesName(vo.getFFeesName());
|
|
|
|
+ detailExcel.setNnfinished(vo.getNnfinished());
|
|
|
|
+ detailExcel.setFStlamount(vo.getFStlamount());
|
|
|
|
+ detailExcel.setStorageFee(vo.getStorageFee());
|
|
|
|
+ detailExcel.setFBilltype(storageType.getName());
|
|
|
|
+ detailExcel.setFProductName(vo.getFProductName());
|
|
|
|
+ detailExcel.setFProductName(vo.getFProductName());
|
|
|
|
+ detailExcelList.add(detailExcel);
|
|
|
|
+ });
|
|
|
|
+ return detailExcelList;
|
|
|
|
+ }
|
|
|
|
+
|
|
//下载路径
|
|
//下载路径
|
|
private String getAbsoluteFile(String fileName) {
|
|
private String getAbsoluteFile(String fileName) {
|
|
String downloadPath = RuoYiConfig.getDownloadPath() + fileName;
|
|
String downloadPath = RuoYiConfig.getDownloadPath() + fileName;
|