Browse Source

2024年3月4日17:37:08

纪新园 1 year ago
parent
commit
a2c4f0bde4

+ 6 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/reports/entity/ReportsLog.java

@@ -157,5 +157,11 @@ public class ReportsLog implements Serializable {
 	@ApiModelProperty(value = "HB/L NO")
 	@ApiModelProperty(value = "HB/L NO")
 	private String hblno;
 	private String hblno;
 
 
+	/**
+	 * 报表类型
+	 */
+	@ApiModelProperty(value = "报表类型")
+	private String reportsType;
+
 
 
 }
 }

+ 5 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -1611,6 +1611,11 @@ public class Bills implements Serializable {
 	@TableField(exist = false)
 	@TableField(exist = false)
 	private BigDecimal boxWeightSum;
 	private BigDecimal boxWeightSum;
 	/**
 	/**
+	 * 箱信息字符串
+	 */
+	@TableField(exist = false)
+	private String cntryString;
+	/**
 	 * 本位币利润(CNY)
 	 * 本位币利润(CNY)
 	 */
 	 */
 	@TableField(exist = false)
 	@TableField(exist = false)

+ 1 - 0
blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java

@@ -28,6 +28,7 @@ public class MagicValues {
 	public static final String INCOMING_NOTIFICATION = "入货通知";
 	public static final String INCOMING_NOTIFICATION = "入货通知";
 	public static final String SALES_REPORT = "销售报告";
 	public static final String SALES_REPORT = "销售报告";
 	public static final String MASTER_BILLS = "MASTER 提单";
 	public static final String MASTER_BILLS = "MASTER 提单";
+	public static final String BILLS_DETAIL = "提单详情";
 	public static final String HYCK = "HYCK";
 	public static final String HYCK = "HYCK";
 	public static final String HYJK = "HYJK";
 	public static final String HYJK = "HYJK";
 	public static final String KYCK = "KYCK";
 	public static final String KYCK = "KYCK";

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/basic/acc/mapper/AccountsMapper.java

@@ -45,5 +45,5 @@ public interface AccountsMapper extends BaseMapper<Accounts> {
 
 
 	List<AccountsVO> lazyTree(@Param("tenantId")String tenantId, @Param("parentId")Long parentId, @Param("deptPid")Long deptPid);
 	List<AccountsVO> lazyTree(@Param("tenantId")String tenantId, @Param("parentId")Long parentId, @Param("deptPid")Long deptPid);
 
 
-	List<AccountsDetail> accountsDetailsList(IPage<AccountsDetail> page, @Param("acc")AccountsDetail accountsDetail);
+	List<AccountsDetail> accountsDetailsList(@Param("page") IPage<AccountsDetail> page, @Param("accountsDetail")AccountsDetail accountsDetail);
 }
 }

+ 22 - 22
blade-service/blade-los/src/main/java/org/springblade/los/basic/acc/mapper/AccountsMapper.xml

@@ -114,10 +114,10 @@
         SELECT
         SELECT
             item.account_year as accountYear,
             item.account_year as accountYear,
             item.account_month as accountMonth,
             item.account_month as accountMonth,
-            acc.id as accountId,
-            acc.`code` as code,
-            acc.cn_name as accountName,
-            acc.dc as dc,
+            ac.id as accountId,
+            ac.`code` as code,
+            ac.cn_name as accountName,
+            ac.dc as dc,
             item.voucher_no as voucherNo,
             item.voucher_no as voucherNo,
             item.dc as amountDc,
             item.dc as amountDc,
             item.voucher_date as voucherDate,
             item.voucher_date as voucherDate,
@@ -128,35 +128,35 @@
             item.amount_cr_usd as amountCrUsd,
             item.amount_cr_usd as amountCrUsd,
             item.cur_code  as curCode
             item.cur_code  as curCode
         FROM
         FROM
-            los_b_accounts acc
-                LEFT JOIN los_fin_vouchers_items item ON acc.id = item.account_id
+            los_b_accounts ac
+                LEFT JOIN los_fin_vouchers_items item ON ac.id = item.account_id
         WHERE
         WHERE
             item.is_deleted = '0'
             item.is_deleted = '0'
-        <if test="acc.tenantId!=null and acc.tenantId!=''">
-            and acc.tenant_id = #{acc.tenantId}
+        <if test="accountsDetail.tenantId!=null and accountsDetail.tenantId!=''">
+            and ac.tenant_id = #{accountsDetail.tenantId}
         </if>
         </if>
-        <if test="acc.curCode!=null and acc.curCode!=''">
-            and item.cur_code = #{acc.curCode}
+        <if test="accountsDetail.curCode!=null and accountsDetail.curCode!=''">
+            and item.cur_code = #{accountsDetail.curCode}
         </if>
         </if>
-        <if test="acc.startDate!=null and acc.startDate!=''">
-            and item.vouchers_date &gt;= #{acc.startDate}
+        <if test="accountsDetail.startDate!=null and accountsDetail.startDate!=''">
+            and item.voucher_date &gt;= #{accountsDetail.startDate}
         </if>
         </if>
-        <if test="acc.endDate!=null and acc.endDate!=''">
-            and item.vouchers_date &lt;= #{acc.endDate}
+        <if test="accountsDetail.endDate!=null and accountsDetail.endDate!=''">
+            and item.voucher_date &lt;= #{accountsDetail.endDate}
         </if>
         </if>
-        <if test="acc.startCode!=null and acc.startCode!=''">
-            and acc.code &gt;= #{acc.startCode}
+        <if test="accountsDetail.startCode!=null and accountsDetail.startCode!=''">
+            and ac.code &gt;= #{accountsDetail.startCode}
         </if>
         </if>
-        <if test="acc.endCode!=null and acc.endCode!=''">
-            and acc.code &lt;= #{acc.endCode}
+        <if test="accountsDetail.endCode!=null and accountsDetail.endCode!=''">
+            and ac.code &lt;= #{accountsDetail.endCode}
         </if>
         </if>
-        <if test="acc.branchId!=null and acc.branchId!=''">
-            and item.branch_id = #{acc.branchId}
+        <if test="accountsDetail.branchId!=null and accountsDetail.branchId!=''">
+            and item.branch_id = #{accountsDetail.branchId}
         </if>
         </if>
-          <if test="acc.isAccounting!=null and acc.isAccounting!='' and acc.isAccounting !='1'">
+          <if test="accountsDetail.isAccounting!=null and accountsDetail.isAccounting!='' and accountsDetail.isAccounting !='1'">
             and item.voucher_status = '1'
             and item.voucher_status = '1'
         </if>
         </if>
-        <if test="acc.isPage!=null and acc.isPage!=''">
+        <if test="accountsDetail.isPage!=null and accountsDetail.isPage!=''">
             GROUP BY `code`
             GROUP BY `code`
         </if>
         </if>
     </select>
     </select>

+ 2 - 3
blade-service/blade-los/src/main/java/org/springblade/los/basic/acc/service/impl/AccountsServiceImpl.java

@@ -336,6 +336,7 @@ public class AccountsServiceImpl extends ServiceImpl<AccountsMapper, Accounts> i
 				FinGenleg finGenleg = finGenlegList.stream()
 				FinGenleg finGenleg = finGenlegList.stream()
 					.filter(e -> e.getAccId().equals(item.getAccountId()) && e.getAccyear().toString().equals(item.getAccountYear())
 					.filter(e -> e.getAccId().equals(item.getAccountId()) && e.getAccyear().toString().equals(item.getAccountYear())
 						&& e.getAccmonth().toString().equals(item.getAccountMonth())).findFirst().orElse(null);
 						&& e.getAccmonth().toString().equals(item.getAccountMonth())).findFirst().orElse(null);
+				List<AccountsDetail> accountsDetails = new ArrayList<>();
 				if (finGenleg != null) {
 				if (finGenleg != null) {
 					BigDecimal amountLastBlc = finGenleg.getAmountLastBlc();
 					BigDecimal amountLastBlc = finGenleg.getAmountLastBlc();
 					BigDecimal amountLastBlcUsd = finGenleg.getAmountLastBlcUsd();
 					BigDecimal amountLastBlcUsd = finGenleg.getAmountLastBlcUsd();
@@ -350,7 +351,6 @@ public class AccountsServiceImpl extends ServiceImpl<AccountsMapper, Accounts> i
 					item.setDescr("上期余额");
 					item.setDescr("上期余额");
 					item.setAmountBlc(amountLastBlc);
 					item.setAmountBlc(amountLastBlc);
 					item.setAmountUsdBlc(amountLastBlcUsd);
 					item.setAmountUsdBlc(amountLastBlcUsd);
-					List<AccountsDetail> accountsDetails = new ArrayList<>();
 
 
 					List<AccountsDetail> accountsDetailList2 = accountsDetailList1.stream()
 					List<AccountsDetail> accountsDetailList2 = accountsDetailList1.stream()
 						.filter(e -> e.getAccountId().equals(item.getAccountId())).collect(Collectors.toList());
 						.filter(e -> e.getAccountId().equals(item.getAccountId())).collect(Collectors.toList());
@@ -431,9 +431,8 @@ public class AccountsServiceImpl extends ServiceImpl<AccountsMapper, Accounts> i
 					accountsDetail2.setAmountDc(item.getAmountDc());
 					accountsDetail2.setAmountDc(item.getAmountDc());
 					accountsDetail2.setCurCode(item.getCurCode());
 					accountsDetail2.setCurCode(item.getCurCode());
 					accountsDetails.add(accountsDetail2);
 					accountsDetails.add(accountsDetail2);
-					item.setAccountsDetailList(accountsDetails);
 				}
 				}
-
+				item.setAccountsDetailList(accountsDetails);
 			}
 			}
 		}
 		}
 		return page.setRecords(accountsDetailList);
 		return page.setRecords(accountsDetailList);

+ 4 - 3
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/controller/ReportsController.java

@@ -72,15 +72,16 @@ public class ReportsController extends BladeController {
 		LambdaQueryWrapper<Reports> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		LambdaQueryWrapper<Reports> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(Reports::getTenantId, AuthUtil.getTenantId())
 		lambdaQueryWrapper.eq(Reports::getTenantId, AuthUtil.getTenantId())
 			.eq(Reports::getIsDeleted, 0)
 			.eq(Reports::getIsDeleted, 0)
-			.eq(ObjectUtils.isNotNull(reports.getCode()), Reports::getCode, reports.getCode())
-			.eq(ObjectUtils.isNotNull(reports.getGroupCode()), Reports::getGroupCode, reports.getGroupCode())
+			.like(ObjectUtils.isNotNull(reports.getCnName()),Reports::getCnName, reports.getCnName())
+			.apply(ObjectUtils.isNotNull(reports.getCode()), "find_in_set(code,'" + reports.getCode() + "')")
+			.apply(ObjectUtils.isNotNull(reports.getGroupCode()), "find_in_set(group_code,'" + reports.getGroupCode() + "')")
 			.eq(ObjectUtils.isNotNull(reports.getBusinessType()), Reports::getBusinessType, reports.getBusinessType());
 			.eq(ObjectUtils.isNotNull(reports.getBusinessType()), Reports::getBusinessType, reports.getBusinessType());
 		if ("AMEND".equals(reports.getBusinessType())) {
 		if ("AMEND".equals(reports.getBusinessType())) {
 			lambdaQueryWrapper.apply(ObjectUtils.isNotNull(reports.getClassifyCode()), "find_in_set(classify_code,'" + reports.getClassifyCode() + "')");
 			lambdaQueryWrapper.apply(ObjectUtils.isNotNull(reports.getClassifyCode()), "find_in_set(classify_code,'" + reports.getClassifyCode() + "')");
 		} else {
 		} else {
 			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(reports.getClassifyCode()), Reports::getClassifyCode, reports.getClassifyCode());
 			lambdaQueryWrapper.eq(ObjectUtils.isNotNull(reports.getClassifyCode()), Reports::getClassifyCode, reports.getClassifyCode());
 		}
 		}
-		IPage<Reports> pages = reportsService.page(Condition.getPage(query),lambdaQueryWrapper);
+		IPage<Reports> pages = reportsService.page(Condition.getPage(query), lambdaQueryWrapper);
 		return R.data(pages);
 		return R.data(pages);
 	}
 	}
 
 

+ 39 - 1
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -157,7 +157,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 
 
 	@Override
 	@Override
 	public R<Map<String, Object>> getReportData(String billId, String reportCode, String groupCode, String corpIds,
 	public R<Map<String, Object>> getReportData(String billId, String reportCode, String groupCode, String corpIds,
-						   String itemIds, String type) {
+												String itemIds, String type) {
 		Map<String, Object> map = new HashMap<>();
 		Map<String, Object> map = new HashMap<>();
 		R<Dept> res = sysClient.getDept(deptUtils.getDeptPid());
 		R<Dept> res = sysClient.getDept(deptUtils.getDeptPid());
 		Dept dept;
 		Dept dept;
@@ -574,6 +574,44 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 			} else {
 			} else {
 				map.put(MagicValues.DATA, null);
 				map.put(MagicValues.DATA, null);
 			}
 			}
+		} else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.BILLS_DETAIL.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
+			Bills bills = billsService.getById(billId);
+			if (bills != null) {
+//				bills.setFM(MagicValues.FM);
+				bills.setVesselCnName(bills.getVesselEnName() + "/" + bills.getVoyageNo());
+				BigDecimal boxWeightSum = BigDecimal.ZERO;
+				List<Containers> containersList = containersService.list(new LambdaQueryWrapper<Containers>()
+					.eq(Containers::getTenantId, AuthUtil.getTenantId())
+					.eq(Containers::getIsDeleted, 0)
+					.eq(Containers::getPid, bills.getId()));
+				List<PreContainers> preContainersList = preContainersService.list(new LambdaQueryWrapper<PreContainers>()
+					.eq(PreContainers::getTenantId, AuthUtil.getTenantId())
+					.eq(PreContainers::getIsDeleted, 0)
+					.eq(PreContainers::getPid, bills.getId()));
+				if (!containersList.isEmpty()) {
+					boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
+					if (!preContainersList.isEmpty()) {
+						List<PreContainers> preContainers = preContainersList.stream().filter(e -> e.getCntrTypeCode().equals(containersList.get(0).getCntrTypeCode()))
+							.collect(Collectors.toList());
+						if (!preContainers.isEmpty()) {
+							boxWeightSum = boxWeightSum.add(containersList.get(0).getGrossWeight());
+						}
+					}
+				}
+				bills.setBoxWeightSum(boxWeightSum);
+				StringBuilder text = new StringBuilder();
+				for (Containers item : containersList) {
+					text.append(item.getCntrNo()).append("/").append(item.getSealNo())
+						.append(item.getQuantity()).append(item.getPackingUnit()).append("/")
+						.append(item.getGrossWeight()).append(item.getPackingUnit()).append("/")
+						.append(item.getMeasurement()).append("CBM");
+				}
+				bills.setCntryString(text.toString());
+				bills.setDept(dept);
+				map.put(MagicValues.DATA, bills);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
 		} else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.DISPATCH_NOTICE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 		} else if (MagicValues.DOCUMENT.equals(reportCode) && MagicValues.DISPATCH_NOTICE.equals(groupCode) && (MagicValues.HYCK.equals(type) || MagicValues.HYJK.equals(type))) {
 			Bills bills = billsService.getById(billId);
 			Bills bills = billsService.getById(billId);
 			if (bills != null) {
 			if (bills != null) {

+ 72 - 0
blade-service/blade-los/src/main/java/org/springblade/los/external/Luhaitong/ApiController.java

@@ -0,0 +1,72 @@
+package org.springblade.los.external.Luhaitong;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.api.R;
+import org.springblade.system.feign.ISysClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.rmi.RemoteException;
+
+/**
+ * @author :jixinyuan
+ * @date : 2024/3/4
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/luHaiTongApi")
+@Api(value = "对外接口-陆海通", tags = "对外接口-陆海通接口")
+public class ApiController {
+
+	private final ISysClient sysClient;
+
+	/**
+	 * 获取场站数据
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入reports")
+	public R detail(@RequestParam("billNo") String billNo, @RequestParam("station") String station) throws IOException {
+		String geturl = "https://www.sdland-sea.com/station/billSearch?billNo=" + billNo + "&type=" + station;
+		String auth = sysClient.getParamService("secret_key");
+		if (ObjectUtils.isNull(auth)) {
+			throw new RemoteException("陆海通秘钥为空,请先维护");
+		}
+		URL url = new URL(geturl);    // 把字符串转换为URL请求地址
+		HttpURLConnection connection = (HttpURLConnection) url.openConnection();// 打开连接
+		connection.setRequestMethod("GET");
+		// 添加自定义的Header信息
+		connection.addRequestProperty("Host", "www.sdland-sea.com");
+		connection.addRequestProperty("Lh-Auth", "14658740-0996-412e-a6c2-0c3cc5aace4b");
+		connection.addRequestProperty("Referer", "https://www.sdland-sea.com/service/station/billSearch");
+		connection.connect();// 连接会话
+		// 获取输入流
+		BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+		String line;
+		StringBuilder sb = new StringBuilder();
+		while ((line = br.readLine()) != null) {// 循环读取流
+			sb.append(line);
+		}
+		br.close();// 关闭流
+		connection.disconnect();// 断开连接
+		JSONObject a = JSON.parseObject(sb.toString());
+		//判断输入的位置点是否存在
+		System.out.println("sb" + sb);
+		System.out.println("a" + a);
+		return R.data(sb);
+	}
+
+}

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/finance/stl/service/impl/FinStlBillsServiceImpl.java

@@ -2081,7 +2081,7 @@ public class FinStlBillsServiceImpl extends ServiceImpl<FinStlBillsMapper, FinSt
 				//判断是否核算客户 true 向明细中客户字段复制
 				//判断是否核算客户 true 向明细中客户字段复制
 				if (1 == finVouchersItems.getIsCorp()) {
 				if (1 == finVouchersItems.getIsCorp()) {
 					if (bCorps != null) {
 					if (bCorps != null) {
-						finVouchersItems.setCorpId(bCorps.getCorpId());
+						finVouchersItems.setCorpId(bCorps.getId());
 						finVouchersItems.setCorpCnName(bCorps.getCnName());
 						finVouchersItems.setCorpCnName(bCorps.getCnName());
 						finVouchersItems.setCorpEnName(bCorps.getEnName());
 						finVouchersItems.setCorpEnName(bCorps.getEnName());
 					}
 					}