|
|
@@ -21,6 +21,10 @@ import com.ruoyi.common.utils.poi.ExcelUtils;
|
|
|
import com.ruoyi.finance.domain.TFee;
|
|
|
import com.ruoyi.finance.domain.TFeeDo;
|
|
|
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.Contrast;
|
|
|
import com.ruoyi.finance.excel.Detailed;
|
|
|
@@ -28,9 +32,9 @@ import com.ruoyi.finance.excel.Payment;
|
|
|
import com.ruoyi.finance.mapper.TFeeDoMapper;
|
|
|
import com.ruoyi.finance.mapper.TFeeMapper;
|
|
|
import com.ruoyi.finance.service.ITFeeService;
|
|
|
-import com.ruoyi.finance.shipping.*;
|
|
|
+import com.ruoyi.finance.shipping.FinancialTFee;
|
|
|
+import com.ruoyi.finance.shipping.FinancialTFeeDoExcel;
|
|
|
import com.ruoyi.reportManagement.dto.TWarehousebill;
|
|
|
-import com.ruoyi.reportManagement.excel.Payable;
|
|
|
import com.ruoyi.reportManagement.excel.Profit;
|
|
|
import com.ruoyi.reportManagement.excel.Receivable;
|
|
|
import com.ruoyi.shipping.domain.TAccount;
|
|
|
@@ -595,7 +599,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
if (tFee.getfAccountId() != null) {
|
|
|
TFee fee = tFeeMapper.selectTFeeById(tFee.getfAccountId());
|
|
|
fee.setfMake(0);
|
|
|
- int updateTFee = tFeeMapper.updateTFee(fee);
|
|
|
+ tFeeMapper.updateTFee(fee);
|
|
|
}
|
|
|
}
|
|
|
return tFeeMapper.deleteTFeeByIds(fIds);
|
|
|
@@ -616,7 +620,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees, String billsType) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("tWareHouseFees", tWareHouseFees);
|
|
|
- List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
+ List<Map<String, Object>> mapList;
|
|
|
if (billsType.equals("DZ") || billsType.equals("KHDZ")) {
|
|
|
mapList = tFeeMapper.warehouseBillsFeesListAccamount(map);
|
|
|
updateBillTypeName(mapList, tWareHouseFees.getfBilltype());
|
|
|
@@ -627,6 +631,10 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
} else if (billsType.equals("ApplyFP")) {
|
|
|
mapList = tFeeMapper.warehouseApplyFPFeesList(map);
|
|
|
return mapList;
|
|
|
+ } else if (FeesTypeEnum.INVOICE.getType().equals(billsType)) {
|
|
|
+ // 查询发票
|
|
|
+ mapList = tFeeMapper.queryApplyInvoiceFeesList(map);
|
|
|
+ return mapList;
|
|
|
} else {
|
|
|
mapList = tFeeMapper.warehouseBillsFeesList(map);
|
|
|
updateBillTypeName(mapList, tWareHouseFees.getfBilltype());
|
|
|
@@ -676,10 +684,9 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
- public List<Map<String, Object>> warehouseBillsFeesList(TWareHouseFees tWareHouseFees) {
|
|
|
- return tFeeMapper.warehouseBillsFeesList1(tWareHouseFees);
|
|
|
+ public List<FeeVO> warehouseBillsFeesList(TWareHouseFees tWareHouseFees) {
|
|
|
+ return tFeeMapper.selectFinancialLedgerList(tWareHouseFees);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -701,32 +708,34 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
boolean isApprove = false;
|
|
|
Map<String, Object> messageMap = new HashMap<>();
|
|
|
long actId = 0L;
|
|
|
- if ("DZ".equals(fBilltype)) {
|
|
|
- actId = 210L;
|
|
|
- key = "warehouse.contrast.ApprovalFlow";
|
|
|
- } else if ("SF".equals(fBilltype)) {
|
|
|
- actId = 220L;
|
|
|
- key = "warehouse.charge.ApprovalFlow";
|
|
|
- } else if ("FF".equals(fBilltype)) {
|
|
|
- actId = 230L;
|
|
|
- key = "warehouse.payment.ApprovalFlow";
|
|
|
- } else if ("KHDZ".equals(fBilltype)) {
|
|
|
- actId = 430L;
|
|
|
- key = "warehouse.kaiHeContrast.ApprovalFlow";
|
|
|
- } else if ("KHSF".equals(fBilltype)) {
|
|
|
- actId = 440L;
|
|
|
- key = "warehouse.kaiHeCharge.ApprovalFlow";
|
|
|
- } else if ("KHFF".equals(fBilltype)) {
|
|
|
- actId = 450L;
|
|
|
- key = "warehouse.kaiHePayment.ApprovalFlow";
|
|
|
- }
|
|
|
- SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique(key);
|
|
|
- if (StringUtils.isNull(sysConfig)) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return AjaxResult.error("系统参数异常,未找到开启审批流参数");
|
|
|
- }
|
|
|
- if ("0".equals(sysConfig.getConfigValue())) {
|
|
|
- isApprove = true;
|
|
|
+ if (!fBilltype.equals(FeesTypeEnum.INVOICE.getType())) {
|
|
|
+ if ("DZ".equals(fBilltype)) {
|
|
|
+ actId = 210L;
|
|
|
+ key = "warehouse.contrast.ApprovalFlow";
|
|
|
+ } else if ("SF".equals(fBilltype)) {
|
|
|
+ actId = 220L;
|
|
|
+ key = "warehouse.charge.ApprovalFlow";
|
|
|
+ } else if ("FF".equals(fBilltype)) {
|
|
|
+ actId = 230L;
|
|
|
+ key = "warehouse.payment.ApprovalFlow";
|
|
|
+ } else if ("KHDZ".equals(fBilltype)) {
|
|
|
+ actId = 430L;
|
|
|
+ key = "warehouse.kaiHeContrast.ApprovalFlow";
|
|
|
+ } else if ("KHSF".equals(fBilltype)) {
|
|
|
+ actId = 440L;
|
|
|
+ key = "warehouse.kaiHeCharge.ApprovalFlow";
|
|
|
+ } else if ("KHFF".equals(fBilltype)) {
|
|
|
+ actId = 450L;
|
|
|
+ key = "warehouse.kaiHePayment.ApprovalFlow";
|
|
|
+ }
|
|
|
+ SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique(key);
|
|
|
+ if (StringUtils.isNull(sysConfig)) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return AjaxResult.error("系统参数异常,未找到开启审批流参数");
|
|
|
+ }
|
|
|
+ if ("0".equals(sysConfig.getConfigValue())) {
|
|
|
+ isApprove = true;
|
|
|
+ }
|
|
|
}
|
|
|
TFee tFee = JSONArray.parseObject(tfee, TFee.class);
|
|
|
String billstatus = "";
|
|
|
@@ -761,8 +770,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
|
|
|
for (TFeeDo tFeeDo : tFeeDoList) {
|
|
|
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();
|
|
|
return AjaxResult.error(map.get("message").toString());
|
|
|
}
|
|
|
@@ -1267,10 +1275,19 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
}
|
|
|
|
|
|
@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
|
|
|
@@ -1290,22 +1307,19 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
@Override
|
|
|
public List<Payment> paymentExport(TFee tFee) throws Exception {
|
|
|
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
|
|
|
public List<Charge> chargeExport(TFee tFee) throws Exception {
|
|
|
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
|
|
|
public List<Account> accountExport(TFee tFee) throws Exception {
|
|
|
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
|
|
|
@@ -1332,7 +1346,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
sysDictData.setStatus("0");
|
|
|
sysDictDataListIn = iSysDictDataService.selectDictDataList(sysDictData);
|
|
|
}
|
|
|
- if (null != sysDictDataListIn && sysDictDataListIn.size() > 0) {
|
|
|
+ if (CollectionUtils.isNotEmpty(sysDictDataListIn)) {
|
|
|
tWareHouseExcelItem.setfBusinessType(sysDictDataListIn.get(0).getDictLabel());
|
|
|
}
|
|
|
}
|
|
|
@@ -1721,6 +1735,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
|
|
|
/**
|
|
|
* 导出财务对账数据
|
|
|
+ *
|
|
|
* @param fId
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -1736,23 +1751,23 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
//查询财务主数据
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
TFee fee = tFeeMapper.selectTFeeById(fId);
|
|
|
- if (fee != null){
|
|
|
+ if (fee != null) {
|
|
|
corpName = fee.getfCtrlcorpid();
|
|
|
- if (fee.getfFromDate() != null){
|
|
|
+ if (fee.getfFromDate() != null) {
|
|
|
fFromDate = simpleDateFormat.format(fee.getfFromDate());
|
|
|
}
|
|
|
- if (fee.getfToDate() != null){
|
|
|
+ if (fee.getfToDate() != null) {
|
|
|
fToDate = simpleDateFormat.format(fee.getfToDate());
|
|
|
}
|
|
|
- if (fee.getfVslid() != null){
|
|
|
+ if (fee.getfVslid() != null) {
|
|
|
TVessel vessel = tVesselMapper.selectTVesselById(fee.getfVslid());
|
|
|
- if (vessel != null && StringUtils.isNotEmpty(vessel.getfName())){
|
|
|
+ if (vessel != null && StringUtils.isNotEmpty(vessel.getfName())) {
|
|
|
shipsName = vessel.getfName();
|
|
|
}
|
|
|
}
|
|
|
- if (fee.getfVoyid() != null){
|
|
|
+ if (fee.getfVoyid() != null) {
|
|
|
TVoyage tVoyage = tVoyageMapper.selectTVoyageById(fee.getfVoyid());
|
|
|
- if (tVoyage != null && StringUtils.isNotEmpty(tVoyage.getfNo())){
|
|
|
+ if (tVoyage != null && StringUtils.isNotEmpty(tVoyage.getfNo())) {
|
|
|
voyage = tVoyage.getfNo();
|
|
|
}
|
|
|
}
|
|
|
@@ -1850,20 +1865,20 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
c05.setCellValue("船名航次:");
|
|
|
c05.setCellStyle(contentStyle);
|
|
|
HSSFCell c051 = row3.createCell(1);
|
|
|
- c051.setCellValue(shipsName+voyage);
|
|
|
+ c051.setCellValue(shipsName + voyage);
|
|
|
c051.setCellStyle(contentStyle);
|
|
|
HSSFCell c052 = row3.createCell(3);
|
|
|
c052.setCellValue("离港日期:");
|
|
|
c052.setCellStyle(contentStyle);
|
|
|
String message = "";
|
|
|
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;
|
|
|
}
|
|
|
- }else if (StringUtils.isNotEmpty(fToDate)){
|
|
|
+ } else if (StringUtils.isNotEmpty(fToDate)) {
|
|
|
message = fToDate;
|
|
|
}
|
|
|
c053.setCellValue(message);
|
|
|
@@ -1883,7 +1898,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
//第四行
|
|
|
HSSFRow row5 = sheet.createRow(rowNum++);
|
|
|
row5.setHeight((short) 500);
|
|
|
- String[] row_third = {"序号", "提单号", "始发港", "目的港","运输条款", "货名", "箱量", "规格", "单价", "合计"};
|
|
|
+ String[] row_third = {"序号", "提单号", "始发港", "目的港", "运输条款", "货名", "箱量", "规格", "单价", "合计"};
|
|
|
for (int i = 0; i < row_third.length; i++) {
|
|
|
HSSFCell tempCell = row5.createCell(i);
|
|
|
tempCell.setCellValue(row_third[i]);
|
|
|
@@ -1891,7 +1906,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
}
|
|
|
//查询费用明细数据
|
|
|
List<ExportFinancial> list = tFeeMapper.exportFinancial(fId);
|
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
HSSFRow tempRow = sheet.createRow(rowNum++);
|
|
|
tempRow.setHeight((short) 500);
|
|
|
@@ -1963,7 +1978,7 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
HSSFCell c07 = row7.createCell(0);
|
|
|
c07.setCellValue(message7);
|
|
|
c07.setCellStyle(endStyle);
|
|
|
- sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 0, 9));//标题合并单元格操作,总列数为9
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 9));//标题合并单元格操作,总列数为9
|
|
|
//导出excel
|
|
|
|
|
|
String fileName = "客户对账单.xls";
|
|
|
@@ -1983,6 +1998,57 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据结算单位、费用状态、审核日期查询应付总帐明细
|
|
|
+ *
|
|
|
+ * @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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public List<ReceivableExcel> receivable(TWareHouseFees tWareHouseFees) {
|
|
|
return tFeeMapper.receivable(tWareHouseFees);
|