瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

liyuan 5 月之前
父節點
當前提交
d50a15194c

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

@@ -1987,7 +1987,7 @@ public class Bills implements Serializable {
 	 * 解锁日期
 	 */
 	@ApiModelProperty(value = "解锁日期")
-	private String lockedDate;
+	private Date lockedDate;
 
 	/**
 	 * 临时来源id

+ 20 - 1
blade-service/blade-los/src/main/java/org/springblade/los/business/locks/controller/BillLocksController.java

@@ -33,6 +33,7 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.los.business.locks.entity.BillLocks;
 import org.springblade.los.business.locks.service.IBillLocksService;
 import org.springblade.los.business.locks.vo.BillLocksVO;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -116,7 +117,7 @@ public class BillLocksController extends BladeController {
 	}
 
 	/**
-	 * 新增或修改 业务-业务加解锁明细,各分公司独立
+	 * 新增或修改 业务-业务加解锁明细
 	 */
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
@@ -136,5 +137,23 @@ public class BillLocksController extends BladeController {
 		return R.status(billLocksService.removeByIds(Func.toLongList(ids)));
 	}
 
+	/**
+	 * 加锁
+	 */
+	@PostMapping("/submitLock")
+	@Transactional(rollbackFor = Exception.class)
+	public R submitLock(@Valid @RequestBody BillLocks billLocks) {
+		return billLocksService.submitLock(billLocks);
+	}
+
+	/**
+	 * 解锁
+	 */
+	@GetMapping("/unlock")
+	@Transactional(rollbackFor = Exception.class)
+	public R unlock(@RequestParam("ids") String ids) {
+		return billLocksService.unlock(ids);
+	}
+
 
 }

+ 4 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/locks/service/IBillLocksService.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.los.business.locks.service;
 
+import org.springblade.core.tool.api.R;
 import org.springblade.los.business.locks.entity.BillLocks;
 import org.springblade.los.business.locks.vo.BillLocksVO;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -38,4 +39,7 @@ public interface IBillLocksService extends IService<BillLocks> {
 	 */
 	IPage<BillLocksVO> selectBillLocksPage(IPage<BillLocksVO> page, BillLocksVO billLocks);
 
+    R submitLock(BillLocks billLocks);
+
+	R unlock(String ids);
 }

+ 121 - 3
blade-service/blade-los/src/main/java/org/springblade/los/business/locks/service/impl/BillLocksServiceImpl.java

@@ -16,13 +16,24 @@
  */
 package org.springblade.los.business.locks.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
 import org.springblade.los.business.locks.entity.BillLocks;
-import org.springblade.los.business.locks.vo.BillLocksVO;
 import org.springblade.los.business.locks.mapper.BillLocksMapper;
 import org.springblade.los.business.locks.service.IBillLocksService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.los.business.locks.vo.BillLocksVO;
+import org.springblade.los.business.sea.entity.Bills;
+import org.springblade.los.business.sea.service.IBillsService;
+import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.Date;
+import java.util.List;
 
 /**
  * 业务-业务加解锁明细,各分公司独立 服务实现类
@@ -31,11 +42,118 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  * @since 2025-06-06
  */
 @Service
+@AllArgsConstructor
 public class BillLocksServiceImpl extends ServiceImpl<BillLocksMapper, BillLocks> implements IBillLocksService {
 
+	private final ISysClient sysClient;
+
+	private final IBillsService billsService;
+
 	@Override
 	public IPage<BillLocksVO> selectBillLocksPage(IPage<BillLocksVO> page, BillLocksVO billLocks) {
 		return page.setRecords(baseMapper.selectBillLocksPage(page, billLocks));
 	}
 
+	@Override
+	public R submitLock(BillLocks billLocks) {
+		if (ObjectUtils.isNull(billLocks.getSrcId())) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		if (ObjectUtils.isNull(billLocks.getBusinessType())) {
+			throw new RuntimeException("缺少必要参数");
+		}
+		BillLocks detail = baseMapper.selectOne(new LambdaQueryWrapper<BillLocks>()
+			.eq(BillLocks::getTenantId, AuthUtil.getTenantId())
+			.eq(BillLocks::getIsDeleted, 0)
+			.eq(BillLocks::getSrcId, billLocks.getSrcId()));
+		if ("HYCK,HYJK".contains(billLocks.getBusinessType())) {
+			Bills bills = billsService.getById(billLocks.getSrcId());
+			if (bills == null) {
+				throw new RuntimeException("未查到单据信息");
+			}
+			if (detail != null) {
+				detail.setUpdateTime(new Date());
+				detail.setUpdateUser(AuthUtil.getUserId());
+				detail.setUpdateUserName(AuthUtil.getUserName());
+				detail.setBranchId(bills.getBranchId());
+				detail.setBillNo(bills.getBillNo());
+				detail.setBillDate(bills.getBillDate());
+				detail.setBusinessTypeName(billLocks.getBusinessType());
+				detail.setSrcBillNo(bills.getBillNo());
+				detail.setSrcVesselId(bills.getVesselId());
+				detail.setSrcVesselCnName(bills.getVesselCnName());
+				detail.setSrcVesselEnName(bills.getVesselEnName());
+				detail.setSrcVoyageNo(bills.getVoyageNo());
+				detail.setSrcMblno(bills.getMblno());
+				detail.setSrcRefno(bills.getRefno());
+				detail.setSrcTeamId(Long.parseLong(bills.getTeamId()));
+				detail.setSrcTeamName(bills.getTeamName());
+				detail.setLocked(0);
+				detail.setOperatorId(bills.getOperatorId());
+				detail.setOperatorName(bills.getOperatorName());
+				baseMapper.updateById(detail);
+			} else {
+				billLocks.setCreateTime(new Date());
+				billLocks.setCreateUser(AuthUtil.getUserId());
+				billLocks.setCreateUserName(AuthUtil.getUserName());
+				billLocks.setBranchId(bills.getBranchId());
+				billLocks.setBillNo(bills.getBillNo());
+				billLocks.setBillDate(bills.getBillDate());
+				billLocks.setBusinessTypeName(billLocks.getBusinessType());
+				billLocks.setSrcBillNo(bills.getBillNo());
+				billLocks.setSrcVesselId(bills.getVesselId());
+				billLocks.setSrcVesselCnName(bills.getVesselCnName());
+				billLocks.setSrcVesselEnName(bills.getVesselEnName());
+				billLocks.setSrcVoyageNo(bills.getVoyageNo());
+				billLocks.setSrcMblno(bills.getMblno());
+				billLocks.setSrcRefno(bills.getRefno());
+				billLocks.setSrcTeamId(Long.parseLong(bills.getTeamId()));
+				billLocks.setSrcTeamName(bills.getTeamName());
+				billLocks.setLocked(0);
+				billLocks.setUnlockedCount(0);
+				billLocks.setOperatorId(bills.getOperatorId());
+				billLocks.setOperatorName(bills.getOperatorName());
+				baseMapper.insert(billLocks);
+			}
+			bills.setLocked(1);
+			billsService.updateById(bills);
+		} else if ("KYCK,KYJK".contains(billLocks.getBusinessType())) {
+
+		} else if ("BGSE,BGSI,BGAE,BGAI".contains(billLocks.getBusinessType())) {
+
+		} else {
+			throw new RuntimeException("业务类型错误,请联系管理员");
+		}
+		return R.data("操作成功");
+	}
+
+	@Override
+	public R unlock(String ids) {
+		List<BillLocks> billLocksList = baseMapper.selectList(new LambdaQueryWrapper<BillLocks>()
+			.eq(BillLocks::getTenantId, AuthUtil.getTenantId())
+			.eq(BillLocks::getIsDeleted, 0)
+			.apply("find_in_set(id,'" + ids + "')"));
+		for (BillLocks item : billLocksList) {
+			item.setUnlockedCount(item.getUnlockedCount() + 1);
+			item.setLocked(1);
+			item.setLockedTime(new Date());
+			if ("HYCK,HYJK".contains(item.getBusinessType())) {
+				Bills bills = billsService.getById(item.getSrcId());
+				if (bills == null) {
+					throw new RuntimeException("未查到单据信息");
+				}
+				bills.setLockedDate(new Date());
+				billsService.updateById(bills);
+			} else if ("KYCK,KYJK".contains(item.getBusinessType())) {
+
+			} else if ("BGSE,BGSI,BGAE,BGAI".contains(item.getBusinessType())) {
+
+			} else {
+				throw new RuntimeException("业务类型错误,请联系管理员");
+			}
+		}
+		this.updateBatchById(billLocksList);
+		return R.data("操作成功");
+	}
+
 }

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/mapper/ContainersMapper.java

@@ -45,4 +45,10 @@ public interface ContainersMapper extends BaseMapper<Containers> {
 	 * @param pid
 	 */
 	void removeByPid(@Param("pid") Long pid, @Param("type")String type);
+
+	/**
+	 * 通过主表id删除
+	 * @param pid
+	 */
+	void deleteByPid(@Param("pid") Long pid);
 }

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

@@ -77,6 +77,9 @@
         update los_sea_containers set is_deleted = '1' where pid = #{pid} and cntr_type_code = #{type}
     </update>
 
+    <update id="deleteByPid">
+        update los_sea_containers set is_deleted = '1' where pid = #{pid}
+    </update>
 
     <select id="selectContainersPage" resultMap="containersResultMap">
         select * from los_sea_containers where is_deleted = 0

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/IContainersService.java

@@ -64,6 +64,12 @@ public interface IContainersService extends IService<Containers> {
 	void removeByPid(Long pid,String type);
 
 	/**
+	 * 通过主表id删除
+	 * @param pid
+	 */
+	void deleteByPid(Long pid);
+
+	/**
 	 * 清除箱号
 	 * @param containersList
 	 * @return

+ 5 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/ContainersServiceImpl.java

@@ -225,6 +225,11 @@ public class ContainersServiceImpl extends ServiceImpl<ContainersMapper, Contain
 	}
 
 	@Override
+	public void deleteByPid(Long pid) {
+		baseMapper.deleteByPid(pid);
+	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public R cleanBoxNo(List<Long> ids) {
 		List<Containers> containersList = this.list(new LambdaQueryWrapper<Containers>()

文件差異過大導致無法顯示
+ 464 - 123
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/TemplateImportServiceImpl.java


+ 3 - 2
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/service/impl/FinAccBillsServiceImpl.java

@@ -234,7 +234,8 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 			data.setBusinessBillId(item.getPid());
 			data.setBusinessBillNo(item.getBillNo());
 			data.setBusinessDate(item.getBillDate());
-			if ("SEA,SIA,AEA,AIA".contains(item.getBusinessType())) {
+			if ("SEA".equals(item.getBusinessType()) || "SIA".equals(item.getBusinessType())
+			|| "AEA".equals(item.getBusinessType()) || "AIA".equals(item.getBusinessType())) {
 				Amends amends = amendsList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(new Amends());
 				data.setSrcId(amends.getSrcId());
 				data.setSrcCnName(amends.getSrcCnName());
@@ -243,7 +244,7 @@ public class FinAccBillsServiceImpl extends ServiceImpl<FinAccBillsMapper, FinAc
 				data.setOperatorId(amends.getOperatorId());
 				data.setOperatorName(amends.getOperatorName());
 				data.setQuantityCntrDescr(amends.getQuantityCntrDescr());
-			} else if ("SE,SI".contains(item.getBusinessType())) {
+			} else if ("SE".equals(item.getBusinessType()) || "SI".equals(item.getBusinessType())) {
 				Bills bills = billsList.stream().filter(e -> e.getId().equals(item.getPid())).findFirst().orElse(new Bills());
 				data.setSrcId(bills.getSrcId());
 				data.setSrcCnName(bills.getSrcCnName());

部分文件因文件數量過多而無法顯示