Browse Source

1.用箱计划提交发送消息bug修改
2.换单增加收据表以及收据打印
3.托书生成海运出口单据atd赋默认值

纪新园 4 months ago
parent
commit
c3113e2ab9
19 changed files with 687 additions and 67 deletions
  1. 34 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/receipt/dto/ReceiptDTO.java
  2. 147 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/receipt/entity/Receipt.java
  3. 36 0
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/receipt/vo/ReceiptVO.java
  4. 26 2
      blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java
  5. 6 1
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java
  6. 1 0
      blade-service/blade-los/src/main/java/org/springblade/los/Util/MagicValues.java
  7. 16 1
      blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsBoxServiceImpl.java
  8. 1 1
      blade-service/blade-los/src/main/java/org/springblade/los/box/controller/UseBoxPlanController.java
  9. 2 4
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java
  10. 22 21
      blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/UseBoxPlanServiceImpl.java
  11. 4 4
      blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java
  12. 126 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/controller/ReceiptController.java
  13. 42 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/mapper/ReceiptMapper.java
  14. 34 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/mapper/ReceiptMapper.xml
  15. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/service/IReceiptService.java
  16. 41 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/service/impl/ReceiptServiceImpl.java
  17. 3 0
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml
  18. 87 33
      blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java
  19. 18 0
      blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

+ 34 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/receipt/dto/ReceiptDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.dto;
+
+import org.springblade.los.business.receipt.entity.Receipt;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 押箱款收据表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ReceiptDTO extends Receipt {
+	private static final long serialVersionUID = 1L;
+
+}

+ 147 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/receipt/entity/Receipt.java

@@ -0,0 +1,147 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.system.entity.Dept;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 押箱款收据表实体类
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+@Data
+@TableName("los_receipt")
+@ApiModel(value = "Receipt对象", description = "押箱款收据表")
+public class Receipt implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 分公司 Id
+	 */
+	@ApiModelProperty(value = "分公司 Id")
+	private String branchId;
+	/**
+	 * 创建人 Id
+	 */
+	@ApiModelProperty(value = "创建人 Id")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人 Id
+	 */
+	@ApiModelProperty(value = "修改人 Id")
+	private Long updateUser;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 版本
+	 */
+	@ApiModelProperty(value = "版本")
+	private String version;
+	/**
+	 * 状态(0 正常 1停用)
+	 */
+	@ApiModelProperty(value = "状态(0 正常 1停用)")
+	private Integer status;
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remarks;
+	/**
+	 * 收据单号
+	 */
+	@ApiModelProperty(value = "收据单号")
+	private String billNo;
+	/**
+	 * 金额
+	 */
+	@ApiModelProperty(value = "金额")
+	private BigDecimal amount;
+	/**
+	 * 日期
+	 */
+	@ApiModelProperty(value = "日期")
+	private Date date;
+	/**
+	 * 分公司
+	 */
+	@ApiModelProperty(value = "分公司")
+	private String branchName;
+	/**
+	 * 付款单位
+	 */
+	@ApiModelProperty(value = "付款单位")
+	private String corpName;
+	/**
+	 * 提单号+箱型箱量
+	 */
+	@ApiModelProperty(value = "提单号+箱型箱量")
+	private String mblno;
+	/**
+	 * 分单号+箱型箱量
+	 */
+	@ApiModelProperty(value = "分单号+箱型箱量")
+	private String hblno;
+	/**
+	 * 支票号
+	 */
+	@ApiModelProperty(value = "支票号")
+	private String chequeNumber;
+
+	/**
+	 * 报表表头信息
+	 */
+	@TableField(exist = false)
+	private Dept dept;
+
+
+}

+ 36 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/receipt/vo/ReceiptVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.vo;
+
+import org.springblade.los.business.receipt.entity.Receipt;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 押箱款收据表视图实体类
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ReceiptVO对象", description = "押箱款收据表")
+public class ReceiptVO extends Receipt {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -1130,9 +1130,9 @@ public class Bills implements Serializable {
 	private String forwarding;
 
 	/**
-	 * 检验检疫 NO  (免箱期)
+	 * 检验检疫 NO  (免箱期)/收据号
 	 */
-	@ApiModelProperty(value = "检验检疫 NO")
+	@ApiModelProperty(value = "检验检疫 NO/收据号")
 	private String iqNo;
 
 	/**
@@ -1692,6 +1692,30 @@ public class Bills implements Serializable {
 	private Date retreatBoxPackingDate;
 
 	/**
+	 * 金额
+	 */
+	@TableField(exist = false)
+	private BigDecimal amount;
+
+	/**
+	 * 付款单位
+	 */
+	@TableField(exist = false)
+	private String corpName;
+
+	/**
+	 * 支票号
+	 */
+	@TableField(exist = false)
+	private String chequeNumber;
+
+	/**
+	 * ids
+	 */
+	@TableField(exist = false)
+	private String ids;
+
+	/**
 	 * 本位币实收
 	 */
 	@TableField(exist = false)

+ 6 - 1
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/feign/IUserClient.java

@@ -58,6 +58,8 @@ public interface IUserClient {
 	String USER_INFO_BY_IDS = API_PREFIX + "/user-info-by-ids";
 	String USER_INFO_BY_NAME_PRECISION = API_PREFIX + "/user-info-by-name-precision";
 	String LIST_USER_BY_ROLE_ID = API_PREFIX + "/listUserByRoleId";
+
+	String LIST_USER_BY_ROLE_IDS = API_PREFIX + "/listUserByRoleIds";
 	String GET_USER_PAGE = API_PREFIX + "/getUserPage";
 	String USER_BY_IDS = API_PREFIX + "/selectUserIds";
 
@@ -84,6 +86,9 @@ public interface IUserClient {
 	@GetMapping(LIST_USER_BY_ROLE_ID)
 	R<List<User>> listUserByRoleId(@RequestParam("roleId") String roleId, @RequestParam(value = "tenantId", required = false) String tenantId, @RequestParam(value = "salesCompanyId", required = false) String salesCompanyId);
 
+	@GetMapping(LIST_USER_BY_ROLE_IDS)
+	R<List<User>> listUserByRoleIds(@RequestParam("roleId") String roleId);
+
 	/**
 	 * 获取用户信息
 	 *
@@ -321,7 +326,7 @@ public interface IUserClient {
 	void updateByIdPointsBalance(@RequestBody List<User> users);
 
 	@GetMapping(GET_USER_LIST)
-	List<User> selectUserList(@RequestParam(value = "corpIds", required = false)String corpIds);
+	List<User> selectUserList(@RequestParam(value = "corpIds", required = false) String corpIds);
 
 	@GetMapping(GET_USER_LIST_BY_ROLE)
 	List<User> selectListByRole(@RequestParam(value = "tenantId", required = false) String tenantId);

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

@@ -57,6 +57,7 @@ public class MagicValues {
 	public static final String BJZX = "BJZX";
 
 	public static final String YYFY = "YYFY";
+	public static final String YASJ = "YASJ";
 	public static final String QUOTATION_CENTER = "mkt&slot";
 	public static final String FYSQ = "FYSQ";
 	public static final String AMEND = "AMEND";

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

@@ -38,6 +38,8 @@ import org.springblade.los.business.mktSlot.entity.MktSlotQuotation;
 import org.springblade.los.business.mktSlot.service.IMktSlotItemService;
 import org.springblade.los.business.mktSlot.service.IMktSlotQuotationService;
 import org.springblade.los.business.mktSlot.service.IMktSlotService;
+import org.springblade.los.business.receipt.entity.Receipt;
+import org.springblade.los.business.receipt.service.IReceiptService;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.entity.SeaBillsDetail;
 import org.springblade.los.business.sea.service.IBillsService;
@@ -107,6 +109,8 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 
 	private final IOperatingExpensesItemService operatingExpensesItemService;
 
+	private final IReceiptService receiptService;
+
 
 	@Override
 	public R getReportData(String billId, String reportCode, String groupCode, String corpIds, String itemIds,
@@ -427,7 +431,18 @@ public class ReportsBoxServiceImpl implements IReportsBoxService {
 			} else {
 				map.put(MagicValues.DATA, null);
 			}
-		} else {
+		} else if (MagicValues.YASJ.equals(reportCode) && MagicValues.YASJ.equals(groupCode) && MagicValues.YASJ.equals(type)) {
+			Receipt receipt = receiptService.getOne(new LambdaQueryWrapper<Receipt>()
+				.eq(Receipt::getIsDeleted,0)
+				.eq(Receipt::getBillNo,billId)
+				.last("LIMIT 1"));
+			if (receipt != null) {
+				receipt.setDept(dept);
+				map.put(MagicValues.DATA, receipt);
+			} else {
+				map.put(MagicValues.DATA, null);
+			}
+		}else {
 			map.put(MagicValues.DATA, null);
 		}
 		return R.data(map);

+ 1 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/UseBoxPlanController.java

@@ -145,7 +145,7 @@ public class UseBoxPlanController extends BladeController {
 		return useBoxPlanService.submitUseBoxPlan(useBoxPlan);
 	}
 	/**
-	 * 提交用箱计划
+	 * 撤销提交用箱计划
 	 */
 	@PostMapping("/revokeUseBoxPlan")
 	public R revokeUseBoxPlan(@Valid @RequestBody UseBoxPlan useBoxPlan) {

+ 2 - 4
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/PutBoxServiceImpl.java

@@ -3648,8 +3648,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				item.setPodCyContact(podStationR.getPodCyContact());
 				item.setPodCyEmail(podStationR.getPodCyEmail());
 				item.setPodCyTel(podStationR.getPodCyTel());
-				item.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
-				item.setMarks(podStationR.getPodStationCode());
+				item.setMarks(podStationR.getMarks());
 				item.setUpdateTime(new Date());
 				item.setUpdateUser(AuthUtil.getUserId());
 				item.setUpdateUserName(AuthUtil.getUserName());
@@ -3663,7 +3662,7 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 				throw new RuntimeException("未查到海运出口单据");
 			}
 			for (Bills item : billsHYJKList) {
-				if (new Date().compareTo(item.getEtd()) > 0) {
+				if (ObjectUtils.isNotNull(item.getEtd()) && new Date().compareTo(item.getEtd()) > 0) {
 					throw new RuntimeException("提单号:" + item.getMblno() + "已开船,修改失败");
 				}
 			}
@@ -3688,7 +3687,6 @@ public class PutBoxServiceImpl extends ServiceImpl<PutBoxMapper, PutBox> impleme
 						item.setPodCyContact(podStationR.getPodCyContact());
 						item.setPodCyEmail(podStationR.getPodCyEmail());
 						item.setPodCyTel(podStationR.getPodCyTel());
-						item.setPodEmptyContainerReturnDate(podStationR.getReturnEmptyTime());
 						item.setUpdateTime(new Date());
 						item.setUpdateUser(AuthUtil.getUserId());
 						item.setUpdateUserName(AuthUtil.getUserName());

+ 22 - 21
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/UseBoxPlanServiceImpl.java

@@ -25,7 +25,6 @@ import org.springblade.client.entity.Message;
 import org.springblade.client.feign.IMessageClient;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
 import org.springblade.los.basic.business.entity.BusinessType;
 import org.springblade.los.basic.business.service.IBusinessTypeService;
 import org.springblade.los.billno.entity.BusinessBillNo;
@@ -172,25 +171,27 @@ public class UseBoxPlanServiceImpl extends ServiceImpl<UseBoxPlanMapper, UseBoxP
 			LocalDateTime now = LocalDateTime.now();
 			DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 			String formatted = now.format(formatter);
-			List<User> userList = userClient.userListGetByIds(Func.toLongList(res.getData()));
-			for (User item : userList){
-				Message sendMessage = new Message();
-				sendMessage.setParameter(detail.getId() + "");
-				sendMessage.setUserName(AuthUtil.getUserName());
-				sendMessage.setUserId(null);
-				sendMessage.setToUserId(item.getId());
-				sendMessage.setToUserName(item.getName());
-				sendMessage.setMessageType(1);
-				sendMessage.setTenantId(AuthUtil.getTenantId());
-				sendMessage.setCreateUser(null);
-				sendMessage.setCreateTime(new Date());
-				// todo sendMessage.setUrl("");
-				sendMessage.setPageLabel("用箱计划");
-				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
-				sendMessage.setMessageBody("您有新的用箱计划,请及时待处理!单号:" + detail.getSysNo() + "时间:" + formatted);
-				R save = messageClient.save(sendMessage);
-				if (!save.isSuccess()) {
-					throw new SecurityException("发送消息失败");
+			R<List<User>> userListR = userClient.listUserByRoleIds(res.getData());
+			if (userListR.isSuccess() && ObjectUtils.isNotNull(userListR.getData())) {
+				for (User item : userListR.getData()) {
+					Message sendMessage = new Message();
+					sendMessage.setParameter(detail.getId() + "");
+					sendMessage.setUserName(AuthUtil.getUserName());
+					sendMessage.setUserId(null);
+					sendMessage.setToUserId(item.getId());
+					sendMessage.setToUserName(item.getName());
+					sendMessage.setMessageType(1);
+					sendMessage.setTenantId(AuthUtil.getTenantId());
+					sendMessage.setCreateUser(null);
+					sendMessage.setCreateTime(new Date());
+					// todo sendMessage.setUrl("");
+					sendMessage.setPageLabel("用箱计划");
+					sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+					sendMessage.setMessageBody("您有新的用箱计划,请及时待处理!单号:" + detail.getSysNo() + "时间:" + formatted);
+					R save = messageClient.save(sendMessage);
+					if (!save.isSuccess()) {
+						throw new SecurityException("发送消息失败");
+					}
 				}
 			}
 		}
@@ -216,7 +217,7 @@ public class UseBoxPlanServiceImpl extends ServiceImpl<UseBoxPlanMapper, UseBoxP
 			.eq(UseBoxPlanItem::getTenantId, AuthUtil.getTenantId())
 			.eq(UseBoxPlanItem::getIsDeleted, 0)
 			.eq(UseBoxPlanItem::getPid, useBoxPlan.getId()));
-		for (UseBoxPlanItem item : useBoxPlanItemList){
+		for (UseBoxPlanItem item : useBoxPlanItemList) {
 			item.setCreateTime(null);
 			item.setCreateUser(null);
 			item.setCreateUserName(null);

+ 4 - 4
blade-service/blade-los/src/main/java/org/springblade/los/business/amends/service/impl/AmendsServiceImpl.java

@@ -113,7 +113,10 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 		if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
 			deptName = res.getData();
 		}
-		amends.setBillDate(new Date());
+		if (ObjectUtils.isNull(amends.getCreateTime())){
+			amends.setCreateTime(new Date());
+		}
+		amends.setBillDate(amends.getCreateTime());
 		/*if (ObjectUtils.isNotNull(amends.getBillDate())) {
 			LocalDate date = amends.getBillDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
 			int year = date.getYear();
@@ -152,9 +155,6 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
 				return R.fail(500, "生成订单编号失败");
 			}
 			amends.setBillNo((String) clientBillNo.getData());
-			if (ObjectUtils.isNull(amends.getCreateTime())){
-				amends.setCreateTime(new Date());
-			}
 			amends.setCreateUser(AuthUtil.getUserId());
 			amends.setCreateUserName(AuthUtil.getUserName());
 			amends.setBranchId(branchId);

+ 126 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/controller/ReceiptController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.business.receipt.entity.Receipt;
+import org.springblade.los.business.receipt.vo.ReceiptVO;
+import org.springblade.los.business.receipt.service.IReceiptService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 押箱款收据表 控制器
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/receipt")
+@Api(value = "押箱款收据表", tags = "押箱款收据表接口")
+public class ReceiptController extends BladeController {
+
+	private final IReceiptService receiptService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入receipt")
+	public R<Receipt> detail(Receipt receipt) {
+		Receipt detail = receiptService.getOne(Condition.getQueryWrapper(receipt));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 押箱款收据表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入receipt")
+	public R<IPage<Receipt>> list(Receipt receipt, Query query) {
+		IPage<Receipt> pages = receiptService.page(Condition.getPage(query), Condition.getQueryWrapper(receipt));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 押箱款收据表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入receipt")
+	public R<IPage<ReceiptVO>> page(ReceiptVO receipt, Query query) {
+		IPage<ReceiptVO> pages = receiptService.selectReceiptPage(Condition.getPage(query), receipt);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 押箱款收据表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入receipt")
+	public R save(@Valid @RequestBody Receipt receipt) {
+		return R.status(receiptService.save(receipt));
+	}
+
+	/**
+	 * 修改 押箱款收据表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入receipt")
+	public R update(@Valid @RequestBody Receipt receipt) {
+		return R.status(receiptService.updateById(receipt));
+	}
+
+	/**
+	 * 新增或修改 押箱款收据表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入receipt")
+	public R submit(@Valid @RequestBody Receipt receipt) {
+		return R.status(receiptService.saveOrUpdate(receipt));
+	}
+
+	
+	/**
+	 * 删除 押箱款收据表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(receiptService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 42 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/mapper/ReceiptMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.mapper;
+
+import org.springblade.los.business.receipt.entity.Receipt;
+import org.springblade.los.business.receipt.vo.ReceiptVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 押箱款收据表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+public interface ReceiptMapper extends BaseMapper<Receipt> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param receipt
+	 * @return
+	 */
+	List<ReceiptVO> selectReceiptPage(IPage page, ReceiptVO receipt);
+
+}

+ 34 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/mapper/ReceiptMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.los.business.receipt.mapper.ReceiptMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="receiptResultMap" type="org.springblade.los.business.receipt.entity.Receipt">
+        <id column="id" property="id"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="version" property="version"/>
+        <result column="status" property="status"/>
+        <result column="remarks" property="remarks"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="amount" property="amount"/>
+        <result column="date" property="date"/>
+        <result column="branch_name" property="branchName"/>
+        <result column="corp_name" property="corpName"/>
+        <result column="mblno" property="mblno"/>
+        <result column="hblno" property="hblno"/>
+        <result column="cheque_number" property="chequeNumber"/>
+    </resultMap>
+
+
+    <select id="selectReceiptPage" resultMap="receiptResultMap">
+        select * from los_receipt where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/service/IReceiptService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.service;
+
+import org.springblade.los.business.receipt.entity.Receipt;
+import org.springblade.los.business.receipt.vo.ReceiptVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 押箱款收据表 服务类
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+public interface IReceiptService extends IService<Receipt> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param receipt
+	 * @return
+	 */
+	IPage<ReceiptVO> selectReceiptPage(IPage<ReceiptVO> page, ReceiptVO receipt);
+
+}

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/receipt/service/impl/ReceiptServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.business.receipt.service.impl;
+
+import org.springblade.los.business.receipt.entity.Receipt;
+import org.springblade.los.business.receipt.vo.ReceiptVO;
+import org.springblade.los.business.receipt.mapper.ReceiptMapper;
+import org.springblade.los.business.receipt.service.IReceiptService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 押箱款收据表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-09-16
+ */
+@Service
+public class ReceiptServiceImpl extends ServiceImpl<ReceiptMapper, Receipt> implements IReceiptService {
+
+	@Override
+	public IPage<ReceiptVO> selectReceiptPage(IPage<ReceiptVO> page, ReceiptVO receipt) {
+		return page.setRecords(baseMapper.selectReceiptPage(page, receipt));
+	}
+
+}

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/BillsMapper.xml

@@ -279,6 +279,9 @@
         <if test="data.hblno != null and data.hblno != ''">
             and hblno like concat('%', #{data.hblno}, '%')
         </if>
+        <if test="data.iqNo != null and data.iqNo != ''">
+            and hblno like concat('%', #{data.iqNo}, '%')
+        </if>
         <if test="data.corpCnName != null and data.corpCnName != ''">
             and (corp_cn_name like concat('%', #{data.corpCnName}, '%') or
             corp_en_name like concat('%', #{data.corpCnName}, '%')or

+ 87 - 33
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -53,6 +53,8 @@ import org.springblade.los.business.amends.entity.Amends;
 import org.springblade.los.business.amends.mapper.AmendsMapper;
 import org.springblade.los.business.files.entity.FilesCenter;
 import org.springblade.los.business.files.service.IFilesCenterService;
+import org.springblade.los.business.receipt.entity.Receipt;
+import org.springblade.los.business.receipt.service.IReceiptService;
 import org.springblade.los.business.release.entity.SeaReleaseBillItems;
 import org.springblade.los.business.sea.dto.WaitingBox;
 import org.springblade.los.business.sea.entity.*;
@@ -156,6 +158,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 
 	private final AmendsMapper amendsMapper;
 
+	private final IReceiptService receiptService;
+
 	@Override
 	public IPage<Bills> selectBillsPage(IPage<Bills> page, Bills bills) {
 		return page.setRecords(baseMapper.selectBillsPage(page, bills));
@@ -2752,8 +2756,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				bills.setEtd(date1);
 			} else if ("SI".equals(bills.getBusinessType())) {
 				bills.setActualEta(date1);
+				bills.setBillDate(date1);
 			}
-			bills.setBillDate(date1);
 		} catch (ParseException e) {
 			throw new RuntimeException(e);
 		}
@@ -4582,6 +4586,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		}
 		copyBills.setSiRemarks("");
 		copyBills.setBusinessType("SE");
+		copyBills.setActualEtd(detail.getEtd());
 		copyBills.setBusinessTypes("海运");
 		copyBills.setSeaType("E");
 		copyBills.setBillType(billType);
@@ -6202,9 +6207,9 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if (!feeCenterList.isEmpty()) {
 			BigDecimal amount = feeCenterList.stream().map(FeeCenter::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
 			BigDecimal amountStl = feeCenterList.stream().map(FeeCenter::getStlTtlAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-			if (amount.compareTo(amountStl) != 0) {
+			/*if (amount.compareTo(amountStl) != 0) {
 				throw new RuntimeException("应收金额:" + amount + "实收金额:" + amountStl + "不等,申请失败");
-			}
+			}*/
 		}
 		LocalDateTime now = LocalDateTime.now();
 		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -6362,46 +6367,95 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 
 	@Override
 	public R confirmPaymentCollection(Bills bills) {
-		if (bills.getId() == null) {
+		if (bills.getIds() == null) {
 			throw new RuntimeException("缺少必要参数");
 		}
-		Bills detail = baseMapper.selectById(bills.getId());
-		if (detail == null) {
+		List<Bills> billsList = baseMapper.selectList(new LambdaQueryWrapper<Bills>()
+			.eq(Bills::getTenantId, AuthUtil.getTenantId())
+			.eq(Bills::getIsDeleted, 0)
+			.in(Bills::getId, Func.toLongList(bills.getIds())));
+		if (billsList.isEmpty()) {
 			throw new RuntimeException("未查到单据信息");
 		}
 		LocalDateTime now = LocalDateTime.now();
 		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 		String formatted = now.format(formatter);
-		//发送消息
-		if (ObjectUtils.isNotNull(bills.getOperatorId())) {
-			R<User> userR = userClient.userInfoById(bills.getOperatorId());
-			if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
-				User datum = userR.getData();
-				Message sendMessage = new Message();
-				sendMessage.setParameter(bills.getId() + "");
-				sendMessage.setUserName(AuthUtil.getUserName());
-				sendMessage.setUserId(null);
-				sendMessage.setToUserId(datum.getId());
-				sendMessage.setToUserName(datum.getName());
-				sendMessage.setMessageType(1);
-				sendMessage.setTenantId(AuthUtil.getTenantId());
-				sendMessage.setCreateUser(null);
-				sendMessage.setCreateTime(new Date());
-				sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
-				sendMessage.setPageLabel("海运进口");
-				sendMessage.setMessageBody("您的海运进口换单押箱款已收款,请及时待处理!分单号:" + bills.getHblno() + "时间:" + formatted);
-				R save = messageClient.save(sendMessage);
-				if (!save.isSuccess()) {
-					throw new SecurityException("发送消息失败");
+		Receipt receipt = new Receipt();
+		receipt.setCreateTime(new Date());
+		receipt.setCreateUserName(AuthUtil.getUserName());
+		receipt.setCreateUser(AuthUtil.getUserId());
+		receipt.setBranchId(billsList.get(0).getBranchId());
+		receipt.setBranchName(billsList.get(0).getBranchName());
+		receipt.setAmount(billsList.stream().map(Bills::getBoxPackingAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
+		receipt.setDate(bills.getHarvestBoxPackingDate());
+		receipt.setCorpName(bills.getCorpName());
+		receipt.setChequeNumber(bills.getChequeNumber());
+		BusinessType businessType = bBusinessTypeService.getOne(new LambdaQueryWrapper<BusinessType>()
+			.select(BusinessType::getId)
+			.eq(BusinessType::getTenantId, AuthUtil.getTenantId())
+			.eq(BusinessType::getIsDeleted, 0)
+			.eq(BusinessType::getStatus, 0)
+			.eq(BusinessType::getCode, "YASJ"));
+		if (businessType == null) {
+			throw new RuntimeException("未找到可用业务类型");
+		}
+		BusinessBillNo businessBillNo = new BusinessBillNo();
+		businessBillNo.setBusinessTypeId(businessType.getId());
+		businessBillNo.setCode("YASJ");
+		businessBillNo.setBranchId(receipt.getBranchId());
+		businessBillNo.setDate(receipt.getDate());
+		R clientBillNo = businessBillNoService.getBillNoLos(businessBillNo);
+		if (!clientBillNo.isSuccess()) {
+			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+			return R.fail(500, "生成订单编号失败");
+		}
+		receipt.setBillNo((String) clientBillNo.getData());
+		StringBuilder mblno = new StringBuilder();
+		StringBuilder hblno = new StringBuilder();
+		for (Bills detail : billsList) {
+			mblno.append(detail.getMblno()).append("/").append(detail.getQuantityCntrDescr()).append(",");
+			if (!"MH".equals(detail.getBillType())){
+				hblno.append(detail.getMblno()).append("/").append(detail.getQuantityCntrDescr()).append(",");
+			}else{
+				hblno.append(detail.getHblno()).append("/").append(detail.getQuantityCntrDescr()).append(",");
+			}
+		}
+		receipt.setMblno(mblno.toString());
+		receipt.setHblno(hblno.toString());
+		receiptService.save(receipt);
+		for (Bills detail : billsList) {
+			//发送消息
+			if (ObjectUtils.isNotNull(bills.getOperatorId())) {
+				R<User> userR = userClient.userInfoById(bills.getOperatorId());
+				if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
+					User datum = userR.getData();
+					Message sendMessage = new Message();
+					sendMessage.setParameter(bills.getId() + "");
+					sendMessage.setUserName(AuthUtil.getUserName());
+					sendMessage.setUserId(null);
+					sendMessage.setToUserId(datum.getId());
+					sendMessage.setToUserName(datum.getName());
+					sendMessage.setMessageType(1);
+					sendMessage.setTenantId(AuthUtil.getTenantId());
+					sendMessage.setCreateUser(null);
+					sendMessage.setCreateTime(new Date());
+					sendMessage.setUrl("/iosBasicData/OceanFreightImport/bills/index");
+					sendMessage.setPageLabel("海运进口");
+					sendMessage.setMessageBody("您的海运进口换单押箱款已收款,请及时待处理!分单号:" + bills.getHblno() + "时间:" + formatted);
+					R save = messageClient.save(sendMessage);
+					if (!save.isSuccess()) {
+						throw new SecurityException("发送消息失败");
+					}
 				}
 			}
+			detail.setHarvestBoxPackingDate(bills.getHarvestBoxPackingDate());
+			detail.setUpdateTime(new Date());
+			detail.setUpdateUser(AuthUtil.getUserId());
+			detail.setUpdateUserName(AuthUtil.getUserName());
+			detail.setIqNo(receipt.getBillNo());
 		}
-		detail.setHarvestBoxPackingDate(bills.getHarvestBoxPackingDate());
-		detail.setUpdateTime(new Date());
-		detail.setUpdateUser(AuthUtil.getUserId());
-		detail.setUpdateUserName(AuthUtil.getUserName());
-		baseMapper.updateById(detail);
-		return R.data(detail);
+		this.updateBatchById(billsList);
+		return R.data(billsList);
 	}
 
 	@Override

+ 18 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

@@ -81,6 +81,24 @@ public class UserClient implements IUserClient {
 	}
 
 	@Override
+	public R<List<User>> listUserByRoleIds(String roleIds) {
+		List<String> idList = Func.toStrList(roleIds);
+		List<User> userList = new ArrayList<>();
+		for (String roleId : idList) {
+			LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
+			userLambdaQueryWrapper
+				.eq(User::getIsDeleted, 0)
+				.apply("find_in_set('" + roleId + "',role_id)")
+				.eq(User::getTenantId, AuthUtil.getTenantId());
+			List<User> users = service.list(userLambdaQueryWrapper);
+			if (!users.isEmpty()) {
+				userList.addAll(users);
+			}
+		}
+		return R.data(userList);
+	}
+
+	@Override
 	@GetMapping(USER_BY_IDS)
 	public List<User> selectUserIds(String userIds) {
 		return service.selectUserIds(userIds);