Browse Source

1.往来单位获取首字母排序逻辑去掉
2.海运进出口导出增加邮箱
3.首页趋势图统计查询条件修改
4.海运进出口商品黑名单逻辑注释
5.业务数据修改,主表billDate修改
6.ftp文件端口改为动态获取

纪新园 4 months ago
parent
commit
cd655358f3

+ 2 - 2
blade-service/blade-los/src/main/java/org/springblade/los/basic/corps/service/impl/BCorpsServiceImpl.java

@@ -120,11 +120,11 @@ public class BCorpsServiceImpl extends ServiceImpl<CorpsMapper, BCorps> implemen
 			.eq(BCorps::getTenantId, AuthUtil.getTenantId())
 			.eq(BCorps::getIsDeleted, 0));
 		//首字母为空
-		if (null == bCorps.getInitials() || bCorps.getInitials().isEmpty()) {
+		/*if (null == bCorps.getInitials() || bCorps.getInitials().isEmpty()) {
 			//获得名称首字母
 			String initials = getSpells(bCorps.getCnName());
 			bCorps.setInitials(initials.substring(0, 1));
-		}
+		}*/
 		if (bCorps.getId() == null) {
 			if (!cname.isEmpty()) {
 				throw new RuntimeException("中文名称不允许重复");

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

@@ -788,6 +788,7 @@
                 WHERE
                     sea.is_deleted = 0
                   AND pre.is_deleted = 0
+                  AND sea.bill_type in ('MH','DD')
         <if test="deptPid!=null">
             AND sea.branch_id = #{deptPid}
         </if>

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

@@ -226,7 +226,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 				throw new RuntimeException("该客户为黑名单客户,保存失败");
 			}
 		}
-		if (ObjectUtils.isNotNull(bills.getHscode())) {
+		/*if (ObjectUtils.isNotNull(bills.getHscode())) {
 			BCommodity commodity = commodityMapper.selectOne(new LambdaQueryWrapper<BCommodity>()
 				.eq(BCommodity::getTenantId, AuthUtil.getTenantId())
 				.eq(BCommodity::getIsDeleted, 0)
@@ -235,7 +235,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 			if ("D".equals(commodity.getCreditLevel())) {
 				throw new RuntimeException("该商品为黑名单商品,保存失败");
 			}
-		}
+		}*/
 		if (bills.getId() == null) {
 			if (!"MH".equals(bills.getBillType())) {
 				if (ObjectUtils.isNotNull(bills.getMblno())) {
@@ -5310,6 +5310,34 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		bills.setUpdateTime(new Date());
 		bills.setIssueStatus("0");
 		baseMapper.updateById(bills);
+		Bills detail = baseMapper.selectById(bills.getId());
+		if (detail != null && ObjectUtils.isNotNull(detail.getCustomerServiceId())) {
+			R<User> res = userClient.userInfoById(detail.getCustomerServiceId());
+			if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+				LocalDateTime now = LocalDateTime.now();
+				DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+				String formatted = now.format(formatter);
+				Message sendMessage = new Message();
+				sendMessage.setParameter(detail.getId() + "");
+				sendMessage.setUserName(AuthUtil.getUserName());
+				sendMessage.setUserId(null);
+				sendMessage.setToUserId(res.getData().getId());
+				sendMessage.setToUserName(res.getData().getName());
+				sendMessage.setMessageType(1);
+				sendMessage.setTenantId(AuthUtil.getTenantId());
+				sendMessage.setCreateUser(null);
+				sendMessage.setCreateTime(new Date());
+				sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
+				sendMessage.setPageLabel("海运出口");
+				sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
+				sendMessage.setMessageBody("客户已撤销订舱,请及时待处理!订舱单号:" + (ObjectUtils.isNull(bills.getHblno())
+					?bills.getBillNo():bills.getHblno()) + "时间:" + formatted);
+				R save = messageClient.save(sendMessage);
+				if (!save.isSuccess()) {
+					throw new SecurityException("发送消息失败");
+				}
+			}
+		}
 		return R.data(bills);
 	}
 
@@ -6093,7 +6121,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
 					sendMessage.setPageLabel("海运出口");
 					sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
-					sendMessage.setMessageBody("客户已撤销订舱,请及时待处理!订舱单号:" + bills.getBillNo() + "时间:" + formatted);
+					sendMessage.setMessageBody("客户已退舱,请及时待处理!订舱单号:" + (ObjectUtils.isNull(bills.getHblno())
+						?bills.getBillNo():bills.getHblno()) + "时间:" + formatted);
 					R save = messageClient.save(sendMessage);
 					if (!save.isSuccess()) {
 						throw new SecurityException("发送消息失败");
@@ -6119,7 +6148,7 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 					sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
 					sendMessage.setPageLabel("海运出口");
 					sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
-					sendMessage.setMessageBody("客户已撤销订舱,请及时待处理!订舱单号:" + bills.getBillNo() + "时间:" + formatted);
+					sendMessage.setMessageBody("客户已退舱,请及时待处理!订舱单号:" + bills.getBillNo() + "时间:" + formatted);
 					R save = messageClient.save(sendMessage);
 					if (!save.isSuccess()) {
 						throw new SecurityException("发送消息失败");

+ 3 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/update/service/impl/UpdateServiceImpl.java

@@ -622,6 +622,9 @@ public class UpdateServiceImpl extends ServiceImpl<UpdateMapper, Update> impleme
 			try {
 				Date date = sdf.parse(item.getFieldValueNew());
 				fieldId.set(bills, date);
+				if ("etd,eta".contains(item.getField())){
+					bills.setBillDate(date);
+				}
 			} catch (ParseException e) {
 				e.printStackTrace();
 			}

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/excel/BillsExcel.java

@@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springblade.los.utils.LosSpecialHandle;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -353,6 +354,11 @@ public class BillsExcel implements Serializable {
 	@ExcelProperty(value = "审核状态")
 	private String status;
 	/**
+	 * 文件联络人邮箱
+	 */
+	@ExcelProperty(value = "文件联络人邮箱")
+	private String fileEmail;
+	/**
 	 * 备注
 	 */
 	@ExcelProperty(value = "备注")

+ 4 - 4
blade-service/blade-los/src/main/java/org/springblade/los/ftp/service/impl/CyFtpServiceImpl.java

@@ -66,7 +66,7 @@ public class CyFtpServiceImpl implements CyFtpService {
 	public R ftpFilesHandle(Long corpId, String type) {
 		BCorps bCorps = bCorpsService.getById(corpId);
 		String server = bCorps.getEdiFtp();
-		int port = 21;
+		String port = bCorps.getPortFtp();
 		String user = bCorps.getUsernameFtp();
 		String pass = bCorps.getPasswordFtp();
 		String remoteDir = "/WFL";
@@ -82,7 +82,7 @@ public class CyFtpServiceImpl implements CyFtpService {
 		FTPClient ftpClient = new FTPClient();
 		try {
 			// 连接FTP服务器
-			ftpClient.connect(server, port);
+			ftpClient.connect(server, Integer.parseInt(port));
 			ftpClient.login(user, pass);
 			ftpClient.enterLocalPassiveMode();
 			ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
@@ -252,7 +252,7 @@ public class CyFtpServiceImpl implements CyFtpService {
 	public R ftpFilescopy(Long corpId, List<String> filesName, String type) {
 		BCorps bCorps = bCorpsService.getById(corpId);
 		String server = bCorps.getEdiFtp();
-		int port = 21;
+		String port = bCorps.getEdiFtp();
 		String user = bCorps.getUsernameFtp();
 		String pass = bCorps.getPasswordFtp();
 		String remoteDir = "/WFL";
@@ -265,7 +265,7 @@ public class CyFtpServiceImpl implements CyFtpService {
 		FTPClient ftpClient = new FTPClient();
 		try {
 			// 连接FTP服务器
-			ftpClient.connect(server, port);
+			ftpClient.connect(server, Integer.parseInt(port));
 			ftpClient.login(user, pass);
 			ftpClient.enterLocalPassiveMode();
 			ftpClient.setFileType(FTP.BINARY_FILE_TYPE);