commit bc6c938b8cf821070dbea408439845961c48d7bb Author: dengjun Date: Mon Nov 11 13:41:54 2024 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e27560 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/.idea/ +/logs/ +/wsnet-cargo-sharing-core/target/ +/wsnet-cargo-sharing-core/.flattened-pom.xml +/wsnet-cargo-sharing-gateway/target/ +/wsnet-cargo-sharing-gateway/.flattened-pom.xml +/wsnet-cargo-sharing-oauth-service/target/ +/wsnet-cargo-sharing-oauth-service/.flattened-pom.xml +/wsnet-cargo-sharing-service/target/ +/wsnet-cargo-sharing-service/.flattened-pom.xml +/.flattened-pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7143fcc --- /dev/null +++ b/pom.xml @@ -0,0 +1,106 @@ + + + 4.0.0 + + com.wsnet + cargo-sharing-platform + pom + ${revision} + + wsnet-cargo-sharing-oauth-service + wsnet-cargo-sharing-service + wsnet-cargo-sharing-gateway + wsnet-cargo-sharing-core + + + + 2024.08.30 + 1.0 + 3.2.5 + 17 + 17 + UTF-8 + + + + + + + com.wsnet + wsnet-boot3-platform + ${wsnet-platform.version} + pom + import + + + org.postgresql + postgresql + 42.7.4 + + + + org.mapstruct + mapstruct + 1.6.2 + + + + org.mapstruct + mapstruct-processor + 1.6.2 + + + com.wsnet + wsnet-cargo-sharing-core + ${revision} + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + -parameters + + + + + + org.codehaus.mojo + flatten-maven-plugin + 1.5.0 + + resolveCiFriendliesOnly + true + + + + + flatten + + flatten + process-resources + + + + clean + + flatten.clean + clean + + + + + + + \ No newline at end of file diff --git a/wsnet-cargo-sharing-core/pom.xml b/wsnet-cargo-sharing-core/pom.xml new file mode 100644 index 0000000..b8adc4a --- /dev/null +++ b/wsnet-cargo-sharing-core/pom.xml @@ -0,0 +1,28 @@ + + + + cargo-sharing-platform + com.wsnet + ${revision} + + 4.0.0 + jar + wsnet-cargo-sharing-core + + + 17 + 17 + UTF-8 + + + + + + com.wsnet + wsnet-core + + + + \ No newline at end of file diff --git a/wsnet-cargo-sharing-core/src/main/java/com/wsnet/dto/CargoApiUser.java b/wsnet-cargo-sharing-core/src/main/java/com/wsnet/dto/CargoApiUser.java new file mode 100644 index 0000000..cf2aabf --- /dev/null +++ b/wsnet-cargo-sharing-core/src/main/java/com/wsnet/dto/CargoApiUser.java @@ -0,0 +1,22 @@ +package com.wsnet.dto; + +import com.wsnet.core.api.ApiUser; +import lombok.Data; + +/** + * 对登录用户进行扩展 + */ +@Data +public class CargoApiUser extends ApiUser { + // 企业ID + private Long enterpriseId; + + // 企业名称 + private String enterpriseName; + + // 用户所在的港口 + private Long portId; + + // 用户所在的码头 + private Long wharfId; +} diff --git a/wsnet-cargo-sharing-gateway/pom.xml b/wsnet-cargo-sharing-gateway/pom.xml new file mode 100644 index 0000000..6ce82df --- /dev/null +++ b/wsnet-cargo-sharing-gateway/pom.xml @@ -0,0 +1,82 @@ + + + + cargo-sharing-platform + com.wsnet + ${revision} + + 4.0.0 + + wsnet-cargo-sharing-gateway + + + 17 + 17 + UTF-8 + + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + + org.springframework.cloud + spring-cloud-starter-gateway + + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + com.github.xiaoymin + knife4j-gateway-spring-boot-starter + 4.5.0 + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + 4.5.0 + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + repackage + + repackage + + + + + + + + \ No newline at end of file diff --git a/wsnet-cargo-sharing-gateway/src/main/java/com/wsnet/cargo/gateway/GatewayApplication.java b/wsnet-cargo-sharing-gateway/src/main/java/com/wsnet/cargo/gateway/GatewayApplication.java new file mode 100644 index 0000000..c82eef1 --- /dev/null +++ b/wsnet-cargo-sharing-gateway/src/main/java/com/wsnet/cargo/gateway/GatewayApplication.java @@ -0,0 +1,14 @@ +package com.wsnet.cargo.gateway; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@SpringBootApplication +@EnableDiscoveryClient +public class GatewayApplication { + public static void main(String[] args) { + SpringApplication.run(GatewayApplication.class, args); + } +} diff --git a/wsnet-cargo-sharing-gateway/src/main/resources/application.yml b/wsnet-cargo-sharing-gateway/src/main/resources/application.yml new file mode 100644 index 0000000..6100c10 --- /dev/null +++ b/wsnet-cargo-sharing-gateway/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + profiles: + active: dev # 表示生产环境 \ No newline at end of file diff --git a/wsnet-cargo-sharing-gateway/src/main/resources/bootstrap.yml b/wsnet-cargo-sharing-gateway/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..8528adf --- /dev/null +++ b/wsnet-cargo-sharing-gateway/src/main/resources/bootstrap.yml @@ -0,0 +1,14 @@ +spring: + application: + name: wsnet-gateway-server + cloud: + nacos: + discovery: + server-addr: localhost:8848 #Nacos服务注册中心地址 + config: + server-addr: localhost:8848 #Nacos作为配置中心地址 + file-extension: yaml #指定yaml格式的配置 + group: DEFAULT_GROUP + namespace: 79855585-5921-4b8b-bfb6-ff502c66f19a + username: nacos + password: nacos diff --git a/wsnet-cargo-sharing-oauth-service/pom.xml b/wsnet-cargo-sharing-oauth-service/pom.xml new file mode 100644 index 0000000..936d760 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/pom.xml @@ -0,0 +1,81 @@ + + + + cargo-sharing-platform + com.wsnet + ${revision} + + 4.0.0 + + wsnet-cargo-sharing-oauth-service + + + 17 + 17 + UTF-8 + + + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.wsnet + wsnet-user-service + + + com.wsnet + wsnet-log-starter + + + org.postgresql + postgresql + + + com.wsnet + wsnet-cargo-sharing-core + + + com.aliyun + dysmsapi20170525 + 3.0.0 + + + org.springframework.boot + spring-boot-starter-test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + repackage + + repackage + + + + + + + + \ No newline at end of file diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/OauthServiceApplication.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/OauthServiceApplication.java new file mode 100644 index 0000000..66832f7 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/OauthServiceApplication.java @@ -0,0 +1,14 @@ +package com.wsnet.user; + +import com.wsnet.launcher.launcher.LauncherApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@SpringBootApplication +@EnableDiscoveryClient +public class OauthServiceApplication { + + public static void main(String[] args) { + LauncherApplication.run("wsnet-oauth-server", OauthServiceApplication.class, args); + } +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/config/SmsConfig.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/config/SmsConfig.java new file mode 100644 index 0000000..3413bfd --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/config/SmsConfig.java @@ -0,0 +1,23 @@ +package com.wsnet.user.config; + +import com.aliyun.teaopenapi.models.Config; +import com.aliyun.dysmsapi20170525.Client; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SmsConfig { + @Bean + public Client client(SmsProperties properties) throws Exception { + Config config = new Config() + // 配置 AccessKey ID,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。 + .setAccessKeyId("LTAI5tEhpW5Z17Z9ZkLJAuXg") + // 配置 AccessKey Secret,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。 + .setAccessKeySecret("SAwwJNRlvDTGH0KbVf6fJ4h4xX0wfH"); + + // 配置 Endpoint + config.endpoint = "dysmsapi.aliyuncs.com"; + + return new Client(config); + } +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/config/SmsProperties.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/config/SmsProperties.java new file mode 100644 index 0000000..13fb79e --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/config/SmsProperties.java @@ -0,0 +1,13 @@ +package com.wsnet.user.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component +@ConfigurationProperties(prefix = "launcher.sms") +public class SmsProperties { + private String accessKeyId; + private String accessKeySecret; +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/controller/LoginController.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/controller/LoginController.java new file mode 100644 index 0000000..a798d90 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/controller/LoginController.java @@ -0,0 +1,70 @@ +package com.wsnet.user.controller; + +import com.wsnet.core.api.ApiUser; +import com.wsnet.dto.CargoApiUser; +import com.wsnet.user.entity.DictEmployee; +import com.wsnet.user.entity.DictEnterprise; +import com.wsnet.user.login.AbstractUserLoginController; +import com.wsnet.user.service.DictEmployeeService; +import com.wsnet.user.service.DictEnterpriseService; +import com.wsnet.web.exception.AclException; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +@RestController +@Tag(name = "用户登录") +public class LoginController extends AbstractUserLoginController { + + @Resource + private DictEnterpriseService enterpriseService; + + @Resource + private DictEmployeeService employeeService; + + @Override + protected List getAuthPkgs() { + List pkgs = new ArrayList<>(); + pkgs.add("com.wsnet.cargo.controller"); + return pkgs; + } + + @Override + protected ApiUser extendLoginUser(ApiUser apiUser) { + CargoApiUser user = new CargoApiUser(); + BeanUtils.copyProperties(apiUser, user); + + // 获取用户企业信息 + Optional enterprise = enterpriseService.lambdaQuery().eq(DictEnterprise::getUserId, Long.valueOf(apiUser.getId())).oneOpt(); + if (enterprise.isPresent()) { // 管理员登录 + DictEnterprise e = enterprise.get(); + if (!StringUtils.equals(e.getEnterpriseStatus(), "1")) { + throw new AclException("企业处于非正常状态,不允许登录"); + } + user.setEnterpriseId(e.getId()); + user.setEnterpriseName(e.getName()); + user.setPortId(e.getPortId()); + } else { // 普通用户登录 + Optional employee = employeeService.lambdaQuery().eq(DictEmployee::getUserId, Long.valueOf(apiUser.getId())).oneOpt(); + if (employee.isPresent()) { + DictEmployee e = employee.get(); + user.setWharfId(e.getWharfId()); + + DictEnterprise enterprise1 = enterpriseService.getById(e.getEnterpriseId()); + if (!StringUtils.equals(enterprise1.getEnterpriseStatus(), "1")) { + throw new AclException("企业处于非正常状态,不允许登录"); + } + user.setEnterpriseId(enterprise1.getId()); + user.setEnterpriseName(enterprise1.getName()); + user.setPortId(enterprise1.getPortId()); + } + } + return user; + } +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/controller/UserRegController.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/controller/UserRegController.java new file mode 100644 index 0000000..7256117 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/controller/UserRegController.java @@ -0,0 +1,102 @@ +package com.wsnet.user.controller; + +import com.wsnet.core.annotation.Anonymous; +import com.wsnet.core.annotation.InternalInterface; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.core.response.ResultData; +import com.wsnet.user.entity.SysRole; +import com.wsnet.user.entity.SysUser; +import com.wsnet.user.entity.SysUserRole; +import com.wsnet.user.enums.RoleTypeEnum; +import com.wsnet.user.service.SysRoleService; +import com.wsnet.user.service.SysUserRoleService; +import com.wsnet.user.service.SysUserService; +import com.wsnet.web.cache.PojoCache; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Optional; + +@RestController +@Tag(name = "用户注册") +public class UserRegController { + + @Resource + protected PojoCache pojoCache; + + @Resource + private SysUserService userService; + + @Resource + private SysRoleService roleService; + + @Resource + private SysUserRoleService userRoleService; + + @Anonymous + @InternalInterface + @PostMapping("/user/reg") + @Operation(summary = "用户注册") + @Transactional(rollbackFor = Exception.class) + public ResultData register(@RequestBody @Validated SysUser user) { + if (user.getId() != null) { + // 移除缓存 + pojoCache.getEntityCache().remove(String.valueOf(user.getId())); + } + + // 验证用户名是否已经存在 + boolean exists = userService.lambdaQuery().eq(SysUser::getUsername, user.getUsername()).exists(); + if (exists) { + return ResultData.fail("用户名已经存在"); + } + + // 验证手机号码是否已经存在 + exists = userService.lambdaQuery().eq(SysUser::getPhone, user.getPhone()).exists(); + if (exists) { + return ResultData.fail("电话号码已经存在"); + } + + String userType = user.getOpenId(); + user.setOpenId(null); + + userService.save(user); + + String code = StringUtils.equals(userType, "admin") ? "enterprise_admin" : "enterprise_user"; + + // 分配角色 + Optional admin = roleService.lambdaQuery().eq(SysRole::getCode, code) + .eq(SysRole::getDstatus, StatusEnums.active) + .oneOpt(); + + Long roleId = null; + if (!admin.isPresent()) { + // 创建角色 + SysRole role = new SysRole(); + role.setCode(code); + role.setName(StringUtils.equals(userType, "admin") ? "企业管理员" : "企业用户"); + role.setType(RoleTypeEnum.COMMON); + role.setDstatus(StatusEnums.active); + + roleService.save(role); + + roleId = role.getId(); + } else { + roleId = admin.get().getId(); + } + + SysUserRole userRole = new SysUserRole(); + userRole.setUserId(user.getId()); + userRole.setRoles(roleId + ""); + + userRoleService.save(userRole); + + return ResultData.success(user.getId()); + } +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/entity/DictEmployee.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/entity/DictEmployee.java new file mode 100644 index 0000000..3bbf1cd --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/entity/DictEmployee.java @@ -0,0 +1,62 @@ +package com.wsnet.user.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import lombok.Data; + +/** + * 企业员工 + * @TableName dict_employee + */ +@TableName(value ="dict_employee") +@Data +public class DictEmployee extends BaseEntity implements Serializable { + /** + * 企业ID + */ + @TableField(value = "enterprise_id") + private Long enterpriseId; + + /** + * 姓名 + */ + @TableField(value = "name") + private String name; + + /** + * 昵称 + */ + @TableField(value = "nickname") + private String nickname; + + /** + * 用户名 + */ + @TableField(value = "username") + private String username; + + /** + * 码头ID + */ + @TableField(value = "wharf_id") + private Long wharfId; + + /** + * 绑定用户ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 状态 + */ + @TableField(value = "status") + private StatusEnums status; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/entity/DictEnterprise.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/entity/DictEnterprise.java new file mode 100644 index 0000000..0062103 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/entity/DictEnterprise.java @@ -0,0 +1,96 @@ +package com.wsnet.user.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import lombok.Data; + +/** + * 企业 + * @TableName dict_enterprise + */ +@TableName(value ="dict_enterprise") +@Data +public class DictEnterprise extends BaseEntity implements Serializable { + /** + * 企业名称 + */ + @TableField(value = "name") + private String name; + + /** + * 企业编码 + */ + @TableField(value = "code") + private String code; + + /** + * 详细地址 + */ + @TableField(value = "address") + private String address; + + /** + * 法人代表 + */ + @TableField(value = "legal_person") + private String legalPerson; + + /** + * 合同编号 + */ + @TableField(value = "contract_no") + private String contractNo; + + /** + * 联系人 + */ + @TableField(value = "linkman") + private String linkman; + + /** + * 联系电话 + */ + @TableField(value = "phone") + private String phone; + + /** + * 审核状态 + */ + @TableField(value = "enterprise_status") + private String enterpriseStatus; + + /** + * 关联登录账号ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 绑定的港口ID + */ + @TableField(value = "port_id") + private Long portId; + + /** + * 企业类别 + */ + @TableField(value = "enterprise_type") + private String enterpriseType; + + /** + * 营业执照图片 + */ + @TableField(value = "license_photo") + private String licensePhoto; + + /** + * 身份证图片 + */ + @TableField(value = "id_photo") + private String idPhoto; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/mapper/DictEmployeeMapper.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/mapper/DictEmployeeMapper.java new file mode 100644 index 0000000..70bfbad --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/mapper/DictEmployeeMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.user.mapper; + +import com.wsnet.user.entity.DictEmployee; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_employee(企业员工)】的数据库操作Mapper +* @createDate 2024-10-24 09:16:15 +* @Entity com.wsnet.user.entity.DictEmployee +*/ +public interface DictEmployeeMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/mapper/DictEnterpriseMapper.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/mapper/DictEnterpriseMapper.java new file mode 100644 index 0000000..310ec2c --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/mapper/DictEnterpriseMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.user.mapper; + +import com.wsnet.user.entity.DictEnterprise; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_enterprise(企业)】的数据库操作Mapper +* @createDate 2024-10-24 09:16:15 +* @Entity com.wsnet.user.entity.DictEnterprise +*/ +public interface DictEnterpriseMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/DictEmployeeService.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/DictEmployeeService.java new file mode 100644 index 0000000..7b780e0 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/DictEmployeeService.java @@ -0,0 +1,13 @@ +package com.wsnet.user.service; + +import com.wsnet.user.entity.DictEmployee; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_employee(企业员工)】的数据库操作Service +* @createDate 2024-10-24 09:16:15 +*/ +public interface DictEmployeeService extends IService { + +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/DictEnterpriseService.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/DictEnterpriseService.java new file mode 100644 index 0000000..8f80544 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/DictEnterpriseService.java @@ -0,0 +1,13 @@ +package com.wsnet.user.service; + +import com.wsnet.user.entity.DictEnterprise; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_enterprise(企业)】的数据库操作Service +* @createDate 2024-10-24 09:16:15 +*/ +public interface DictEnterpriseService extends IService { + +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/DictEmployeeServiceImpl.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/DictEmployeeServiceImpl.java new file mode 100644 index 0000000..75b6e87 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/DictEmployeeServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.user.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.user.entity.DictEmployee; +import com.wsnet.user.service.DictEmployeeService; +import com.wsnet.user.mapper.DictEmployeeMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_employee(企业员工)】的数据库操作Service实现 +* @createDate 2024-10-24 09:16:15 +*/ +@Service +public class DictEmployeeServiceImpl extends ServiceImpl + implements DictEmployeeService{ + +} + + + + diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/DictEnterpriseServiceImpl.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/DictEnterpriseServiceImpl.java new file mode 100644 index 0000000..c8967bb --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/DictEnterpriseServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.user.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.user.entity.DictEnterprise; +import com.wsnet.user.service.DictEnterpriseService; +import com.wsnet.user.mapper.DictEnterpriseMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_enterprise(企业)】的数据库操作Service实现 +* @createDate 2024-10-24 09:16:15 +*/ +@Service +public class DictEnterpriseServiceImpl extends ServiceImpl + implements DictEnterpriseService{ + +} + + + + diff --git a/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/SmsServiceImpl.java b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/SmsServiceImpl.java new file mode 100644 index 0000000..0ffc4b8 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/java/com/wsnet/user/service/impl/SmsServiceImpl.java @@ -0,0 +1,32 @@ +package com.wsnet.user.service.impl; + +import cn.hutool.core.util.RandomUtil; +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.SendSmsRequest; +import com.aliyun.dysmsapi20170525.models.SendSmsResponse; +import com.wsnet.user.service.SmsService; +import jakarta.annotation.Resource; +import lombok.SneakyThrows; + +public class SmsServiceImpl implements SmsService { + + @Resource + private Client client; + + @SneakyThrows + @Override + public String sendSms(String phone) { + String code = RandomUtil.randomNumbers(4); + // 构造请求对象,请填入请求参数值 + SendSmsRequest sendSmsRequest = new SendSmsRequest() + .setPhoneNumbers(phone) + .setSignName("瑞通智慧科技") + .setTemplateCode("SMS_305459771") + .setTemplateParam("{\"code\":\""+code+"\"}"); + + // 获取响应对象 + SendSmsResponse sendSmsResponse = client.sendSms(sendSmsRequest); + + return code; + } +} diff --git a/wsnet-cargo-sharing-oauth-service/src/main/resources/application.yml b/wsnet-cargo-sharing-oauth-service/src/main/resources/application.yml new file mode 100644 index 0000000..1602baa --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/resources/application.yml @@ -0,0 +1,11 @@ +spring: + profiles: + active: dev # 表示生产环境 + +logging: + level: + org.springframework.security: debug + org.springframework.security.oauth2: debug + org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping: trace + org.springframework.security.web.FilterChainProxy: trace + org.springframework.security.web.access.ExceptionTranslationFilter: trace \ No newline at end of file diff --git a/wsnet-cargo-sharing-oauth-service/src/main/resources/bootstrap.yml b/wsnet-cargo-sharing-oauth-service/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..9dd5e3e --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/resources/bootstrap.yml @@ -0,0 +1,14 @@ +spring: + application: + name: wsnet-oauth-server + cloud: + nacos: + discovery: + server-addr: localhost:8848 #Nacos服务注册中心地址 + config: + server-addr: localhost:8848 #Nacos作为配置中心地址 + file-extension: yaml #指定yaml格式的配置 + group: DEFAULT_GROUP + namespace: 79855585-5921-4b8b-bfb6-ff502c66f19a + username: nacos + password: nacos diff --git a/wsnet-cargo-sharing-oauth-service/src/main/resources/config/logback-spring.xml b/wsnet-cargo-sharing-oauth-service/src/main/resources/config/logback-spring.xml new file mode 100644 index 0000000..9046042 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/resources/config/logback-spring.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + UTF-8 + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/${log.name}-debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 7 + + + + + debug + ACCEPT + DENY + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/${log.name}-info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 1 + + + + info + ACCEPT + DENY + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/${log.name}-warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 1 + + + + warn + ACCEPT + DENY + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/${log.name}-error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 1 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + diff --git a/wsnet-cargo-sharing-oauth-service/src/main/resources/mapper/DictEmployeeMapper.xml b/wsnet-cargo-sharing-oauth-service/src/main/resources/mapper/DictEmployeeMapper.xml new file mode 100644 index 0000000..e30bf4a --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/resources/mapper/DictEmployeeMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + enterprise_id,name,nickname, + username,wharf_id,user_id, + status + + diff --git a/wsnet-cargo-sharing-oauth-service/src/main/resources/mapper/DictEnterpriseMapper.xml b/wsnet-cargo-sharing-oauth-service/src/main/resources/mapper/DictEnterpriseMapper.xml new file mode 100644 index 0000000..1881549 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/main/resources/mapper/DictEnterpriseMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,address, + legal_person,contract_no,linkman, + phone,enterprise_status,user_id, + port_id,enterprise_type,license_photo, + id_photo + + diff --git a/wsnet-cargo-sharing-oauth-service/src/test/java/com/wsnet/user/service/DictEmployeeServiceTest.java b/wsnet-cargo-sharing-oauth-service/src/test/java/com/wsnet/user/service/DictEmployeeServiceTest.java new file mode 100644 index 0000000..cbfb347 --- /dev/null +++ b/wsnet-cargo-sharing-oauth-service/src/test/java/com/wsnet/user/service/DictEmployeeServiceTest.java @@ -0,0 +1,33 @@ +package com.wsnet.user.service; + +import cn.hutool.core.util.RandomUtil; +import com.alibaba.fastjson2.JSONObject; +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.SendSmsRequest; +import com.aliyun.dysmsapi20170525.models.SendSmsResponse; +import jakarta.annotation.Resource; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DictEmployeeServiceTest { + @Resource + private Client client; + + @Test + public void sentMsg() throws Exception { + String code = RandomUtil.randomNumbers(4); + // 构造请求对象,请填入请求参数值 + SendSmsRequest sendSmsRequest = new SendSmsRequest() + .setPhoneNumbers("13120665928") + .setSignName("瑞通智慧科技") + .setTemplateCode("SMS_305459771") + .setTemplateParam("{\"code\":\""+code+"\"}"); + + // 获取响应对象 + SendSmsResponse sendSmsResponse = client.sendSms(sendSmsRequest); + + // 响应包含服务端响应的 body 和 headers + System.out.println(JSONObject.toJSONString(sendSmsResponse)); + } +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/pom.xml b/wsnet-cargo-sharing-service/pom.xml new file mode 100644 index 0000000..d6f2c93 --- /dev/null +++ b/wsnet-cargo-sharing-service/pom.xml @@ -0,0 +1,103 @@ + + + + cargo-sharing-platform + com.wsnet + ${revision} + + 4.0.0 + + wsnet-cargo-sharing-service + + + 17 + 17 + UTF-8 + + + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.wsnet + wsnet-authorization-server-starter + + + com.wsnet + wsnet-web-starter + + + com.wsnet + wsnet-log-starter + + + com.wsnet + wsnet-user-api + + + com.wsnet + wsnet-feign-starter + + + org.postgresql + postgresql + + + com.wsnet + wsnet-cargo-sharing-core + + + + com.wsnet + wsnet-excel-starter + + + + cn.hutool + hutool-all + 5.8.32 + + + org.mapstruct + mapstruct + + + + org.mapstruct + mapstruct-processor + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + repackage + + repackage + + + + + + + \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/CargoServiceApplication.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/CargoServiceApplication.java new file mode 100644 index 0000000..a2e98c0 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/CargoServiceApplication.java @@ -0,0 +1,19 @@ +package com.wsnet.cargo; + +import com.wsnet.launcher.launcher.LauncherApplication; +import com.wsnet.user.service.impl.PermServiceImpl; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients(basePackageClasses = {PermServiceImpl.class}) +@MapperScan({"com.wsnet.cargo.mapper"}) +public class CargoServiceApplication { + + public static void main(String[] args) { + LauncherApplication.run("wsnet-cargo-server", CargoServiceApplication.class, args); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ApiController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ApiController.java new file mode 100644 index 0000000..41d4f0a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ApiController.java @@ -0,0 +1,17 @@ +package com.wsnet.cargo.controller; + +import com.wsnet.cargo.entity.HelpApi; +import com.wsnet.cargo.service.HelpApiService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.web.controller.BaseController; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api") +@Menu(code = "0301", name = "对外开放接口") +@Tag(name = "对外开放接口") +public class ApiController extends BaseController { +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/BrandController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/BrandController.java new file mode 100644 index 0000000..0bab4b3 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/BrandController.java @@ -0,0 +1,42 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictBrand; +import com.wsnet.cargo.query.BrandQuery; +import com.wsnet.cargo.service.DictBrandService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/brand") +@Menu(code = "0203", name = "品牌") +@Tag(name = "品牌") +public class BrandController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody BrandQuery query) { + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictBrand entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictBrand::getName, entity.getName()).ne(entity.getId() != null, DictBrand::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("名称已存在"); + } + + exists = service.lambdaQuery().eq(DictBrand::getCode, entity.getCode()).ne(entity.getId() != null, DictBrand::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("编码已存在"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/EmployeeController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/EmployeeController.java new file mode 100644 index 0000000..8c9b2ea --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/EmployeeController.java @@ -0,0 +1,36 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictEmployee; +import com.wsnet.cargo.query.EmployeeQuery; +import com.wsnet.cargo.service.DictEmployeeService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.holder.UserContext; +import com.wsnet.core.response.ResultData; +import com.wsnet.dto.CargoApiUser; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/employee") +@Tag(name = "企业员工管理") +@Menu(code = "0202", name = "企业员工管理") +@Validated +public class EmployeeController extends BaseDictController { + // 员工列表 + @Override + public ResultData> page(@RequestBody EmployeeQuery query) { + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + query.setEnterpriseId(user.getEnterpriseId()); + + query.setFields("*+enterprise@name+wharf@name"); + + + return super.page(query); + } + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/EnterpriseController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/EnterpriseController.java new file mode 100644 index 0000000..197ceca --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/EnterpriseController.java @@ -0,0 +1,287 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.dto.EnterpriseVo; +import com.wsnet.cargo.entity.DictEmployee; +import com.wsnet.cargo.entity.DictEnterprise; +import com.wsnet.cargo.entity.DictWharf; +import com.wsnet.cargo.enums.EnterpriseStatusEnums; +import com.wsnet.cargo.enums.EnterpriseTypeEnums; +import com.wsnet.cargo.query.EnterpriseQuery; +import com.wsnet.cargo.service.CargoUserRegService; +import com.wsnet.cargo.service.DictEmployeeService; +import com.wsnet.cargo.service.DictEnterpriseService; +import com.wsnet.cargo.service.DictWharfService; +import com.wsnet.core.annotation.Anonymous; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.core.holder.UserContext; +import com.wsnet.core.response.ResultData; +import com.wsnet.dto.CargoApiUser; +import com.wsnet.user.dto.RegUser; +import com.wsnet.user.service.impl.UserRegService; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.UrlResource; +import org.springframework.http.ResponseEntity; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.YearMonth; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +@RestController +@RequestMapping("/enterprise") +@Tag(name = "企业管理") +@Menu(code = "0201", name = "企业管理") +@Validated +public class EnterpriseController extends BaseDictController { + + @Value("${launcher.upload.path}") + private String path; + + @Resource + private PasswordEncoder passwordEncoder; + + @Resource + private CargoUserRegService cargoUserRegService; + + @Resource + private DictEnterpriseService enterpriseService; + + @Resource + private DictEmployeeService employeeService; + + @Resource + private UserRegService userRegService; + + @Resource + private DictWharfService wharfService; + + @Anonymous + @Operation(summary = "企业注册", operationId = "10") + @PostMapping("/reg") + public ResultData enterpriseReg(@RequestBody @Validated EnterpriseVo enterprise) { + // 验证手机号是否存在 + boolean phoneExists = enterpriseService.lambdaQuery().eq(DictEnterprise::getPhone, enterprise.getPhone()).exists(); + if (phoneExists) { + return ResultData.fail("该手机号已存在"); + } + + // 验证信用代码是否存在 + boolean codeExists = enterpriseService.lambdaQuery().eq(DictEnterprise::getCode, enterprise.getCode()).exists(); + if (codeExists) { + return ResultData.fail("信用代码已存在"); + } + + // 判断 名称是否一致 + String license =StringUtils.substringBetween(enterprise.getLicensePhoto(), "license-", "."); + if (!StringUtils.equals(license, enterprise.getCode())) { + return ResultData.fail("信用代码与上传文件名称不一致"); + } + + String id =StringUtils.substringBetween(enterprise.getIdPhoto(), "id-", "."); + if (!StringUtils.equals(id, enterprise.getPhone())) { + return ResultData.fail("身份证号与上传文件名称不一致"); + } + + // 如果企业为港口类型,关联港口不能为空 + if (enterprise.getEnterpriseType() == EnterpriseTypeEnums.PORT && enterprise.getPortId() == null) { + return ResultData.fail("港口类型必须关联港口"); + } + + cargoUserRegService.register(enterprise); + return ResultData.success("success"); + } + + @Anonymous + @Operation(summary = "文件上传") + @PostMapping("/upload") + public ResultData upload( + @NotNull(message = "文件类型不能为空") + @Parameter(name = "type", description = "文件类型 0-营业执照, 1-身份证") Integer type, + @NotBlank(message = "文件编号不能为空") + @Parameter(name = "no", description = "文件编号, 营业执照则为信用代码, 身份证则为手机号码") String no, + MultipartFile file) throws IOException { + // 按年月创建目录 + YearMonth ym = YearMonth.now(); + String foldPath = StringUtils.join(path, File.pathSeparator, ym.getYear(), File.pathSeparator, ym.getMonthValue()); + + // 创建文件目录 + File fold = new File(foldPath); + if (!fold.exists()) { + fold.mkdirs(); + } + + String fileName = StringUtils.join(type == 0 ? "license" : "id", "-", + no, ".", StringUtils.substringAfterLast(file.getOriginalFilename(), ".")); + String filePath = StringUtils.join(foldPath, File.pathSeparator, fileName); + + file.transferTo(new File(filePath)); + + return ResultData.success(fileName); + } + + @Operation(summary = "添加员工", operationId = "11") + @PostMapping("/employee/add") + @Transactional(rollbackFor = Exception.class) + public ResultData addEnterpriseEmployee(@RequestBody @Validated DictEmployee employee) { + // 验证用户名是否已经存在 + boolean exists = employeeService.lambdaQuery().eq(DictEmployee::getUsername, employee.getUsername()).exists(); + if (exists) { + return ResultData.fail("用户名已经存在"); + } + // 验证电话号码是否已经存在 + + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + + DictEnterprise enterprise = enterpriseService.getById(user.getEnterpriseId()); + // 添加员工 + // 如果企业类型为港口码头,则必须指定码头 + if (enterprise.getEnterpriseType() == EnterpriseTypeEnums.PORT) { + if (employee.getWharfId() == null) { + return ResultData.fail("港口码头企业员工必须绑定码头"); + } + } + if (employee.getWharfId() != null) { + // 验证码头和企业绑定的港口是否一致 + DictWharf wharf = wharfService.getById(employee.getWharfId()); + if (wharf.getPortId().compareTo(enterprise.getPortId()) != 0) { + return ResultData.fail("码头与港口不一致"); + } + } + + employee.setStatus(StatusEnums.active); + + employeeService.save(employee); + + // 分配账号 + RegUser regUser = new RegUser(); + regUser.setPassword(passwordEncoder.encode(employee.getPassword())); + regUser.setUsername(employee.getUsername()); + regUser.setName(employee.getName()); + regUser.setDstatus(StatusEnums.active); + regUser.setPhone(employee.getPhone()); + regUser.setOpenId("user"); + + ResultData register = userRegService.register(regUser); + if (!StringUtils.equals(register.getCode(), "200")) { + throw new RuntimeException(register.getMessage()); + } + + // 修改企业的绑定管理员账号 + employeeService.lambdaUpdate().set(DictEmployee::getUserId, register.getData()).eq(DictEmployee::getId, employee.getId()).update(); + + return ResultData.success(employee.getId()); + } + + @Operation(summary = "获取营业执照图片", operationId = "12") + @GetMapping("/image/license/{id}") + public ResponseEntity getLicenseImage(@PathVariable Long id) { + DictEnterprise enterprise = enterpriseService.getById(id); + if (enterprise == null) { + return ResponseEntity.notFound().build(); + } + Path imageStoragePath = Paths.get(path); // 修改为你的图片存储路径 + try { + Path file = imageStoragePath.resolve(enterprise.getLicensePhoto()); + org.springframework.core.io.Resource resource = new UrlResource(file.toUri()); + + if (resource.exists() || resource.isReadable()) { + return ResponseEntity.ok().body(resource); + } else { + return ResponseEntity.notFound().build(); + } + } catch (Exception e) { + return ResponseEntity.internalServerError().build(); + } + } + + @Operation(summary = "获取身份证图片", operationId = "13") + @GetMapping("/image/id/{id}") + public ResponseEntity getIdImage(@PathVariable Long id) { + DictEnterprise enterprise = enterpriseService.getById(id); + if (enterprise == null) { + return ResponseEntity.notFound().build(); + } + Path imageStoragePath = Paths.get(path); // 修改为你的图片存储路径 + try { + Path file = imageStoragePath.resolve(enterprise.getIdPhoto()); + org.springframework.core.io.Resource resource = new UrlResource(file.toUri()); + + if (resource.exists() || resource.isReadable()) { + return ResponseEntity.ok().body(resource); + } else { + return ResponseEntity.notFound().build(); + } + } catch (Exception e) { + return ResponseEntity.internalServerError().build(); + } + } + + @Operation(summary = "待审核数量", operationId = "14") + @PostMapping("/reg/audit/count") + public ResultData enterpriseRegCount() { + Long count = service.lambdaQuery().eq(DictEnterprise::getEnterpriseStatus, EnterpriseStatusEnums.AUDIT).count(); + return ResultData.success(count); + } + + @Operation(summary = "审核通过", operationId = "15") + @PostMapping("/reg/audit/pass") + public ResultData enterpriseRegPass(@RequestBody @Validated @Size(min = 1,message = "ID列表不能为空") @Parameter(description = "ID列表") List ids) { + service.lambdaUpdate().set(DictEnterprise::getEnterpriseStatus, EnterpriseStatusEnums.USED) + .in(DictEnterprise::getId, ids) + .update(); + return ResultData.success("success"); + } + + @Override + public ResultData> page(@RequestBody EnterpriseQuery query) { + Page page = service.lambdaQuery().eq(query.getEnterpriseStatus() != null, DictEnterprise::getEnterpriseStatus, query.getEnterpriseStatus()) + .and(StringUtils.isNotEmpty(query.getKey()), (w) -> w.like(DictEnterprise::getName, query.getKey()) + .or().like(DictEnterprise::getCode, query.getKey())) + .page(new Page((long) query.getPage(), (long) query.getRows())); + return ResultData.success(page); + } + + @Override + protected ResultData enable(@RequestBody @Validated @Size(min = 1,message = "ID列表不能为空") @Parameter(description = "ID列表") List ids) { + this.pojoCache.getEntityCache().removeAll((Set)ids.stream().map((item) -> { + return String.valueOf(item); + }).collect(Collectors.toSet())); + service.lambdaUpdate().set(DictEnterprise::getEnterpriseStatus, EnterpriseStatusEnums.USED) + .eq(DictEnterprise::getId, ids) + .update(); + + return ResultData.success("success"); + } + + @Override + protected ResultData disable(@RequestBody @Validated @Size(min = 1,message = "ID列表不能为空") @Parameter(description = "ID列表") List ids) { + this.pojoCache.getEntityCache().removeAll((Set)ids.stream().map((item) -> { + return String.valueOf(item); + }).collect(Collectors.toSet())); + service.lambdaUpdate().set(DictEnterprise::getEnterpriseStatus, EnterpriseStatusEnums.CLOSE) + .eq(DictEnterprise::getId, ids) + .update(); + + return ResultData.success("success"); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/HelpController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/HelpController.java new file mode 100644 index 0000000..8174d0e --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/HelpController.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.controller; + +import com.wsnet.cargo.entity.HelpDoc; +import com.wsnet.cargo.service.HelpDocService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.web.controller.BaseController; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/help") +@Menu(code = "0302", name = "帮助文档") +@Tag(name = "帮助文档") +public class HelpController extends BaseController { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ManifestController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ManifestController.java new file mode 100644 index 0000000..6cbf518 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ManifestController.java @@ -0,0 +1,375 @@ +package com.wsnet.cargo.controller; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.controller.mapper.PoMapper; +import com.wsnet.cargo.entity.*; +import com.wsnet.cargo.enums.GoodsStatusEnums; +import com.wsnet.cargo.excel.ManifestDetailImportExcel; +import com.wsnet.cargo.excel.ManifestImportExcel; +import com.wsnet.cargo.query.ManifestDetailQuery; +import com.wsnet.cargo.query.ManifestQuery; +import com.wsnet.cargo.service.BusManifestService; +import com.wsnet.cargo.service.DictBrandService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.core.response.ResultData; +import com.wsnet.excel.handler.CascadeGroup; +import com.wsnet.excel.handler.CustomCellWriteHandler; +import com.wsnet.excel.utils.ExcelPropertiesUtils; +import com.wsnet.excel.utils.ExcelUtils; +import com.wsnet.web.controller.BaseController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.*; +import java.util.stream.Collectors; + +@RestController +@RequestMapping("/manifest") +@Menu(code = "0302", name = "舱单") +@Tag(name = "舱单") +public class ManifestController extends BaseController { + + @Resource + private DictBrandService brandService; + + @Override + public ResultData> page(@RequestBody ManifestQuery query) { + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated BusManifest entity) { + // 提单号不允许重复 + boolean exists = service.lambdaQuery().eq(BusManifest::getBillNo, entity.getBillNo()) + .eq(BusManifest::getScheduleId, entity.getScheduleId()) + .ne(entity.getId() != null, BusManifest::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("提单号已存在"); + } + + return super.save(entity); + } + + @Operation(summary = "舱单模板下载", operationId = "11") + @GetMapping("/tmp/export") + public void tmpExport(HttpServletResponse response) { + ExcelWriter excelWriter = null; + OutputStream out = null; + try { + out = response.getOutputStream(); + + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 + String fileName = URLEncoder.encode("舱单模板", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + + Map cols = ExcelPropertiesUtils.getExcelCols(ManifestImportExcel.class); + + // 显示下拉框数据 + Map> map = new HashMap<>(); + + // 隐匿下拉框 + Map> excelMap = new HashMap<>(); + { + // 品牌 + List brandList = brandService.lambdaQuery().eq(DictBrand::getStatus, StatusEnums.active).list() + .stream().map(s -> s.getName()).collect(Collectors.toList()); + + excelMap.put("*品牌", brandList); + + } + + // 级联下拉框 + List groups = new ArrayList<>(); + + excelWriter = EasyExcel.write(out) + .registerWriteHandler(new CustomCellWriteHandler(cols, map, excelMap, groups)) + .build(); + + WriteSheet writeSheet = EasyExcel.writerSheet(0, "舱单模板").head(ManifestImportExcel.class).build(); + + // 查询数据 + List rows = new ArrayList<>(); + + excelWriter.write(rows, writeSheet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + if (out != null) { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + @Operation(summary = "舱单导入", operationId = "12") + @PostMapping("/import") + public ResultData importExcel( + @Parameter(description = "船期ID") Long scheduleId, + MultipartFile file) throws IOException { + ValidatorFactory vf = Validation.buildDefaultValidatorFactory(); + Validator validator = vf.getValidator(); + // 错误信息 + List errors = new ArrayList<>(); + // 已经存在的提单号 + List existsBillNos = new ArrayList<>(); + // 读取的有效的数据 + List dataList = new ArrayList<>(); + ExcelUtils.readExcel(file.getInputStream(), ManifestImportExcel.class, (rowData) -> { + // 这里只验证格式是否正确,并不验证数据的有效性 + // 对数据进行检验 + Set> set = validator.validate(rowData); + if (!CollectionUtils.isEmpty(set)) { // 验证失败的 + JSONObject o = JSONObject.from(rowData); + o.put("status", set.stream().map(p -> p.getMessage()).collect(Collectors.joining(","))); + errors.add(o); + } + + // 船名、航次不允许重复 + if (existsBillNos.contains(rowData.getBillNo())) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "excel中提单号:" + rowData.getBillNo() + "重复"); + errors.add(o); + } else { + existsBillNos.add(rowData.getBillNo()); + } + + return true; + }, (rowDataList) -> { + if (CollectionUtils.isNotEmpty(errors)) { // 有错误信息,不做处理 + return; + } + dataList.addAll(rowDataList); + }); + + if (CollectionUtils.isNotEmpty(errors)) { + return ResultData.fail(JSON.toJSONString(errors)); + } + + if (CollectionUtils.isEmpty(dataList)) { + return ResultData.fail("没有读取到有效数据"); + } + + // 对数据的合法性进行验证 + // 数据库中的品牌 + List brandList = brandService.lambdaQuery() + .eq(DictBrand::getStatus, StatusEnums.active) + .in(DictBrand::getName, dataList.stream().map(s -> s.getBrandName()).collect(Collectors.toList())).list(); + + List saveDataList = new ArrayList<>(); + + for (ManifestImportExcel rowData : dataList) { + + // 品牌是否存在 + Optional brand = brandList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getBrandName())).findAny(); + if (!brand.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "品牌不存在:" + rowData.getBrandName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 提单号是否已经存在 + boolean exists = service.lambdaQuery().eq(BusManifest::getBillNo, rowData.getBillNo()).eq(BusManifest::getScheduleId, scheduleId).exists(); + if (exists) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "数据库中,提单号:" + rowData.getBillNo() + "已存在"); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + BusManifest manifest = PoMapper.instance.manifestExcelToEntity(rowData); + manifest.setScheduleId(scheduleId); + manifest.setBrandId(brand.get().getId()); + manifest.setGoodsStatus(GoodsStatusEnums.RIVER); + + saveDataList.add(manifest); + } + + service.saveBatch(saveDataList); + + return ResultData.success("success"); + } + + @Operation(summary = "舱单导出", operationId = "13") + @GetMapping("/export") + public void exportExcel(ManifestQuery query, HttpServletResponse response) { + query.setPage(1); + query.setRows(500); + query.setFields("*+brand@name"); + + ExcelWriter excelWriter = null; + OutputStream out = null; + try { + out = response.getOutputStream(); + + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 + String fileName = URLEncoder.encode(DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN) + "舱单", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + + excelWriter = EasyExcel.write(out).build(); + + WriteSheet writeSheet = EasyExcel.writerSheet(0, "舱单").head(ManifestImportExcel.class).build(); + + WriteSheet writeDetailSheet = EasyExcel.writerSheet(1, "舱单明细").head(ManifestDetailImportExcel.class).build(); + + // 查询数据 + Page page = baseService.page(BusManifest.class, query); + + write(page.getRecords(), excelWriter, writeSheet, writeDetailSheet); + + for (int i = 2; i <= page.getPages(); i++) { + query.setPage(i); + page = baseService.page(BusManifest.class, query); + + write(page.getRecords(), excelWriter, writeSheet, writeDetailSheet); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + if (out != null) { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + private void write(List headers, ExcelWriter excelWriter, WriteSheet writeSheet, WriteSheet writeDetailSheet) { + if (CollectionUtils.isEmpty(headers)) { + return; + } + List rows = headers.stream().map(item -> PoMapper.instance.manifestEntityToExcel(item)).collect(Collectors.toList()); + + excelWriter.write(rows, writeSheet); + + if (CollectionUtils.isNotEmpty(rows)) { + ManifestDetailQuery wdQuery = new ManifestDetailQuery(); + wdQuery.setFields("*+manifest@billNo+vehicleType@name+vehicleTypeDetail@name"); + wdQuery.setManifestId(headers.stream().map(s -> s.getId()).collect(Collectors.toList())); + List list = baseService.list(BusManifestDetail.class, wdQuery); + List details = list.stream().map(item -> PoMapper.instance.manifestDetailEntityToExcel(item)).collect(Collectors.toList()); + excelWriter.write(details, writeDetailSheet); + } + + } + + /* + @Operation(summary = "舱单导入", operationId = "11") + @GetMapping("/tmp/export") + public void tmpExport(HttpServletResponse response) { + ExcelWriter excelWriter = null; + OutputStream out = null; + try { + out = response.getOutputStream(); + + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 + String fileName = URLEncoder.encode("内贸整船车辆导入模板", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + + + Map cols = new HashMap<>(); + cols.put("船名", 0); + cols.put("省份", 1); + cols.put("城市", 2); + //普通下拉数据 + Map> map = new HashMap<>(); + String[] isZgArray = {"正常", "国内中转", "外进转内出", "长江", "沿海"}; + map.put("船名", Arrays.asList(isZgArray)); + + Cascade c1 = new Cascade(); + c1.setColName("城市"); + c1.setParentColName("省份"); + Map> cityMap = new HashMap<>(); + List cityList1 = new ArrayList<>(); + cityList1.add("武汉"); + cityList1.add("孝感"); + cityList1.add("钟祥"); + + List cityList2 = new ArrayList<>(); + cityList2.add("苏州"); + cityList2.add("扬州"); + cityList2.add("镇江"); + + cityMap.put("湖北省", cityList1); + cityMap.put("江苏省", cityList2); + + c1.setSonValues(cityMap); + + + CascadeGroup group1 = new CascadeGroup(); + group1.setName("国家城市"); + group1.setRootColName("省份"); + group1.setRootValues(Arrays.asList("湖北省", "江苏省")); + group1.setCascades(Arrays.asList(c1)); + + + excelWriter = EasyExcel.write(out) + .registerWriteHandler(new CustomCellWriteHandler(cols, map, null, Arrays.asList(group1))) + .build(); + + WriteSheet writeSheet = EasyExcel.writerSheet(0, "内贸整船车辆导入模板").head(ManifestImportExcel.class).build(); + + // 查询数据 + List rows = new ArrayList<>(); + + excelWriter.write(rows, writeSheet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + if (out != null) { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + */ +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ManifestDetailController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ManifestDetailController.java new file mode 100644 index 0000000..44d2d16 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ManifestDetailController.java @@ -0,0 +1,274 @@ +package com.wsnet.cargo.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.controller.mapper.PoMapper; +import com.wsnet.cargo.entity.*; +import com.wsnet.cargo.excel.ManifestDetailImportExcel; +import com.wsnet.cargo.query.ManifestQuery; +import com.wsnet.cargo.service.BusManifestDetailService; +import com.wsnet.cargo.service.BusManifestService; +import com.wsnet.cargo.service.DictVehicleTypeDetailService; +import com.wsnet.cargo.service.DictVehicleTypeService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.core.response.ResultData; +import com.wsnet.excel.handler.Cascade; +import com.wsnet.excel.handler.CascadeGroup; +import com.wsnet.excel.handler.CustomCellWriteHandler; +import com.wsnet.excel.utils.ExcelPropertiesUtils; +import com.wsnet.excel.utils.ExcelUtils; +import com.wsnet.web.controller.BaseController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.*; +import java.util.stream.Collectors; + +@RestController +@RequestMapping("/manifest/detail") +@Menu(code = "0303", name = "舱单明细") +@Tag(name = "舱单明细") +public class ManifestDetailController extends BaseController { + + @Resource + private DictVehicleTypeService vehicleTypeService; + + @Resource + private DictVehicleTypeDetailService vehicleTypeDetailService; + + @Resource + private BusManifestService manifestService; + + @Resource + private BusManifestDetailService manifestDetailService; + + @Override + public ResultData> page(@RequestBody ManifestQuery query) { + return super.page(query); + } + + @Operation(summary = "舱单明细模板下载", operationId = "11") + @GetMapping("/tmp/export") + public void tmpExport(HttpServletResponse response) { + ExcelWriter excelWriter = null; + OutputStream out = null; + try { + out = response.getOutputStream(); + + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 + String fileName = URLEncoder.encode("舱单明细模板", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + + Map cols = ExcelPropertiesUtils.getExcelCols(ManifestDetailImportExcel.class); + + // 显示下拉框数据 + Map> map = new HashMap<>(); + + // 隐匿下拉框 + Map> excelMap = new HashMap<>(); + + // 级联下拉框 + List groups = new ArrayList<>(); + { + // 车型与车型明细 + CascadeGroup loadGroup = new CascadeGroup(); + groups.add(loadGroup); + + List cascades = new ArrayList<>(); + loadGroup.setCascades(cascades); + + loadGroup.setName("车型与车型明细"); + loadGroup.setRootColName("*车型"); + + // 港口列表 + List vehicleTypeList = vehicleTypeService.lambdaQuery().eq(DictVehicleType::getStatus, StatusEnums.active).list(); + loadGroup.setRootValues(vehicleTypeList.stream().map(s -> s.getName()).collect(Collectors.toList())); + + if (CollectionUtils.isNotEmpty(vehicleTypeList)) { + Cascade c = new Cascade(); + cascades.add(c); + + c.setColName("*车型明细"); + c.setParentColName("*车型"); + + // 码头列表 + Map> sonValues = new HashMap<>(); + c.setSonValues(sonValues); + + List vehicleTypeDetailList = vehicleTypeDetailService.lambdaQuery().eq(DictVehicleTypeDetail::getStatus, StatusEnums.active).list(); + + vehicleTypeList.stream().forEach(s -> { + sonValues.put(s.getName(), vehicleTypeDetailList.stream().filter(w -> w.getVehicleTypeId().equals(s.getId())).map(w -> w.getName()).collect(Collectors.toList())); + }); + } + } + + excelWriter = EasyExcel.write(out) + .registerWriteHandler(new CustomCellWriteHandler(cols, map, excelMap, groups)) + .build(); + + WriteSheet writeSheet = EasyExcel.writerSheet(0, "舱单明细模板").head(ManifestDetailImportExcel.class).build(); + + // 查询数据 + List rows = new ArrayList<>(); + + excelWriter.write(rows, writeSheet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + if (out != null) { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + + @Operation(summary = "舱单明细导入", operationId = "12") + @PostMapping("/import") + public ResultData importExcel( + @Parameter(description = "船期ID") Long scheduleId, MultipartFile file) throws IOException { + + ValidatorFactory vf = Validation.buildDefaultValidatorFactory(); + Validator validator = vf.getValidator(); + // 错误信息 + List errors = new ArrayList<>(); + // 读取的有效数据 + List dataList = new ArrayList<>(); + ExcelUtils.readExcel(file.getInputStream(), ManifestDetailImportExcel.class, (rowData) -> { + // 这里只验证格式是否正确,并不验证数据的有效性 + // 对数据进行检验 + Set> set = validator.validate(rowData); + if (!CollectionUtils.isEmpty(set)) { // 验证失败的 + JSONObject o = JSONObject.from(rowData); + o.put("status", set.stream().map(p -> p.getMessage()).collect(Collectors.joining(","))); + errors.add(o); + } + + return true; + }, (rowDataList) -> { + if (CollectionUtils.isNotEmpty(errors)) { // 有错误信息,不做处理 + return; + } + + dataList.addAll(rowDataList); + }); + + if (CollectionUtils.isNotEmpty(errors)) { + return ResultData.fail(JSON.toJSONString(errors)); + } + + if (CollectionUtils.isEmpty(dataList)) { + return ResultData.fail("没有读取到有效数据"); + } + + // 对数据的合法性进行验证 + // 数据库中的车型 + List vehicleTypeList = vehicleTypeService.lambdaQuery() + .eq(DictVehicleType::getStatus, StatusEnums.active) + .in(DictVehicleType::getName, dataList.stream().map(s -> s.getVehicleTypeName()).collect(Collectors.toList())).list(); + + // 数据库中的车型明细 + List vehicleTypeDetailList = vehicleTypeDetailService.lambdaQuery() + .eq(DictVehicleTypeDetail::getStatus, StatusEnums.active) + .in(DictVehicleTypeDetail::getName, dataList.stream().map(s -> s.getVehicleTypeDetailName()).collect(Collectors.toList())).list(); + + // 数据库中的提单号 + List manifestList = manifestService.lambdaQuery() + .eq(BusManifest::getScheduleId, scheduleId) + .list(); + + // 已经存在的车架号 + List manifestDetailList = manifestDetailService.lambdaQuery() + .in(BusManifestDetail::getManifestId, manifestList.stream().map(s -> s.getId()).collect(Collectors.toList())) + .list(); + + List saveDataList = new ArrayList<>(); + + for (ManifestDetailImportExcel rowData : dataList) { + // 验证提单号是否存在 + Optional manifest = manifestList.stream().filter(s -> StringUtils.equals(s.getBillNo(), rowData.getBillNo())).findAny(); + if (!manifest.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "提单号不存在:" + rowData.getBillNo()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证车架号是否已经存在 + Optional manifestDetail = manifestDetailList.stream().filter(s -> StringUtils.equals(s.getVin(), rowData.getVin())).findAny(); + if (manifestDetail.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "VIN已存在:" + rowData.getVin()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证车型 + Optional vehicleType = vehicleTypeList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getVehicleTypeName())).findAny(); + if (!vehicleType.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "车型明细不存在:" + rowData.getVehicleTypeName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + + // 验证车型明细 + Optional vehicleTypeDetail = vehicleTypeDetailList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getVehicleTypeDetailName())).findAny(); + if (!vehicleTypeDetail.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "明细不存在:" + rowData.getVehicleTypeDetailName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证装车型和车型明细是否一致 + if (vehicleTypeDetail.get().getVehicleTypeId().compareTo(vehicleType.get().getId()) != 0) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "车型与车型明细不一致:" + rowData.getVehicleTypeDetailName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + BusManifestDetail detail = PoMapper.instance.manifestDetailExcelToEntity(rowData); + detail.setManifestId(manifest.get().getId()); + detail.setVehicleTypeId(vehicleType.get().getId()); + detail.setVehicleTypeDetailId(vehicleTypeDetail.get().getId()); + + saveDataList.add(detail); + } + + service.saveBatch(saveDataList); + + return ResultData.success("success"); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/NoticeController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/NoticeController.java new file mode 100644 index 0000000..dab4ee3 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/NoticeController.java @@ -0,0 +1,29 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.BusNotice; +import com.wsnet.cargo.query.NoticeQuery; +import com.wsnet.cargo.service.BusNoticeService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import java.util.HashSet; +import java.util.Set; + +@RestController +@RequestMapping("/notice") +@Menu(code = "0305", name = "公告") +@Tag(name = "公告") +public class NoticeController extends BaseController { + @Override + public ResultData> page(@RequestBody NoticeQuery query) { + Set excludeFields = new HashSet<>(); + excludeFields.add("content"); + query.setExcludeFields(excludeFields); + return super.page(query); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/PortController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/PortController.java new file mode 100644 index 0000000..5333d6a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/PortController.java @@ -0,0 +1,56 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictPort; +import com.wsnet.cargo.query.PortQuery; +import com.wsnet.cargo.service.DictPortService; +import com.wsnet.core.annotation.Anonymous; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.dto.DictDTO; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import com.wsnet.web.service.BaseService; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/port") +@Tag(name = "港口") +@Menu(code = "0204", name = "港口") +@Validated +public class PortController extends BaseDictController { + + // 注册时也会用到港口列表 + @Override + @Anonymous + protected ResultData> list(@RequestParam(name = "q",required = false) @Parameter(description = "过滤查询") String q, @RequestParam(name = "ref",required = false) @Parameter(description = "外键值") String ref) { + return super.list(q, ref); + } + + @Override + public ResultData> page(@RequestBody PortQuery query) { + query.setFields("*+province@name+city@name"); + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictPort entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictPort::getCode, entity.getCode()).ne(entity.getId() != null, DictPort::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("港口编码重复"); + } + + exists = service.lambdaQuery().eq(DictPort::getName, entity.getName()).ne(entity.getId() != null, DictPort::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("港口名称重复"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/RouteController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/RouteController.java new file mode 100644 index 0000000..fce9348 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/RouteController.java @@ -0,0 +1,44 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictShipRoute; +import com.wsnet.cargo.query.RouteQuery; +import com.wsnet.cargo.service.DictShipRouteService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/route") +@Tag(name = "航线") +@Menu(code = "0205", name = "航线") +@Validated +public class RouteController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody RouteQuery query) { + + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictShipRoute entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictShipRoute::getCode, entity.getCode()).ne(entity.getId() != null, DictShipRoute::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("名称已存在"); + } + + exists = service.lambdaQuery().eq(DictShipRoute::getName, entity.getName()).ne(entity.getId() != null, DictShipRoute::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("代码已存在"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/RouteWharfController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/RouteWharfController.java new file mode 100644 index 0000000..24abca6 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/RouteWharfController.java @@ -0,0 +1,41 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictShipRoutePort; +import com.wsnet.cargo.query.RoutePortQuery; +import com.wsnet.cargo.service.DictShipRoutePortService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/route/wharf") +@Tag(name = "航线码头") +@Menu(code = "0206", name = "航线码头") +@Validated +public class RouteWharfController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody RoutePortQuery query) { + query.setFields("*+route@name+port@name+wharf@name"); + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictShipRoutePort entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictShipRoutePort::getWharfId, entity.getWharfId()) + .eq(DictShipRoutePort::getRouteId, entity.getRouteId()).eq(DictShipRoutePort::getPortId, entity.getPortId()) + .ne(entity.getId() != null, DictShipRoutePort::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("航线码头已存在"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/SailScheduleController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/SailScheduleController.java new file mode 100644 index 0000000..333e0e3 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/SailScheduleController.java @@ -0,0 +1,439 @@ +package com.wsnet.cargo.controller; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.controller.mapper.PoMapper; +import com.wsnet.cargo.entity.*; +import com.wsnet.cargo.enums.ShipStatusEnums; +import com.wsnet.cargo.enums.TradeTypeEnums; +import com.wsnet.cargo.excel.SailScheduleImportExcel; +import com.wsnet.cargo.query.SailScheduleQuery; +import com.wsnet.cargo.service.*; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.core.holder.UserContext; +import com.wsnet.core.response.ResultData; +import com.wsnet.dto.CargoApiUser; +import com.wsnet.excel.handler.Cascade; +import com.wsnet.excel.handler.CascadeGroup; +import com.wsnet.excel.handler.CustomCellWriteHandler; +import com.wsnet.excel.utils.ExcelPropertiesUtils; +import com.wsnet.excel.utils.ExcelUtils; +import com.wsnet.web.controller.BaseController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.*; +import java.util.stream.Collectors; + +@RestController +@RequestMapping("/sail_schedule") +@Menu(code = "0301", name = "船期") +@Tag(name = "船期") +public class SailScheduleController extends BaseController { + @Resource + private DictShipService shipService; + + @Resource + private DictShipRouteService routeService; + + @Resource + private DictPortService portService; + + @Resource + private DictWharfService wharfService; + + @Override + public ResultData> page(@RequestBody SailScheduleQuery query) { + query.setFields("*+enterprise@name+ship@name+route@name+loadWharf@name+dischargeWharf@name+loadPort@name+dischargePort@name"); + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated BusSailSchedule entity) { + // 验证 船名,航次不允许重复 + boolean exists = service.lambdaQuery().eq(BusSailSchedule::getShipId, entity.getShipId()) + .eq(BusSailSchedule::getVoyage, entity.getVoyage()) + .ne(entity.getId() != null, BusSailSchedule::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("船名,航次已存在"); + } + + return super.save(entity); + } + + @Operation(summary = "船期模板下载", operationId = "11") + @GetMapping("/tmp/export") + public void tmpExport(HttpServletResponse response) { + ExcelWriter excelWriter = null; + OutputStream out = null; + try { + out = response.getOutputStream(); + + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 + String fileName = URLEncoder.encode("船期模板", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + + Map cols = ExcelPropertiesUtils.getExcelCols(SailScheduleImportExcel.class); + + // 显示下拉框数据 + Map> map = new HashMap<>(); + { + // 贸易类型 + List list = Arrays.stream(TradeTypeEnums.values()).map(s -> s.getDesc()).collect(Collectors.toList()); + map.put("*贸易类型", list); + + } + + // 隐匿下拉框 + Map> excelMap = new HashMap<>(); + { + // 船舶 + List shipList = shipService.lambdaQuery().eq(DictShip::getStatus, StatusEnums.active).list() + .stream().map(s -> s.getName()).collect(Collectors.toList()); + + excelMap.put("*船名", shipList); + + // 航线 + List routeList = routeService.lambdaQuery().eq(DictShipRoute::getStatus, StatusEnums.active).list() + .stream().map(s -> s.getName()).collect(Collectors.toList()); + excelMap.put("*航线", routeList); + } + + // 级联下拉框 + + List groups = new ArrayList<>(); + + { + { + // 装货港港口与码头 + CascadeGroup loadGroup = new CascadeGroup(); + groups.add(loadGroup); + + List cascades = new ArrayList<>(); + loadGroup.setCascades(cascades); + + loadGroup.setName("装货港港口与码头"); + loadGroup.setRootColName("*装货港口"); + + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + Long bindPortId = user.getPortId(); + // 港口列表 + List ports = portService.lambdaQuery().eq(DictPort::getStatus, StatusEnums.active).eq(bindPortId != null, DictPort::getId, bindPortId).list(); + loadGroup.setRootValues(ports.stream().map(s -> s.getName()).collect(Collectors.toList())); + + if (CollectionUtils.isNotEmpty(ports)) { + Cascade c = new Cascade(); + cascades.add(c); + + c.setColName("*装货码头"); + c.setParentColName("*装货港口"); + + // 码头列表 + Map> sonValues = new HashMap<>(); + c.setSonValues(sonValues); + + List wharfList = wharfService.lambdaQuery().eq(DictWharf::getStatus, StatusEnums.active) + .in(DictWharf::getPortId, ports.stream().map(s -> s.getId()).collect(Collectors.toList())).list(); + + ports.stream().forEach(s -> { + sonValues.put(s.getName(), wharfList.stream().filter(w -> w.getPortId().equals(s.getId())).map(w -> w.getName()).collect(Collectors.toList())); + }); + } + } + { + // 缷货港港口与码头 + CascadeGroup dischargeGroup = new CascadeGroup(); + groups.add(dischargeGroup); + + List cascades = new ArrayList<>(); + dischargeGroup.setCascades(cascades); + + dischargeGroup.setName("缷货港港口与码头"); + dischargeGroup.setRootColName("*卸货港口"); + + // 港口列表 + List ports = portService.lambdaQuery().eq(DictPort::getStatus, StatusEnums.active).list(); + dischargeGroup.setRootValues(ports.stream().map(s -> s.getName()).collect(Collectors.toList())); + + if (CollectionUtils.isNotEmpty(ports)) { + Cascade c = new Cascade(); + cascades.add(c); + + c.setColName("*卸货码头"); + c.setParentColName("*卸货港口"); + + // 码头列表 + Map> sonValues = new HashMap<>(); + c.setSonValues(sonValues); + + List wharfList = wharfService.lambdaQuery().eq(DictWharf::getStatus, StatusEnums.active) + .in(DictWharf::getPortId, ports.stream().map(s -> s.getId()).collect(Collectors.toList())).list(); + + ports.stream().forEach(s -> { + sonValues.put(s.getName(), wharfList.stream().filter(w -> w.getPortId().equals(s.getId())).map(w -> w.getName()).collect(Collectors.toList())); + }); + } + } + + } + + excelWriter = EasyExcel.write(out) + .registerWriteHandler(new CustomCellWriteHandler(cols, map, excelMap, groups)) + .build(); + + WriteSheet writeSheet = EasyExcel.writerSheet(0, "船期模板").head(SailScheduleImportExcel.class).build(); + + // 查询数据 + List rows = new ArrayList<>(); + + excelWriter.write(rows, writeSheet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + if (out != null) { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + @Operation(summary = "船期导入", operationId = "12") + @PostMapping("/import") + public ResultData importExcel(MultipartFile file) throws IOException { + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + + ValidatorFactory vf = Validation.buildDefaultValidatorFactory(); + Validator validator = vf.getValidator(); + // 错误信息 + List errors = new ArrayList<>(); + // 读取的excel中,已经存在的船名,航次 + List existsShipVoyages = new ArrayList<>(); + // 读取的有效数据 + List dataList = new ArrayList<>(); + ExcelUtils.readExcel(file.getInputStream(), SailScheduleImportExcel.class, (rowData) -> { + // 这里只验证格式是否正确,并不验证数据的有效性 + // 对数据进行检验 + Set> set = validator.validate(rowData); + if (!CollectionUtils.isEmpty(set)) { // 验证失败的 + JSONObject o = JSONObject.from(rowData); + o.put("status", set.stream().map(p -> p.getMessage()).collect(Collectors.joining(","))); + errors.add(o); + } + + // 船名、航次不允许重复 + if (existsShipVoyages.contains(StringUtils.join(rowData.getShipName(), "#$#", rowData.getVoyage()))) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "excel中船名:" + rowData.getShipName()+", 航次:" + rowData.getVoyage() + "重复"); + errors.add(o); + } else { + existsShipVoyages.add(StringUtils.join(rowData.getShipName(), "#$#", rowData.getVoyage())); + } + + return true; + }, (rowDataList) -> { + if (CollectionUtils.isNotEmpty(errors)) { // 有错误信息,不做处理 + return; + } + + dataList.addAll(rowDataList); + }); + + if (CollectionUtils.isNotEmpty(errors)) { + return ResultData.fail(JSON.toJSONString(errors)); + } + + if (CollectionUtils.isEmpty(dataList)) { + return ResultData.fail("没有读取到有效数据"); + } + + // 对数据的合法性进行验证 + // 数据库中的船舶 + List shipList = shipService.lambdaQuery() + .eq(DictShip::getStatus, StatusEnums.active) + .in(DictShip::getName, dataList.stream().map(s -> s.getShipName()).collect(Collectors.toList())).list(); + + // 数据库中的航线 + List routeList = routeService.lambdaQuery() + .eq(DictShipRoute::getStatus, StatusEnums.active) + .in(DictShipRoute::getName, dataList.stream().map(s -> s.getShipRoute()).collect(Collectors.toList())).list(); + + // 数据库中的港口 + List portList = portService.lambdaQuery() + .eq(DictPort::getStatus, StatusEnums.active) + .in(DictPort::getName, CollectionUtils.union(dataList.stream().map(s -> s.getLoadPortName()).collect(Collectors.toList()), dataList.stream().map(s -> s.getDischargePortName()).collect(Collectors.toList()))) + .list(); + + // 数据库中的码头 + List wharfList = wharfService.lambdaQuery() + .eq(DictWharf::getStatus, StatusEnums.active) + .in(DictWharf::getName, CollectionUtils.union(dataList.stream().map(s -> s.getLoadWharfName()).collect(Collectors.toList()), dataList.stream().map(s -> s.getDischargeWharfName()).collect(Collectors.toList()))) + .list(); + + List saveDataList = new ArrayList<>(); + + for (SailScheduleImportExcel rowData : dataList) { + + // 贸易类型是否存在 + TradeTypeEnums tradeType = TradeTypeEnums.getEnumByDesc(rowData.getTradeTypeDesc()); + if (tradeType == null) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "贸易类型不存在:" + rowData.getShipName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 航线是否存在 + Optional route = routeList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getShipRoute())).findAny(); + if (!route.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "航线不存在:" + rowData.getShipRoute()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 船名是否存在 + Optional ship = shipList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getShipName())).findAny(); + if (!ship.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "船名不存在:" + rowData.getShipName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 船名航次是否存在 + boolean exists = service.lambdaQuery().eq(BusSailSchedule::getShipId, ship.get().getId()).eq(BusSailSchedule::getVoyage, rowData.getVoyage()).exists(); + if (exists) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "数据库中,船名:" + rowData.getShipName()+", 航次:" + rowData.getVoyage() + "已存在"); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证装货港口 + Optional loadPort = portList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getLoadPortName())).findAny(); + if (!loadPort.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "港口不存在:" + rowData.getLoadPortName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 是否与登录的港口一致 + if (user.getPortId().compareTo(loadPort.get().getId()) != 0) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "登录用户港口与导入的港口不一致:" + rowData.getLoadPortName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证装货码头 + Optional loadWharf = wharfList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getLoadWharfName())).findAny(); + if (!loadWharf.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "码头不存在:" + rowData.getLoadWharfName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 是否与登录的码头一致 + if (user.getWharfId().compareTo(loadWharf.get().getId()) != 0) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "登录用户码头与导入的码头不一致:" + rowData.getLoadWharfName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证装货码头是否和港口一致 + if (loadWharf.get().getPortId().compareTo(loadPort.get().getId()) != 0) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "装货码头与装货港口不一致:" + rowData.getLoadWharfName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证卸货港口 + Optional dischargePort = portList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getDischargePortName())).findAny(); + if (!dischargePort.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "卸货港口不存在:" + rowData.getDischargePortName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证卸货码头 + Optional dischargeWharf = wharfList.stream().filter(s -> StringUtils.equals(s.getName(), rowData.getDischargeWharfName())).findAny(); + if (!dischargeWharf.isPresent()) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "卸货码头不存在:" + rowData.getDischargeWharfName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + // 验证卸货码头是否和港口一致 + if (dischargeWharf.get().getPortId().compareTo(dischargePort.get().getId()) != 0) { + JSONObject o = JSONObject.from(rowData); + o.put("status", "卸货码头与卸货港口不一致:" + rowData.getDischargeWharfName()); + errors.add(o); + return ResultData.fail(JSON.toJSONString(errors)); + } + + BusSailSchedule schedule = PoMapper.instance.sailScheduleExcelToEntity(rowData); + schedule.setEnterpriseId(user.getEnterpriseId()); + schedule.setTradeType(tradeType); + schedule.setShipRouteId(route.get().getId()); + schedule.setShipId(ship.get().getId()); + schedule.setLoadPortId(loadPort.get().getId()); + schedule.setLoadWharfId(loadWharf.get().getId()); + schedule.setDischargePortId(dischargePort.get().getId()); + schedule.setDischargeWharfId(dischargeWharf.get().getId()); + schedule.setShipStatus(ShipStatusEnums.SEA); + + saveDataList.add(schedule); + } + + service.saveBatch(saveDataList); + + return ResultData.success("success"); + } + + @Operation(summary = "船期导出", operationId = "13") + @GetMapping("/export") + public void exportExcel(SailScheduleQuery query, HttpServletResponse response) throws IOException { + query.setFields("*+enterprise@name+ship@name+route@name+loadWharf@name+dischargeWharf@name+loadPort@name+dischargePort@name"); + List list = baseService.list(BusSailSchedule.class, query); + + List collect = list.stream().map(s -> PoMapper.instance.sailScheduleEntityToExcel(s)).collect(Collectors.toList()); + + ExcelUtils.export(response, DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN) + "船期", "船期", collect, SailScheduleImportExcel.class); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ShipChartController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ShipChartController.java new file mode 100644 index 0000000..aa91d90 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ShipChartController.java @@ -0,0 +1,38 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictShipChart; +import com.wsnet.cargo.query.ShipChartQuery; +import com.wsnet.cargo.service.DictShipChartService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/ship/chart") +@Menu(code = "0208", name = "船图") +@Tag(name = "船图") +public class ShipChartController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody ShipChartQuery query) { + query.setFields("*+ship@name"); + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictShipChart entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictShipChart::getShipId, entity.getShipId()).ne(entity.getId() != null, DictShipChart::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("船图已存在"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ShipController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ShipController.java new file mode 100644 index 0000000..3b5b097 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/ShipController.java @@ -0,0 +1,42 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictShip; +import com.wsnet.cargo.query.ShipQuery; +import com.wsnet.cargo.service.DictShipService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/ship") +@Tag(name = "船舶") +@Menu(code = "0207", name = "船舶") +@Validated +public class ShipController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody ShipQuery query) { + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictShip entity) { + boolean exists = service.lambdaQuery().eq(DictShip::getName, entity.getName()).ne(entity.getId() != null, DictShip::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("名称已存在"); + } + + exists = service.lambdaQuery().eq(DictShip::getMmsi, entity.getMmsi()).ne(entity.getId() != null, DictShip::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("码码已存在"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/SubscribeController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/SubscribeController.java new file mode 100644 index 0000000..1a6671f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/SubscribeController.java @@ -0,0 +1,56 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wsnet.cargo.entity.BusSubscribe; +import com.wsnet.cargo.query.SubscribeQuery; +import com.wsnet.cargo.service.BusSubscribeService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.holder.UserContext; +import com.wsnet.core.response.ResultData; +import com.wsnet.dto.CargoApiUser; +import com.wsnet.web.controller.BaseController; +import com.wsnet.web.service.BaseService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/subscribe") +@Menu(code = "0304", name = "订阅") +@Tag(name = "订阅") +public class SubscribeController extends BaseController { + + @Resource + private BaseService baseService; + + @Operation(summary = "我发布的订阅", operationId = "10") + @PostMapping("/publish/page") + public ResultData> publishPage(@RequestBody SubscribeQuery query) { + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + query.setEnterpriseId(user.getEnterpriseId()); + IPage page = baseService.page(BusSubscribe.class, query); + return ResultData.success(page); + } + + @Operation(summary = "我收到的订阅", operationId = "11") + @PostMapping("/receive/page") + public ResultData> receivePage(@RequestBody SubscribeQuery query) { + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + query.setSubEnterpriseId(user.getEnterpriseId()); + IPage page = baseService.page(BusSubscribe.class, query); + return ResultData.success(page); + } + + @Override + protected ResultData save(@RequestBody @Validated BusSubscribe entity) { + // 提单号不允许重复 + CargoApiUser user = (CargoApiUser) UserContext.getUser(); + entity.setEnterpriseId(user.getEnterpriseId()); + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/VehicleTypeController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/VehicleTypeController.java new file mode 100644 index 0000000..b6ef013 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/VehicleTypeController.java @@ -0,0 +1,43 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictVehicleType; +import com.wsnet.cargo.query.VehicleTypeQuery; +import com.wsnet.cargo.service.DictVehicleTypeService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/vehicle_type") +@Tag(name = "车型") +@Menu(code = "0209", name = "车型") +@Validated +public class VehicleTypeController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody VehicleTypeQuery query) { + + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictVehicleType entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictVehicleType::getName, entity.getName()).ne(entity.getId() != null, DictVehicleType::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("名称已存在"); + } + + exists = service.lambdaQuery().eq(DictVehicleType::getCode, entity.getCode()).ne(entity.getId() != null, DictVehicleType::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("编码已存在"); + } + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/VehicleTypeDetailController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/VehicleTypeDetailController.java new file mode 100644 index 0000000..f92d4ae --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/VehicleTypeDetailController.java @@ -0,0 +1,43 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictVehicleTypeDetail; +import com.wsnet.cargo.query.VehicleTypeDetailQuery; +import com.wsnet.cargo.service.DictVehicleTypeDetailService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/vehicle_type/detail") +@Tag(name = "车型明细") +@Menu(code = "0210", name = "车型明细") +@Validated +public class VehicleTypeDetailController extends BaseDictController { + + + @Override + public ResultData> page(@RequestBody VehicleTypeDetailQuery query) { + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictVehicleTypeDetail entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictVehicleTypeDetail::getName, entity.getName()).ne(entity.getId() != null, DictVehicleTypeDetail::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("名称已存在"); + } + + exists = service.lambdaQuery().eq(DictVehicleTypeDetail::getCode, entity.getCode()).ne(entity.getId() != null, DictVehicleTypeDetail::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("编码已存在"); + } + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/WharfController.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/WharfController.java new file mode 100644 index 0000000..b4346a9 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/WharfController.java @@ -0,0 +1,40 @@ +package com.wsnet.cargo.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wsnet.cargo.entity.DictWharf; +import com.wsnet.cargo.query.WharfQuery; +import com.wsnet.cargo.service.DictWharfService; +import com.wsnet.core.annotation.Menu; +import com.wsnet.core.response.ResultData; +import com.wsnet.web.controller.BaseDictController; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/wharf") +@Tag(name = "码头") +@Menu(code = "0211", name = "码头") +@Validated +public class WharfController extends BaseDictController { + + @Override + public ResultData> page(@RequestBody WharfQuery query) { + query.setFields("*+port@name"); + + return super.page(query); + } + + @Override + protected ResultData save(@RequestBody @Validated DictWharf entity) { + // 验证港口编码是否重复 + boolean exists = service.lambdaQuery().eq(DictWharf::getName, entity.getName()).eq(DictWharf::getPortId, entity.getPortId()).ne(entity.getId() != null,DictWharf::getId, entity.getId()).exists(); + if (exists) { + return ResultData.fail("码头名称已存在"); + } + + return super.save(entity); + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/mapper/PoMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/mapper/PoMapper.java new file mode 100644 index 0000000..fae982a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/controller/mapper/PoMapper.java @@ -0,0 +1,39 @@ +package com.wsnet.cargo.controller.mapper; + +import com.wsnet.cargo.entity.BusManifest; +import com.wsnet.cargo.entity.BusManifestDetail; +import com.wsnet.cargo.entity.BusSailSchedule; +import com.wsnet.cargo.excel.ManifestDetailImportExcel; +import com.wsnet.cargo.excel.ManifestImportExcel; +import com.wsnet.cargo.excel.SailScheduleImportExcel; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface PoMapper { + PoMapper instance = Mappers.getMapper(PoMapper.class); + + BusSailSchedule sailScheduleExcelToEntity(SailScheduleImportExcel excel); + + BusManifest manifestExcelToEntity(ManifestImportExcel excel); + + BusManifestDetail manifestDetailExcelToEntity(ManifestDetailImportExcel excel); + + @Mapping(target = "tradeTypeDesc", source = "tradeType.desc") + @Mapping(target = "shipRoute", source = "route.name") + @Mapping(target = "shipName", source = "ship.name") + @Mapping(target = "loadPortName", source = "loadPort.name") + @Mapping(target = "loadWharfName", source = "loadWharf.name") + @Mapping(target = "dischargePortName", source = "dischargePort.name") + @Mapping(target = "dischargeWharfName", source = "dischargeWharf.name") + SailScheduleImportExcel sailScheduleEntityToExcel(BusSailSchedule entity); + + @Mapping(target = "brandName", source = "brand.name") + ManifestImportExcel manifestEntityToExcel(BusManifest entity); + + @Mapping(target = "billNo", source = "manifest.billNo") + @Mapping(target = "vehicleTypeName", source = "vehicleType.name") + @Mapping(target = "vehicleTypeDetailName", source = "vehicleTypeDetail.name") + ManifestDetailImportExcel manifestDetailEntityToExcel(BusManifestDetail entity); +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/dto/EnterpriseVo.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/dto/EnterpriseVo.java new file mode 100644 index 0000000..a5bf093 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/dto/EnterpriseVo.java @@ -0,0 +1,92 @@ +package com.wsnet.cargo.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.wsnet.cargo.enums.EnterpriseTypeEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(title = "企业注册信息") +public class EnterpriseVo implements Serializable { + /** + * 企业名称 + */ + @Schema(description = "企业名称") + @NotBlank(message = "企业名称不能为空") + private String name; + + /** + * 企业编码 + */ + @Schema(description = "企业编码") + @NotBlank(message = "企业编码不能为空") + private String code; + + /** + * 详细地址 + */ + @Schema(description = "详细地址") + @NotBlank(message = "详细地址不能为空") + private String address; + + /** + * 法人代表 + */ + @Schema(description = "法人代表") + @NotBlank(message = "法人代表不能为空") + private String legalPerson; + + /** + * 合同编号 + */ + @Schema(description = "合同编号") + @NotBlank(message = "合同编号不能为空") + private String contractNo; + + /** + * 联系人 + */ + @Schema(description = "联系人") + @NotBlank(message = "联系人不能为空") + private String linkman; + + /** + * 联系电话 + */ + @Schema(description = "联系电话") + @NotBlank(message = "联系电话不能为空") + private String phone; + + /** + * 联系电话 + */ + @Schema(description = "登录密码") + @NotBlank(message = "登录密码不能为空") + private String password; + + /** + * 绑定的港口ID + */ + @Schema(description = "绑定的港口ID") + private Long portId; + + @Schema(description = "营业执照") + @NotBlank(message = "营业执照不能为空") + private String licensePhoto; + + @Schema(description = "身份证") + @NotBlank(message = "身份证不能为空") + private String idPhoto; + + /** + * 企业类别 + */ + @Schema(description = "企业类别") + @NotNull(message = "企业类别不能为空") + @TableField(value = "enterprise_type") + private EnterpriseTypeEnums enterpriseType; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusManifest.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusManifest.java new file mode 100644 index 0000000..f57d374 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusManifest.java @@ -0,0 +1,144 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.GoodsStatusEnums; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.math.BigDecimal; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 舱单信息 + * @TableName bus_manifest + */ +@TableName(value ="bus_manifest") +@Data +@Schema(title = "舱单信息") +public class BusManifest extends BaseEntity implements Serializable { + /** + * 船期ID + */ + @TableField(value = "schedule_id") + @Schema(description = "船期ID") + @NotNull(message = "船期ID不能为空") + private Long scheduleId; + + /** + * 舱层 + */ + @TableField(value = "deck") + @Schema(description = "舱层") + @NotNull(message = "舱层不能为空") + private Integer deck; + + /** + * 舱段 + */ + @TableField(value = "cabin") + @Schema(description = "舱段") + @NotNull(message = "舱段不能为空") + private Integer cabin; + + /** + * 提单号 + */ + @TableField(value = "bill_no") + @Schema(description = "提单号") + @NotNull(message = "提单号不能为空") + private String billNo; + + /** + * 货名 + */ + @TableField(value = "goods_name") + @Schema(description = "货名") + @NotNull(message = "货名不能为空") + private String goodsName; + + /** + * 品牌ID + */ + @TableField(value = "brand_id") + @Schema(description = "品牌ID") + @NotNull(message = "品牌ID不能为空") + private Long brandId; + + /** + * 型号 + */ + @TableField(value = "model") + @Schema(description = "型号") + @NotNull(message = "型号不能为空") + private String model; + + /** + * 唛头 + */ + @TableField(value = "shipping_mark") + @Schema(description = "唛头") + private String shippingMark; + + /** + * 车数量 + */ + @TableField(value = "car_num") + @Schema(description = "车数量") + private Integer carNum; + + /** + * 件杂货数 + */ + @TableField(value = "spare_num") + @Schema(description = "件杂货数") + private Integer spareNum; + + /** + * 重量 + */ + @TableField(value = "weight") + @Schema(description = "重量") + @NotNull(message = "重量不能为空") + private BigDecimal weight; + + /** + * 体积 + */ + @TableField(value = "volume") + @Schema(description = "体积") + @NotNull(message = "体积不能为空") + private BigDecimal volume; + + /** + * 发货人 + */ + @TableField(value = "consigner") + @Schema(description = "发货人") + private String consigner; + + /** + * 收货人 + */ + @TableField(value = "consignee") + @Schema(description = "收货人") + private String consignee; + + /** + * 货物状态 + */ + @TableField(value = "goods_status") + @Schema(description = "货物状态") + private GoodsStatusEnums goodsStatus; + + @TableField(exist = false) + @Schema(description = "品牌") + @DbBean(ref = "brandId") + private DictBrand brand; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusManifestDetail.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusManifestDetail.java new file mode 100644 index 0000000..2ef9f16 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusManifestDetail.java @@ -0,0 +1,135 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.math.BigDecimal; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 舱单明细 + * @TableName bus_manifest_detail + */ +@TableName(value ="bus_manifest_detail") +@Data +@Schema(title = "舱单明细") +public class BusManifestDetail extends BaseEntity implements Serializable { + /** + * 舱单ID + */ + @TableField(value = "manifest_id") + @Schema(description = "舱单ID") + @NotNull(message = "舱单ID不能为空") + private Long manifestId; + + /** + * 车型ID + */ + @TableField(value = "vehicle_type_id") + @Schema(description = "车型ID") + @NotNull(message = "车型ID不能为空") + private Long vehicleTypeId; + + /** + * 车型明细 + */ + @TableField(value = "vehicle_type_detail_id") + @Schema(description = "车型明细ID") + @NotNull(message = "车型明细ID不能为空") + private Long vehicleTypeDetailId; + + /** + * vin + */ + @TableField(value = "vin") + @Schema(description = "vin") + @NotBlank(message = "vin码不能为空") + private String vin; + + /** + * 重量 + */ + @TableField(value = "weight") + @Schema(description = "重量") + private BigDecimal weight; + + /** + * 体积 + */ + @TableField(value = "volume") + @Schema(description = "体积") + private BigDecimal volume; + + /** + * 长 + */ + @TableField(value = "length") + @Schema(description = "长") + private BigDecimal length; + + /** + * 宽 + */ + @TableField(value = "width") + @Schema(description = "宽") + private BigDecimal width; + + /** + * 高 + */ + @TableField(value = "height") + @Schema(description = "高") + private BigDecimal height; + + /** + * BAmm + */ + @TableField(value = "b_amm") + @Schema(description = "BAmm") + private String bAmm; + + /** + * LRmm + */ + @TableField(value = "l_rmm") + @Schema(description = "LRmm") + private String lRmm; + + /** + * 有无质损 + */ + @TableField(value = "damage") + @Schema(description = "有无质损") + private String damage; + + /** + * 质损描述 + */ + @TableField(value = "damage_desc") + @Schema(description = "质损描述") + private String damageDesc; + + @TableField(exist = false) + @DbBean(ref = "vehicleTypeId") + @Schema(description = "车型") + private DictVehicleType vehicleType; + + @TableField(exist = false) + @DbBean(ref = "vehicleTypeDetailId") + @Schema(description = "车型明细") + private DictVehicleTypeDetail vehicleTypeDetail; + + @TableField(exist = false) + @DbBean(ref = "manifestId") + @Schema(description = "舱单") + private BusManifest manifest; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusNotice.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusNotice.java new file mode 100644 index 0000000..eb6af06 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusNotice.java @@ -0,0 +1,38 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * 公告 + * @TableName bus_notice + */ +@TableName(value ="bus_notice") +@Data +@Schema(title = "公告") +public class BusNotice extends BaseEntity implements Serializable { + /** + * 公告标题 + */ + @TableField(value = "title") + @Schema(description = "公告标题") + @NotBlank(message = "公告标题不能为空") + private String title; + + /** + * 公告内容 + */ + @TableField(value = "content") + @Schema(description = "公告内容") + @NotBlank(message = "公告内容不能为空") + private String content; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusSailSchedule.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusSailSchedule.java new file mode 100644 index 0000000..4016d0f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusSailSchedule.java @@ -0,0 +1,191 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.ShipStatusEnums; +import com.wsnet.cargo.enums.TradeTypeEnums; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.util.Date; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 船期 + * @TableName bus_sail_schedule + */ +@TableName(value ="bus_sail_schedule") +@Data +@Schema(title = "船期") +public class BusSailSchedule extends BaseEntity implements Serializable { + /** + * 企业ID + */ + @TableField(value = "enterprise_id") + @Schema(description = "企业ID") + @NotNull(message = "企业ID不能为空") + private Long enterpriseId; + + /** + * 船ID + */ + @TableField(value = "ship_id") + @Schema(description = "船ID") + @NotNull(message = "船ID不能为空") + private Long shipId; + + /** + * 航次 + */ + @TableField(value = "voyage") + @Schema(description = "航次") + @NotBlank(message = "航次不能为空") + private String voyage; + + /** + * 航线ID + */ + @TableField(value = "ship_route_id") + @Schema(description = "航线ID") + @NotNull(message = "航线ID不能为空") + private Long shipRouteId; + + /** + * 装货码头 + */ + @TableField(value = "load_wharf_id") + @Schema(description = "装货码头") + @NotNull(message = "装货码头不能为空") + private Long loadWharfId; + + /** + * 卸货码头 + */ + @TableField(value = "discharge_wharf_id") + @Schema(description = "卸货码头") + @NotNull(message = "卸货码头不能为空") + private Long dischargeWharfId; + + /** + * 计划商品车数量 + */ + @TableField(value = "car_num_plan") + @Schema(description = "计划商品车数量") + @NotNull(message = "计划商品车数量不能为空") + private Integer carNumPlan; + + /** + * 计划件杂货数量 + */ + @TableField(value = "spare_num_plan") + @Schema(description = "计划件杂货数量") + @NotNull(message = "计划件杂货数量不能为空") + private Integer spareNumPlan; + + /** + * 实际商品车数量 + */ + @TableField(value = "car_num_actual") + @Schema(description = "实际商品车数量") + @NotNull(message = "实际商品车数量不能为空") + private Integer carNumActual; + + /** + * 实际件杂货数量 + */ + @TableField(value = "spare_num_actual") + @Schema(description = "实际件杂货数量") + @NotNull(message = "实际件杂货数量不能为空") + private Integer spareNumActual; + + /** + * 计划离泊时间 + */ + @TableField(value = "departure_date_plan") + @Schema(description = "计划离泊时间") + @NotNull(message = "计划离泊时间不能为空") + private Date departureDatePlan; + + /** + * 实际离泊时间 + */ + @TableField(value = "departure_date_actual") + @Schema(description = "实际离泊时间") + @NotNull(message = "实际离泊时间不能为空") + private Date departureDateActual; + + /** + * 船舶状态 + */ + @TableField(value = "ship_status") + @Schema(description = "船舶状态") + @NotNull(message = "船舶状态不能为空") + private ShipStatusEnums shipStatus; + + /** + * 贸易类型 + */ + @TableField(value = "trade_type") + @Schema(description = "贸易类型") + @NotNull(message = "贸易类型不能为空") + private TradeTypeEnums tradeType; + + /** + * 装货港口 + */ + @TableField(value = "load_port_id") + @Schema(description = "装货港口") + @NotNull(message = "装货港口不能为空") + private Long loadPortId; + + /** + * 卸货港口 + */ + @TableField(value = "discharge_port_id") + @Schema(description = "卸货港口") + @NotNull(message = "卸货港口不能为空") + private Long dischargePortId; + + + @TableField(exist = false) + @DbBean(ref = "shipId") + @Schema(description = "船舶") + private DictShip ship; + + @TableField(exist = false) + @DbBean(ref = "shipRouteId") + @Schema(description = "航线") + private DictShipRoute route; + + @TableField(exist = false) + @DbBean(ref = "loadWharfId") + @Schema(description = "装货码头") + private DictWharf loadWharf; + + @TableField(exist = false) + @DbBean(ref = "dischargeWharfId") + @Schema(description = "卸货码头") + private DictWharf dischargeWharf; + + @TableField(exist = false) + @DbBean(ref = "loadPortId") + @Schema(description = "装货港口") + private DictPort loadPort; + + @TableField(exist = false) + @DbBean(ref = "dischargePortId") + @Schema(description = "卸货港口") + private DictPort dischargePort; + + @TableField(exist = false) + @DbBean(ref = "enterpriseId") + @Schema(description = "企业") + private DictEnterprise enterprise; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusSubscribe.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusSubscribe.java new file mode 100644 index 0000000..ae38912 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/BusSubscribe.java @@ -0,0 +1,111 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.SubscribeStatusEnums; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.util.Date; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 订阅 + * @TableName bus_subscribe + */ +@TableName(value ="bus_subscribe") +@Data +@Schema(title = "订阅") +public class BusSubscribe extends BaseEntity implements Serializable { + /** + * 订阅企业ID + */ + @TableField(value = "enterprise_id") + @Schema(description = "订阅企业ID") + private Long enterpriseId; + + /** + * 订阅港口ID + */ + @TableField(value = "port_id") + @Schema(description = "订阅港口ID") + @NotNull(message = "订阅港口ID不能为空") + private Long portId; + + /** + * 订阅码头ID + */ + @TableField(value = "wharf_id") + @Schema(description = "订阅码头ID") + @NotNull(message = "订阅码头ID不能为空") + private Long wharfId; + + /** + * 订阅的企业ID + */ + @TableField(value = "sub_enterprise_id") + @Schema(description = "订阅的企业ID") + @NotNull(message = "订阅的企业ID不能为空") + private Long subEnterpriseId; + + /** + * 订阅的航线ID + */ + @TableField(value = "sub_ship_route_id") + @Schema(description = "订阅的航线ID") + @NotNull(message = "订阅的航线ID不能为空") + private Long subShipRouteId; + + /** + * 订阅的港口ID + */ + @TableField(value = "sub_port_id") + @Schema(description = "订阅的港口ID") + @NotNull(message = "订阅的港口ID不能为空") + private Long subPortId; + + /** + * 订阅的码头ID + */ + @TableField(value = "sub_wharf_id") + @Schema(description = "订阅的码头ID") + @NotNull(message = "订阅的码头ID不能为空") + private Long subWharfId; + + /** + * 订阅类型,枚举可以多选 + */ + @TableField(value = "sub_info") + @Schema(description = "订阅类型,枚举可以多选") + @NotBlank(message = "订阅类型,枚举可以多选不能为空") + private String subInfo; + + /** + * 订阅开始日期 + */ + @TableField(value = "begin_date") + @Schema(description = "订阅开始日期") + @NotNull(message = "订阅开始日期不能为空") + private Date beginDate; + + /** + * 订阅结束日期 + */ + @TableField(value = "end_date") + @Schema(description = "订阅结束日期") + @NotNull(message = "订阅结束日期不能为空") + private Date endDate; + + /** + * 订阅状态 + */ + @TableField(value = "sub_status") + @Schema(description = "订阅状态") + private SubscribeStatusEnums subStatus; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictBrand.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictBrand.java new file mode 100644 index 0000000..714941f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictBrand.java @@ -0,0 +1,58 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 品牌 + * @TableName dict_brand + */ +@TableName(value ="dict_brand") +@Data +@DbDict +@Schema(title = "品牌") +public class DictBrand extends BaseEntity implements Serializable { + /** + * 品牌名称 + */ + @TableField(value = "name") + @Schema(description = "品牌名称") + @NotBlank(message = "品牌名称不能为空") + private String name; + + /** + * 品牌编码 + */ + @TableField(value = "code") + @Schema(description = "品牌编码") + @NotBlank(message = "品牌编码不能为空") + private String code; + + /** + * 品牌英文名称 + */ + @TableField(value = "en_name") + @Schema(description = "品牌英文名称") + @NotBlank(message = "品牌英文名称不能为空") + private String enName; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictCity.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictCity.java new file mode 100644 index 0000000..23db55b --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictCity.java @@ -0,0 +1,41 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.util.Date; + +import com.wsnet.core.enums.StatusEnums; +import lombok.Data; + +/** + * 全国城市列表 + * @TableName dict_city + */ +@TableName(value ="dict_city") +@Data +public class DictCity extends BaseEntity implements Serializable { + /** + * 名称 + */ + @TableField(value = "name") + private String name; + + /** + * 编码 + */ + @TableField(value = "code") + private String code; + + /** + * 状态 + */ + @TableField(value = "status") + private StatusEnums status; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictEmployee.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictEmployee.java new file mode 100644 index 0000000..6e7185a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictEmployee.java @@ -0,0 +1,100 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 企业员工 + * @TableName dict_employee + */ +@TableName(value ="dict_employee") +@Data +@DbDict(ref = "enterpriseId") +@Schema(title = "员工") +public class DictEmployee extends BaseEntity implements Serializable { + /** + * 企业ID + */ + @Schema(description = "企业ID") + @NotNull(message = "企业ID不能为空") + @TableField(value = "enterprise_id") + private Long enterpriseId; + + /** + * 姓名 + */ + @Schema(description = "姓名") + @NotBlank(message = "姓名不能为空") + @TableField(value = "name") + private String name; + + /** + * 昵称 + */ + @Schema(description = "昵称") + @TableField(value = "nickname") + private String nickname; + + /** + * 用户名 + */ + @Schema(description = "用户名") + @NotBlank(message = "用户名不能为空") + @TableField(value = "username") + private String username; + + /** + * 联系电话 + */ + @Schema(description = "联系电话") + @NotBlank(message = "联系电话不能为空") + @TableField(value = "phone") + private String phone; + + /** + * 码头ID + */ + @Schema(description = "码头ID") + @TableField(value = "wharf_id") + private Long wharfId; + + /** + * 绑定用户ID + */ + @TableField(value = "user_id") + private Long userId; + + @Schema(description = "密码") + @NotBlank(message = "密码不能为空") + @TableField(exist = false) + private String password; + + /** + * 状态 + */ + @TableField(value = "status") + private StatusEnums status; + + @TableField(exist = false) + @DbBean(ref = "enterpriseId") + @Schema(description = "企业") + private DictEnterprise enterprise; + + @TableField(exist = false) + @DbBean(ref = "wharfId") + @Schema(description = "码头") + private DictWharf wharf; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictEnterprise.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictEnterprise.java new file mode 100644 index 0000000..3e2f60a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictEnterprise.java @@ -0,0 +1,102 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.EnterpriseStatusEnums; +import com.wsnet.cargo.enums.EnterpriseTypeEnums; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import lombok.Data; + +/** + * 企业 + * @TableName dict_enterprise + */ +@TableName(value ="dict_enterprise") +@Data +@DbDict +public class DictEnterprise extends BaseEntity implements Serializable { + /** + * 企业名称 + */ + @TableField(value = "name") + private String name; + + /** + * 企业编码 + */ + @TableField(value = "code") + private String code; + + /** + * 详细地址 + */ + @TableField(value = "address") + private String address; + + /** + * 法人代表 + */ + @TableField(value = "legal_person") + private String legalPerson; + + /** + * 合同编号 + */ + @TableField(value = "contract_no") + private String contractNo; + + /** + * 联系人 + */ + @TableField(value = "linkman") + private String linkman; + + /** + * 联系电话 + */ + @TableField(value = "phone") + private String phone; + + /** + * 审核状态 + */ + @TableField(value = "enterprise_status") + private EnterpriseStatusEnums enterpriseStatus; + + /** + * 关联登录账号ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 绑定的港口ID + */ + @TableField(value = "port_id") + private Long portId; + + /** + * 企业类别 + */ + @TableField(value = "enterprise_type") + private EnterpriseTypeEnums enterpriseType; + + /** + * 营业执照图片 + */ + @TableField(value = "license_photo") + private String licensePhoto; + + /** + * 身份证图片 + */ + @TableField(value = "id_photo") + private String idPhoto; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictPort.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictPort.java new file mode 100644 index 0000000..e66fe38 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictPort.java @@ -0,0 +1,134 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.PortTypeEnums; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 港口 + * @TableName dict_port + */ +@TableName(value ="dict_port") +@Data +@DbDict +@Schema(title = "港口") +public class DictPort extends BaseEntity implements Serializable { + /** + * 港口名称 + */ + @TableField(value = "name") + @Schema(description = "港口名称") + @NotBlank(message = "港口名称不能为空") + private String name; + + /** + * 港口编码 + */ + @TableField(value = "code") + @Schema(description = "港口编码") + @NotBlank(message = "港口编码不能为空") + private String code; + + /** + * 省份 + */ + @TableField(value = "province_id") + @Schema(description = "省份") + @NotNull(message = "省份不能为空") + private Long provinceId; + + /** + * 城市 + */ + @TableField(value = "city_id") + @Schema(description = "城市") + @NotNull(message = "城市不能为空") + private Long cityId; + + /** + * 港口地址 + */ + @TableField(value = "address") + @Schema(description = "港口地址") + @NotBlank(message = "港口地址不能为空") + private String address; + + /** + * 港口类型 + */ + @TableField(value = "port_type") + @Schema(description = "港口类型") + @NotNull(message = "港口类型不能为空") + private PortTypeEnums portType; + + /** + * 通过能力 + */ + @TableField(value = "transit_capacity") + @Schema(description = "通过能力") + @NotNull(message = "通过能力不能为空") + private Integer transitCapacity; + + /** + * 堆存能力 + */ + @TableField(value = "storage_capacity") + @Schema(description = "堆存能力") + @NotNull(message = "堆存能力不能为空") + private Integer storageCapacity; + + /** + * 接卸能力 + */ + @TableField(value = "handling_capacity") + @Schema(description = "接卸能力") + @NotNull(message = "接卸能力不能为空") + private Integer handlingCapacity; + + /** + * 码头数量 + */ + @TableField(value = "wharf_num") + @Schema(description = "码头数量") + @NotNull(message = "码头数量不能为空") + private Integer wharfNum; + + /** + * 泊位总数 + */ + @TableField(value = "berthage_num") + @Schema(description = "泊位总数") + @NotNull(message = "泊位总数不能为空") + private Integer berthageNum; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + @TableField(exist = false) + @Schema(description = "省") + @DbBean(ref = "provinceId") + private DictCity province; + + @TableField(exist = false) + @Schema(description = "市") + @DbBean(ref="cityId") + private DictCity city; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShip.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShip.java new file mode 100644 index 0000000..fc13296 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShip.java @@ -0,0 +1,132 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.SeaworthinessEnums; +import com.wsnet.cargo.enums.ShipTypeEnums; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.math.BigDecimal; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 船舶 + * @TableName dict_ship + */ +@TableName(value ="dict_ship") +@Data +@DbDict +@Schema(title = "船舶") +public class DictShip extends BaseEntity implements Serializable { + /** + * 船舶名称 + */ + @TableField(value = "name") + @Schema(description = "船舶名称") + @NotBlank(message = "船舶名称不能为空") + private String name; + + /** + * 船舶海事识别编号 + */ + @TableField(value = "mmsi") + @Schema(description = "船舶海事识别编号") + @NotBlank(message = "船舶海事识别编号不能为空") + private String mmsi; + + /** + * 船龄 + */ + @TableField(value = "ship_age") + @Schema(description = "船龄") + @NotNull(message = "船龄不能为空") + private Integer shipAge; + + /** + * 船舶类型 + */ + @TableField(value = "ship_type") + @Schema(description = "船舶类型") + @NotNull(message = "船舶类型不能为空") + private ShipTypeEnums shipType; + + /** + * 载重 + */ + @TableField(value = "load") + @Schema(description = "载重") + @NotNull(message = "载重不能为空") + private BigDecimal load; + + /** + * 船长(米) + */ + @TableField(value = "ship_length") + @Schema(description = "船长(米)") + @NotNull(message = "船长(米)不能为空") + private BigDecimal shipLength; + + /** + * 空船吃水(米) + */ + @TableField(value = "empty_ship_draft") + @Schema(description = "空船吃水(米)") + @NotNull(message = "空船吃水(米)不能为空") + private BigDecimal emptyShipDraft; + + /** + * 满载吃水(米) + */ + @TableField(value = "full_load_draft") + @Schema(description = "满载吃水(米)") + @NotNull(message = "满载吃水(米)不能为空") + private BigDecimal fullLoadDraft; + + /** + * 跳板数量 + */ + @TableField(value = "springboard_num") + @Schema(description = "跳板数量") + @NotNull(message = "跳板数量不能为空") + private Integer springboardNum; + + /** + * 跳板位置 + */ + @TableField(value = "springboard_location") + @Schema(description = "跳板位置") + @NotBlank(message = "跳板位置不能为空") + private String springboardLocation; + + /** + * 适航航线 + */ + @TableField(value = "seaworthiness") + @Schema(description = "适航航线") + private SeaworthinessEnums seaworthiness; + + /** + * 常走航线 + */ + @TableField(value = "regular") + @Schema(description = "常走航线") + private String regular; + + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipChart.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipChart.java new file mode 100644 index 0000000..acfbfb7 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipChart.java @@ -0,0 +1,70 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 船图 + * @TableName dict_ship_chart + */ +@TableName(value ="dict_ship_chart") +@Data +@Schema(title = "船图") +public class DictShipChart extends BaseEntity implements Serializable { + /** + * 船舶ID + */ + @TableField(value = "ship_id") + @Schema(description = "船舶ID") + @NotNull(message = "船舶ID不能为空") + private Long shipId; + + /** + * 舱层数量 + */ + @TableField(value = "decks_num") + @Schema(description = "舱层数量") + @NotNull(message = "舱层数量不能为空") + private Integer decksNum; + + /** + * 舱层分段及积载能力 + */ + @TableField(value = "stowage_capacity") + @Schema(description = "舱层分段及积载能力") + @NotBlank(message = "舱层分段及积载能力不能为空") + private String stowageCapacity; + + /** + * 舱层分层平面布局图 + */ + @TableField(value = "floor_plan") + @Schema(description = "舱层分层平面布局图") + @NotBlank(message = "舱层分层平面布局图不能为空") + private String floorPlan; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + @TableField(exist = false) + @DbBean(ref = "shipId") + @Schema(description = "船舶") + private DictShip ship; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipRoute.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipRoute.java new file mode 100644 index 0000000..9212283 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipRoute.java @@ -0,0 +1,50 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 航线 + * @TableName dict_ship_route + */ +@TableName(value ="dict_ship_route") +@Data +@DbDict +@Schema(title = "航线") +public class DictShipRoute extends BaseEntity implements Serializable { + /** + * 航线名称 + */ + @TableField(value = "name") + @Schema(description = "航线名称") + @NotBlank(message = "航线名称不能为空") + private String name; + + /** + * 航线编码 + */ + @TableField(value = "code") + @Schema(description = "航线编码") + @NotBlank(message = "航线编码不能为空") + private String code; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipRoutePort.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipRoutePort.java new file mode 100644 index 0000000..cbdb021 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictShipRoutePort.java @@ -0,0 +1,54 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 航线-码头对照表 + * @TableName dict_ship_route_port + */ +@TableName(value ="dict_ship_route_port") +@Data +@Schema(title = "航线-码头对照表") +public class DictShipRoutePort extends BaseEntity implements Serializable { + /** + * 航线ID + */ + @TableField(value = "route_id") + @Schema(description = "航线ID") + @NotNull(message = "航线ID不能为空") + private Long routeId; + + /** + * 港口ID + */ + @TableField(value = "port_id") + @Schema(description = "港口ID") + @NotNull(message = "港口ID不能为空") + private Long portId; + + /** + * 码头ID + */ + @TableField(value = "wharf_id") + @Schema(description = "码头ID") + @NotNull(message = "码头ID不能为空") + private Long wharfId; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private Integer status; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictVehicleType.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictVehicleType.java new file mode 100644 index 0000000..679f898 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictVehicleType.java @@ -0,0 +1,59 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 车型 + * @TableName dict_vehicle_type + */ +@TableName(value ="dict_vehicle_type") +@Data +@DbDict +@Schema(title = "车型") +public class DictVehicleType extends BaseEntity implements Serializable { + /** + * 码头名称 + */ + @TableField(value = "name") + @Schema(description = "车型名称") + @NotBlank(message = "车型名称不能为空") + private String name; + + /** + * 码头编码 + */ + @TableField(value = "code") + @Schema(description = "车型编码") + @NotBlank(message = "车型编码不能为空") + private String code; + + /** + * 码头英文名称 + */ + @TableField(value = "en_name") + @Schema(description = "车型英文名称") + @NotBlank(message = "车型英文名称不能为空") + private String enName; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictVehicleTypeDetail.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictVehicleTypeDetail.java new file mode 100644 index 0000000..1b3b4ba --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictVehicleTypeDetail.java @@ -0,0 +1,72 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 车型明细 + * @TableName dict_vehicle_type_detail + */ +@TableName(value ="dict_vehicle_type_detail") +@Data +@DbDict(ref = "vehicleTypeId") +@Schema(title = "车型明细") +public class DictVehicleTypeDetail extends BaseEntity implements Serializable { + /** + * 名称 + */ + @TableField(value = "name") + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 编码 + */ + @TableField(value = "code") + @Schema(description = "编码") + @NotBlank(message = "编码不能为空") + private String code; + + /** + * 英文名称 + */ + @TableField(value = "en_name") + @Schema(description = "英文名称") + @NotBlank(message = "英文名称不能为空") + private String enName; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + /** + * 车型ID + */ + @TableField(value = "vehicle_type_id") + @Schema(description = "车型ID") + @NotNull(message = "车型ID不能为空") + private Long vehicleTypeId; + + @TableField(exist = false) + @DbBean(ref = "vehicleTypeId") + @Schema(description = "车型") + private DictVehicleType vehicleType; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictWharf.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictWharf.java new file mode 100644 index 0000000..255c48f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/DictWharf.java @@ -0,0 +1,111 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.annos.DbBean; +import com.wsnet.core.db.annos.DbDict; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.math.BigDecimal; + +import com.wsnet.core.enums.StatusEnums; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * 码头 + * @TableName dict_wharf + */ +@TableName(value ="dict_wharf") +@Data +@DbDict(ref = "portId") +@Schema(title = "码头") +public class DictWharf extends BaseEntity implements Serializable { + /** + * 码头名称 + */ + @Schema(description = "码头名称") + @NotBlank(message = "码头名称不能为空") + @TableField(value = "name") + private String name; + + /** + * 港口ID + */ + @TableField(value = "port_id") + @Schema(description = "港口ID") + @NotNull(message = "港口ID不能为空") + private Long portId; + + /** + * 详细地址 + */ + @TableField(value = "address") + @Schema(description = "详细地址") + @NotBlank(message = "详细地址不能为空") + private String address; + + /** + * 经度 + */ + @TableField(value = "longitude") + @Schema(description = "经度") + private BigDecimal longitude; + + /** + * 纬度 + */ + @TableField(value = "latitude") + @Schema(description = "纬度") + private BigDecimal latitude; + + /** + * 泊位数量 + */ + @TableField(value = "berthage_num") + @Schema(description = "泊位数量") + @NotNull(message = "泊位数量不能为空") + private Integer berthageNum; + + /** + * 通过能力 + */ + @TableField(value = "transit_capacity") + @Schema(description = "通过能力") + @NotNull(message = "通过能力不能为空") + private Integer transitCapacity; + + /** + * 堆存能力 + */ + @TableField(value = "storage_capacity") + @Schema(description = "堆存能力") + @NotNull(message = "堆存能力不能为空") + private Integer storageCapacity; + + /** + * 接卸能力 + */ + @TableField(value = "handling_capacity") + @Schema(description = "接卸能力") + @NotNull(message = "接卸能力不能为空") + private Integer handlingCapacity; + + /** + * 状态 + */ + @TableField(value = "status") + @Schema(description = "状态") + @NotNull(message = "状态不能为空") + private StatusEnums status; + + @TableField(exist = false) + @Schema(description = "港口") + @DbBean(ref = "portId") + private DictPort port; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/HelpApi.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/HelpApi.java new file mode 100644 index 0000000..8bf2120 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/HelpApi.java @@ -0,0 +1,62 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * API + * @TableName help_api + */ +@TableName(value ="help_api") +@Data +@Schema(title = "API") +public class HelpApi extends BaseEntity implements Serializable { + /** + * 名称 + */ + @TableField(value = "name") + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 接口地址 + */ + @TableField(value = "url") + @Schema(description = "接口地址") + @NotBlank(message = "接口地址不能为空") + private String url; + + /** + * 功能描述 + */ + @TableField(value = "remark") + @Schema(description = "功能描述") + @NotBlank(message = "功能描述不能为空") + private String remark; + + /** + * 接口参数 + */ + @TableField(value = "req") + @Schema(description = "接口参数") + @NotBlank(message = "接口参数不能为空") + private String req; + + /** + * 接口返回 + */ + @TableField(value = "resp") + @Schema(description = "接口返回") + @NotBlank(message = "接口返回不能为空") + private String resp; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/HelpDoc.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/HelpDoc.java new file mode 100644 index 0000000..cf90608 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/entity/HelpDoc.java @@ -0,0 +1,57 @@ +package com.wsnet.cargo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.wsnet.cargo.enums.QuestionTypeEnums; +import com.wsnet.core.db.entity.BaseEntity; +import java.io.Serializable; +import java.math.BigDecimal; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * help + * @TableName help_doc + */ +@TableName(value ="help_doc") +@Data +@Schema(title = "帮助文档") +public class HelpDoc extends BaseEntity implements Serializable { + /** + * 序号 + */ + @TableField(value = "serial") + @Schema(description = "序号") + @NotNull(message = "序号不能为空") + private BigDecimal serial; + + /** + * 名称 + */ + @TableField(value = "name") + @Schema(description = "名称") + @NotBlank(message = "名称不能为空") + private String name; + + /** + * 类型 + */ + @TableField(value = "remark") + @Schema(description = "备注") + @NotBlank(message = "备注不能为空") + private String remark; + + /** + * 类型 + */ + @TableField(value = "type") + @Schema(description = "类型") + @NotNull(message = "类型不能为空") + private QuestionTypeEnums type; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/EnterpriseStatusEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/EnterpriseStatusEnums.java new file mode 100644 index 0000000..314974c --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/EnterpriseStatusEnums.java @@ -0,0 +1,42 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum EnterpriseStatusEnums { + AUDIT("0", "待审核"), + USED("1", "正常"), + CLOSE("2", "已关闭"), + SIGN_OUT("3", "已注册") + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + EnterpriseStatusEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static EnterpriseStatusEnums getEnum(String code) { + for (EnterpriseStatusEnums e : EnterpriseStatusEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/EnterpriseTypeEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/EnterpriseTypeEnums.java new file mode 100644 index 0000000..2c0260b --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/EnterpriseTypeEnums.java @@ -0,0 +1,44 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import com.wsnet.core.enums.StatusEnums; +import org.apache.commons.lang3.StringUtils; + +public enum EnterpriseTypeEnums { + PORT("1", "港口码头"), + SHIP("2", "船公司"), + CARGO_OWNER("3", "货主"), + SHIP_LOAN("4", "船代"), + GOODS_LOAN("5", "货贷"), + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + EnterpriseTypeEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static EnterpriseTypeEnums getEnum(String code) { + for (EnterpriseTypeEnums e : EnterpriseTypeEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/GoodsStatusEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/GoodsStatusEnums.java new file mode 100644 index 0000000..f0f6c4f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/GoodsStatusEnums.java @@ -0,0 +1,40 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum GoodsStatusEnums { + SEA("1", "海港"), + RIVER("2", "河港") + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + GoodsStatusEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static GoodsStatusEnums getEnum(String code) { + for (GoodsStatusEnums e : GoodsStatusEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/PortTypeEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/PortTypeEnums.java new file mode 100644 index 0000000..0c77481 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/PortTypeEnums.java @@ -0,0 +1,40 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum PortTypeEnums { + SEA("1", "海港"), + RIVER("2", "河港") + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + PortTypeEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static PortTypeEnums getEnum(String code) { + for (PortTypeEnums e : PortTypeEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/QuestionTypeEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/QuestionTypeEnums.java new file mode 100644 index 0000000..b812acb --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/QuestionTypeEnums.java @@ -0,0 +1,39 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum QuestionTypeEnums { + SUBJECT("1", "主题"), + QUESTION("2", "问题"), + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + QuestionTypeEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static QuestionTypeEnums getEnum(String code) { + for (QuestionTypeEnums e : QuestionTypeEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/SeaworthinessEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/SeaworthinessEnums.java new file mode 100644 index 0000000..09e6927 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/SeaworthinessEnums.java @@ -0,0 +1,42 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum SeaworthinessEnums { + OCEAN("1", "远洋"), + INSHORE("2", "近海"), + COASTAL("2", "沿海"), + INLAND_RIVER("3", "内河"); + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + SeaworthinessEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static SeaworthinessEnums getEnum(String code) { + for (SeaworthinessEnums e : SeaworthinessEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/ShipStatusEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/ShipStatusEnums.java new file mode 100644 index 0000000..6521ce7 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/ShipStatusEnums.java @@ -0,0 +1,40 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum ShipStatusEnums { + SEA("1", "海港"), + RIVER("2", "河港") + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + ShipStatusEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static ShipStatusEnums getEnum(String code) { + for (ShipStatusEnums e : ShipStatusEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/ShipTypeEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/ShipTypeEnums.java new file mode 100644 index 0000000..0eadaac --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/ShipTypeEnums.java @@ -0,0 +1,41 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum ShipTypeEnums { + ROLL_SHIP("1", "滚装船"), + CAR_ROLL_SHIP("2", "汽车专用滚装船"), + OTHER_ROLL_SHIP("2", "其他滚装船") + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + ShipTypeEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static ShipTypeEnums getEnum(String code) { + for (ShipTypeEnums e : ShipTypeEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/SubscribeStatusEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/SubscribeStatusEnums.java new file mode 100644 index 0000000..ba28550 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/SubscribeStatusEnums.java @@ -0,0 +1,42 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum SubscribeStatusEnums { + NO_ACCEPTED("1", "待接受"), + CLOSED("2", "已关闭"), + SUBSCRIBE("3", "订阅中"), + CANCELLED("4", "已取消") + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + SubscribeStatusEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static SubscribeStatusEnums getEnum(String code) { + for (SubscribeStatusEnums e : SubscribeStatusEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/TradeTypeEnums.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/TradeTypeEnums.java new file mode 100644 index 0000000..cbfd22d --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/enums/TradeTypeEnums.java @@ -0,0 +1,50 @@ +package com.wsnet.cargo.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import org.apache.commons.lang3.StringUtils; + +public enum TradeTypeEnums { + OUT_IMPORT("1", "外贸进口"), + OUT_EXPORT("2", "外贸出口"), + IN("3", "内贸"), + ; + + @EnumValue + private final String code; + + @JsonValue + private final String desc; + + TradeTypeEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } + + + public static TradeTypeEnums getEnum(String code) { + for (TradeTypeEnums e : TradeTypeEnums.values()) { + if (StringUtils.equals(e.getCode(), code)) { + return e; + } + } + return null; + } + + public static TradeTypeEnums getEnumByDesc(String desc) { + for (TradeTypeEnums e : TradeTypeEnums.values()) { + if (StringUtils.equals(e.getDesc(), desc)) { + return e; + } + } + return null; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/ManifestDetailImportExcel.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/ManifestDetailImportExcel.java new file mode 100644 index 0000000..f8cff0f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/ManifestDetailImportExcel.java @@ -0,0 +1,96 @@ +package com.wsnet.cargo.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +@Schema(title = "舱单明细导入") +public class ManifestDetailImportExcel implements Serializable { + /** + * 舱单ID + */ + @ExcelProperty(value = "*提单号") + @NotBlank(message = "提单号不能为空") + private String billNo; + + /** + * 车型ID + */ + @ExcelProperty(value = "*车型") + @NotBlank(message = "车型不能为空") + private String vehicleTypeName; + + /** + * 车型明细 + */ + @ExcelProperty(value = "*车型明细") + @NotBlank(message = "车型明细不能为空") + private String vehicleTypeDetailName; + + /** + * vin + */ + @ExcelProperty(value = "vin") + @NotBlank(message = "vin码不能为空") + private String vin; + + /** + * 重量 + */ + @ExcelProperty(value = "重量") + private BigDecimal weight; + + /** + * 体积 + */ + @ExcelProperty(value = "体积") + private BigDecimal volume; + + /** + * 长 + */ + @ExcelProperty(value = "长") + private BigDecimal length; + + /** + * 宽 + */ + @ExcelProperty(value = "宽") + private BigDecimal width; + + /** + * 高 + */ + @ExcelProperty(value = "高") + private BigDecimal height; + + /** + * BAmm + */ + @ExcelProperty(value = "BAmm") + private String bAmm; + + /** + * LRmm + */ + @ExcelProperty(value = "LRmm") + private String lRmm; + + /** + * 有无质损 + */ + @ExcelProperty(value = "有无质损") + private String damage; + + /** + * 质损描述 + */ + @ExcelProperty(value = "质损描述") + private String damageDesc; + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/ManifestImportExcel.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/ManifestImportExcel.java new file mode 100644 index 0000000..719377f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/ManifestImportExcel.java @@ -0,0 +1,108 @@ +package com.wsnet.cargo.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +@Schema(title = "舱单导入") +public class ManifestImportExcel implements Serializable { + +// @ExcelProperty(value = "船名") +// private String shipName; +// +// @ExcelProperty(value = "省份") +// private String province; +// +// @ExcelProperty(value = "城市") +// private String city; + + /** + * 舱层 + */ + @ExcelProperty(value = "舱层") + @NotNull(message = "舱层不能为空") + private Integer deck; + + /** + * 舱段 + */ + @ExcelProperty(value = "舱段") + @NotNull(message = "舱段不能为空") + private Integer cabin; + + /** + * 提单号 + */ + @ExcelProperty(value = "*提单号") + @NotBlank(message = "提单号不能为空") + private String billNo; + + /** + * 货名 + */ + @ExcelProperty(value = "*货名") + @NotBlank(message = "货名不能为空") + private String goodsName; + + /** + * 品牌ID + */ + @ExcelProperty(value = "*品牌") + @NotNull(message = "品牌不能为空") + private String brandName; + + /** + * 型号 + */ + @ExcelProperty(value = "型号") + private String model; + + /** + * 唛头 + */ + @ExcelProperty(value = "唛头") + private String shippingMark; + + /** + * 车数量 + */ + @ExcelProperty(value = "车数量") + private Integer carNum; + + /** + * 件杂货数 + */ + @ExcelProperty(value = "件杂货数") + private Integer spareNum; + + /** + * 重量 + */ + @ExcelProperty(value = "重量") + private BigDecimal weight; + + /** + * 体积 + */ + @ExcelProperty(value = "体积") + private BigDecimal volume; + + /** + * 发货人 + */ + @ExcelProperty(value = "发货人") + private String consigner; + + /** + * 收货人 + */ + @ExcelProperty(value = "收货人") + private String consignee; + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/SailScheduleImportExcel.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/SailScheduleImportExcel.java new file mode 100644 index 0000000..36c4b7c --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/excel/SailScheduleImportExcel.java @@ -0,0 +1,119 @@ +package com.wsnet.cargo.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.alibaba.excel.annotation.write.style.ContentFontStyle; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +@Schema(title = "船期导入") +public class SailScheduleImportExcel implements Serializable { + /** + * 贸易类型 + */ + @ExcelProperty(value = "*贸易类型") + @NotBlank(message = "贸易类型不能为空") + private String tradeTypeDesc; + + /** + * 航线ID + */ + @ExcelProperty(value = "*航线") + @NotNull(message = "航线不能为空") + private String shipRoute; + + /** + * 船ID + */ + @ExcelProperty(value = "*船名") + @NotBlank(message = "船名不能为空") + private String shipName; + + /** + * 航次 + */ + @ExcelProperty(value = "*航次") + @NotBlank(message = "航次不能为空") + private String voyage; + + /** + * 装货港口 + */ + @ExcelProperty(value = "*装货港口") + @NotBlank(message = "装货港口不能为空") + private String loadPortName; + + /** + * 装货码头 + */ + @ExcelProperty(value = "*装货码头") + @NotBlank(message = "装货码头不能为空") + private String loadWharfName; + + + /** + * 卸货港口 + */ + @ExcelProperty(value = "*卸货港口") + @NotBlank(message = "卸货港口不能为空") + private String dischargePortName; + + /** + * 卸货码头 + */ + @ExcelProperty(value = "*卸货码头") + @NotBlank(message = "卸货码头不能为空") + private String dischargeWharfName; + + /** + * 计划商品车数量 + */ + @ExcelProperty(value = "计划商品车数量") + @NotNull(message = "计划商品车数量不能为空") + private Integer carNumPlan; + + /** + * 计划件杂货数量 + */ + @ExcelProperty(value = "计划件杂货数量") + @NotNull(message = "计划件杂货数量不能为空") + private Integer spareNumPlan; + + /** + * 实际商品车数量 + */ + @ExcelProperty(value = "实际商品车数量") + @NotNull(message = "实际商品车数量不能为空") + private Integer carNumActual; + + /** + * 实际件杂货数量 + */ + @ExcelProperty(value = "实际件杂货数量") + @NotNull(message = "实际件杂货数量不能为空") + private Integer spareNumActual; + + /** + * 计划离泊时间 + */ + @ExcelProperty(value = "计划离泊时间(yyyy/MM/dd HH:mm)") + @NotNull(message = "计划离泊时间不能为空") + @DateTimeFormat("yyyy/MM/dd HH:mm") + private Date departureDatePlan; + + + /** + * 实际离泊时间 + */ + @ExcelProperty(value = "实际离泊时间(yyyy/MM/dd HH:mm)") + @NotNull(message = "实际离泊时间不能为空") + @DateTimeFormat("yyyy/MM/dd HH:mm") + private Date departureDateActual; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusManifestDetailMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusManifestDetailMapper.java new file mode 100644 index 0000000..d2c4b23 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusManifestDetailMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.BusManifestDetail; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【bus_manifest_detail(舱单明细)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:19 +* @Entity com.wsnet.cargo.entity.BusManifestDetail +*/ +public interface BusManifestDetailMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusManifestMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusManifestMapper.java new file mode 100644 index 0000000..84b3436 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusManifestMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.BusManifest; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【bus_manifest(舱单信息)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:19 +* @Entity com.wsnet.cargo.entity.BusManifest +*/ +public interface BusManifestMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusNoticeMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusNoticeMapper.java new file mode 100644 index 0000000..c0afced --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusNoticeMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.BusNotice; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【bus_notice(公告)】的数据库操作Mapper +* @createDate 2024-10-25 15:46:05 +* @Entity com.wsnet.cargo.entity.BusNotice +*/ +public interface BusNoticeMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusSailScheduleMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusSailScheduleMapper.java new file mode 100644 index 0000000..8355035 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusSailScheduleMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.BusSailSchedule; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【bus_sail_schedule(船期)】的数据库操作Mapper +* @createDate 2024-10-24 19:25:59 +* @Entity com.wsnet.cargo.entity.BusSailSchedule +*/ +public interface BusSailScheduleMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusSubscribeMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusSubscribeMapper.java new file mode 100644 index 0000000..8153729 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/BusSubscribeMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.BusSubscribe; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【bus_subscribe(订阅)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.BusSubscribe +*/ +public interface BusSubscribeMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictBrandMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictBrandMapper.java new file mode 100644 index 0000000..b032b09 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictBrandMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictBrand; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_brand(品牌)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictBrand +*/ +public interface DictBrandMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictCityMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictCityMapper.java new file mode 100644 index 0000000..a2cb340 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictCityMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictCity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_city(全国城市列表)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictCity +*/ +public interface DictCityMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictEmployeeMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictEmployeeMapper.java new file mode 100644 index 0000000..a26d460 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictEmployeeMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictEmployee; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_employee(企业员工)】的数据库操作Mapper +* @createDate 2024-10-24 09:36:32 +* @Entity com.wsnet.cargo.entity.DictEmployee +*/ +public interface DictEmployeeMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictEnterpriseMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictEnterpriseMapper.java new file mode 100644 index 0000000..adf1cd4 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictEnterpriseMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictEnterprise; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_enterprise(企业)】的数据库操作Mapper +* @createDate 2024-10-23 14:58:37 +* @Entity com.wsnet.cargo.entity.DictEnterprise +*/ +public interface DictEnterpriseMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictPortMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictPortMapper.java new file mode 100644 index 0000000..2cc5ab5 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictPortMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictPort; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_port(港口)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictPort +*/ +public interface DictPortMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipChartMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipChartMapper.java new file mode 100644 index 0000000..43df80f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipChartMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictShipChart; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_ship_chart(船图)】的数据库操作Mapper +* @createDate 2024-10-24 15:39:46 +* @Entity com.wsnet.cargo.entity.DictShipChart +*/ +public interface DictShipChartMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipMapper.java new file mode 100644 index 0000000..c547850 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictShip; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_ship(船舶)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictShip +*/ +public interface DictShipMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipRouteMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipRouteMapper.java new file mode 100644 index 0000000..0e96c51 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipRouteMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictShipRoute; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_ship_route(航线)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictShipRoute +*/ +public interface DictShipRouteMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipRoutePortMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipRoutePortMapper.java new file mode 100644 index 0000000..e8236be --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictShipRoutePortMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictShipRoutePort; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_ship_route_port(航线-码头对照表)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictShipRoutePort +*/ +public interface DictShipRoutePortMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictVehicleTypeDetailMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictVehicleTypeDetailMapper.java new file mode 100644 index 0000000..7c26a7b --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictVehicleTypeDetailMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictVehicleTypeDetail; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_vehicle_type_detail(车型明细)】的数据库操作Mapper +* @createDate 2024-10-24 15:23:16 +* @Entity com.wsnet.cargo.entity.DictVehicleTypeDetail +*/ +public interface DictVehicleTypeDetailMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictVehicleTypeMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictVehicleTypeMapper.java new file mode 100644 index 0000000..84e4adc --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictVehicleTypeMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictVehicleType; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_vehicle_type(车型)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictVehicleType +*/ +public interface DictVehicleTypeMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictWharfMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictWharfMapper.java new file mode 100644 index 0000000..b7177c1 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/DictWharfMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.DictWharf; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【dict_wharf(码头)】的数据库操作Mapper +* @createDate 2024-10-23 10:12:20 +* @Entity com.wsnet.cargo.entity.DictWharf +*/ +public interface DictWharfMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/HelpApiMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/HelpApiMapper.java new file mode 100644 index 0000000..9f97bc3 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/HelpApiMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.HelpApi; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【help_api(API)】的数据库操作Mapper +* @createDate 2024-11-07 16:46:58 +* @Entity com.wsnet.cargo.entity.HelpApi +*/ +public interface HelpApiMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/HelpDocMapper.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/HelpDocMapper.java new file mode 100644 index 0000000..40b0029 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/mapper/HelpDocMapper.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.mapper; + +import com.wsnet.cargo.entity.HelpDoc; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author dj +* @description 针对表【help_doc(help)】的数据库操作Mapper +* @createDate 2024-11-07 16:50:59 +* @Entity com.wsnet.cargo.entity.HelpDoc +*/ +public interface HelpDocMapper extends BaseMapper { + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/BrandQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/BrandQuery.java new file mode 100644 index 0000000..08d7af7 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/BrandQuery.java @@ -0,0 +1,34 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "品牌查询") +public class BrandQuery extends BaseQuery { + /** + * 品牌名称 + */ + @Schema(description = "品牌名称") + private String name; + + /** + * 品牌编码 + */ + @Schema(description = "品牌编码") + private String code; + + /** + * 品牌英文名称 + */ + @Schema(description = "品牌英文名称") + private String enName; + + /** + * 状态 + */ + @Schema(description = "状态") + private StatusEnums status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/EmployeeQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/EmployeeQuery.java new file mode 100644 index 0000000..fde869e --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/EmployeeQuery.java @@ -0,0 +1,25 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "员工查询") +public class EmployeeQuery extends BaseQuery { + @Schema(description = "企业ID") + private Long enterpriseId; + + @Schema(description = "姓名") + private String name; + + @Schema(description = "用户名") + private String username; + + @Schema(description = "码头ID") + private Long wharfId; + + @Schema(description = "状态") + private StatusEnums status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/EnterpriseQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/EnterpriseQuery.java new file mode 100644 index 0000000..36826dc --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/EnterpriseQuery.java @@ -0,0 +1,17 @@ +package com.wsnet.cargo.query; + +import com.wsnet.cargo.enums.EnterpriseStatusEnums; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "企业查询") +public class EnterpriseQuery extends BaseQuery { + @Schema(description = "关键字") + String key; + + @Schema(description = "状态") + EnterpriseStatusEnums enterpriseStatus; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ManifestDetailQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ManifestDetailQuery.java new file mode 100644 index 0000000..c4be459 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ManifestDetailQuery.java @@ -0,0 +1,18 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.db.annos.DbQuery; +import com.wsnet.core.db.enums.SqlSymbol; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + + +@Data +@Schema(title = "舱单明细查询") +public class ManifestDetailQuery extends BaseQuery { + @Schema(description = "舱单ID列表") + @DbQuery(symbol = SqlSymbol.IN) + private List manifestId; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ManifestQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ManifestQuery.java new file mode 100644 index 0000000..3bf16a8 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ManifestQuery.java @@ -0,0 +1,46 @@ +package com.wsnet.cargo.query; + +import com.wsnet.cargo.enums.GoodsStatusEnums; +import com.wsnet.core.db.annos.DbQuery; +import com.wsnet.core.db.enums.SqlSymbol; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +@Schema(title = "舱单查询") +public class ManifestQuery extends BaseQuery { + @Schema(description = "船ID") + @DbQuery(outer = true) + private Long shipId; + + @Schema(description = "航次") + @DbQuery(outer = true) + private String voyage; + +// // 两种比较特殊的类型,如何处理呢 +// private StatusEnums status; +// +// @JsonFormat(pattern = "yyyy-MM-dd") +// private Date createDate; +// +// @DbQuery(outer = true) +// private List statusList; +// +// @DbQuery(outer = true) +// private String[] statusArray; + + @Schema(description = "提单号") + private String billNo; + + @Schema(description = "品牌ID") + private Long brandId; + + @Schema(description = "货物状态") + private GoodsStatusEnums goodsStatus; + + // 和船期有关的关联查询 + @DbQuery(symbol = SqlSymbol.EXISTS, field = "select id from bus_sail_schedule b where b.id=bus_manifest.schedule_id and b.ship_id=${shipId} and b.voyage=${voyage}") + private String schedule; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/NoticeQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/NoticeQuery.java new file mode 100644 index 0000000..17e3bb9 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/NoticeQuery.java @@ -0,0 +1,15 @@ +package com.wsnet.cargo.query; + +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "公告查询") +public class NoticeQuery extends BaseQuery { + /** + * 品牌名称 + */ + @Schema(description = "标题") + private String title; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/PortQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/PortQuery.java new file mode 100644 index 0000000..84aea65 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/PortQuery.java @@ -0,0 +1,47 @@ +package com.wsnet.cargo.query; + +import com.wsnet.cargo.enums.PortTypeEnums; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "港口查询") +public class PortQuery extends BaseQuery { + /** + * 港口名称 + */ + @Schema(description = "港口名称") + private String name; + + /** + * 港口编码 + */ + @Schema(description = "港口编码") + private String code; + + /** + * 省份 + */ + @Schema(description = "省份") + private Long provinceId; + + /** + * 城市 + */ + @Schema(description = "城市") + private Long cityId; + + /** + * 港口类型 + */ + @Schema(description = "港口类型") + private PortTypeEnums portType; + + /** + * 状态 + */ + @Schema(description = "状态") + private StatusEnums status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/RoutePortQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/RoutePortQuery.java new file mode 100644 index 0000000..4060a94 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/RoutePortQuery.java @@ -0,0 +1,34 @@ +package com.wsnet.cargo.query; + +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +@Schema(title = "航线码头查询") +public class RoutePortQuery extends BaseQuery { + /** + * 航线ID + */ + @Schema(description = "航线ID") + private Long routeId; + + /** + * 港口ID + */ + @Schema(description = "港口ID") + private Long portId; + + /** + * 码头ID + */ + @Schema(description = "码头ID") + private Long wharfId; + + /** + * 状态 + */ + @Schema(description = "状态") + private Integer status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/RouteQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/RouteQuery.java new file mode 100644 index 0000000..8cb8b80 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/RouteQuery.java @@ -0,0 +1,19 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "航线查询") +public class RouteQuery extends BaseQuery { + @Schema(description = "航线名称") + private String name; + + @Schema(description = "航线编码") + private String code; + + @Schema(description = "状态") + private StatusEnums status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/SailScheduleQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/SailScheduleQuery.java new file mode 100644 index 0000000..bcc5da2 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/SailScheduleQuery.java @@ -0,0 +1,71 @@ +package com.wsnet.cargo.query; + +import com.wsnet.cargo.enums.ShipStatusEnums; +import com.wsnet.cargo.enums.TradeTypeEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "船期查询") +public class SailScheduleQuery extends BaseQuery { + /** + * 企业ID + */ + @Schema(description = "企业ID") + private Long enterpriseId; + + /** + * 船ID + */ + @Schema(description = "船ID") + private Long shipId; + + /** + * 航次 + */ + @Schema(description = "航次") + private String voyage; + + /** + * 航线ID + */ + @Schema(description = "航线ID") + private Long shipRouteId; + + /** + * 装货码头 + */ + @Schema(description = "装货码头") + private Long loadWharfId; + + /** + * 卸货码头 + */ + @Schema(description = "卸货码头") + private Long dischargeWharfId; + + /** + * 船舶状态 + */ + @Schema(description = "船舶状态") + private ShipStatusEnums shipStatus; + + /** + * 贸易类型 + */ + @Schema(description = "贸易类型") + private TradeTypeEnums tradeType; + + /** + * 装货港口 + */ + @Schema(description = "装货港口") + private Long loadPortId; + + /** + * 卸货港口 + */ + @Schema(description = "卸货港口") + private Long dischargePortId; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ShipChartQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ShipChartQuery.java new file mode 100644 index 0000000..872354b --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ShipChartQuery.java @@ -0,0 +1,15 @@ +package com.wsnet.cargo.query; + +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "船图查询") +public class ShipChartQuery extends BaseQuery { + /** + * 品牌名称 + */ + @Schema(description = "船舶ID") + private String shipId; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ShipQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ShipQuery.java new file mode 100644 index 0000000..641893f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/ShipQuery.java @@ -0,0 +1,43 @@ +package com.wsnet.cargo.query; + +import com.wsnet.cargo.enums.ShipTypeEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + + +@Data +@Schema(title = "船舶查询") +public class ShipQuery extends BaseQuery { + /** + * 船舶名称 + */ + @Schema(description = "船舶名称") + private String name; + + /** + * 船舶海事识别编号 + */ + @Schema(description = "船舶海事识别编号") + private String mmsi; + + /** + * 船舶类型 + */ + @Schema(description = "船舶类型") + private ShipTypeEnums shipType; + + /** + * 载重 + */ + @Schema(description = "载重") + private BigDecimal load; + + /** + * 状态 + */ + @Schema(description = "状态") + private Integer status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/SubscribeQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/SubscribeQuery.java new file mode 100644 index 0000000..c84e13b --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/SubscribeQuery.java @@ -0,0 +1,77 @@ +package com.wsnet.cargo.query; + +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +@Schema(title = "订阅查询") +public class SubscribeQuery extends BaseQuery { + /** + * 订阅企业ID + */ + @Schema(description = "订阅企业ID") + private Long enterpriseId; + + /** + * 订阅港口ID + */ + @Schema(description = "订阅港口ID") + private Long portId; + + /** + * 订阅码头ID + */ + @Schema(description = "订阅码头ID") + private Long wharfId; + + /** + * 订阅的企业ID + */ + @Schema(description = "订阅的企业ID") + private Long subEnterpriseId; + + /** + * 订阅的航线ID + */ + @Schema(description = "订阅的航线ID") + private Long subShipRouteId; + + /** + * 订阅的港口ID + */ + @Schema(description = "订阅的港口ID") + private Long subPortId; + + /** + * 订阅的码头ID + */ + @Schema(description = "订阅的码头ID") + private Long subWharfId; + + /** + * 订阅类型,枚举可以多选 + */ + @Schema(description = "订阅类型,枚举可以多选") + private String subInfo; + + /** + * 订阅开始日期 + */ + @Schema(description = "订阅开始日期") + private Date beginDate; + + /** + * 订阅结束日期 + */ + @Schema(description = "订阅结束日期") + private Date endDate; + + /** + * 订阅状态 + */ + @Schema(description = "订阅状态") + private String subStatus; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/VehicleTypeDetailQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/VehicleTypeDetailQuery.java new file mode 100644 index 0000000..4780119 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/VehicleTypeDetailQuery.java @@ -0,0 +1,40 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "车型明细查询") +public class VehicleTypeDetailQuery extends BaseQuery { + /** + * 名称 + */ + @Schema(description = "名称") + private String name; + + /** + * 编码 + */ + @Schema(description = "编码") + private String code; + + /** + * 英文名称 + */ + @Schema(description = "英文名称") + private String enName; + + /** + * 状态 + */ + @Schema(description = "状态") + private StatusEnums status; + + /** + * 车型ID + */ + @Schema(description = "车型ID") + private Long vehicleTypeId; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/VehicleTypeQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/VehicleTypeQuery.java new file mode 100644 index 0000000..d3c551c --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/VehicleTypeQuery.java @@ -0,0 +1,34 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(title = "车型查询") +public class VehicleTypeQuery extends BaseQuery { + /** + * 码头名称 + */ + @Schema(description = "车型名称") + private String name; + + /** + * 码头编码 + */ + @Schema(description = "车型编码") + private String code; + + /** + * 码头英文名称 + */ + @Schema(description = "车型英文名称") + private String enName; + + /** + * 状态 + */ + @Schema(description = "状态") + private StatusEnums status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/WharfQuery.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/WharfQuery.java new file mode 100644 index 0000000..01db156 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/query/WharfQuery.java @@ -0,0 +1,29 @@ +package com.wsnet.cargo.query; + +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.web.query.BaseQuery; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + + +@Data +@Schema(title = "码头查询") +public class WharfQuery extends BaseQuery { + /** + * 码头名称 + */ + @Schema(description = "码头名称") + private String name; + + /** + * 港口ID + */ + @Schema(description = "港口ID") + private Long portId; + + /** + * 状态 + */ + @Schema(description = "状态") + private StatusEnums status; +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusManifestDetailService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusManifestDetailService.java new file mode 100644 index 0000000..85bda98 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusManifestDetailService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.BusManifestDetail; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【bus_manifest_detail(舱单明细)】的数据库操作Service +* @createDate 2024-10-23 10:12:19 +*/ +public interface BusManifestDetailService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusManifestService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusManifestService.java new file mode 100644 index 0000000..6ca155f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusManifestService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.BusManifest; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【bus_manifest(舱单信息)】的数据库操作Service +* @createDate 2024-10-23 10:12:19 +*/ +public interface BusManifestService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusNoticeService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusNoticeService.java new file mode 100644 index 0000000..88fc960 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusNoticeService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.BusNotice; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【bus_notice(公告)】的数据库操作Service +* @createDate 2024-10-25 15:46:05 +*/ +public interface BusNoticeService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusSailScheduleService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusSailScheduleService.java new file mode 100644 index 0000000..4d686e5 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusSailScheduleService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.BusSailSchedule; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【bus_sail_schedule(船期)】的数据库操作Service +* @createDate 2024-10-24 19:25:59 +*/ +public interface BusSailScheduleService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusSubscribeService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusSubscribeService.java new file mode 100644 index 0000000..4b557f0 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/BusSubscribeService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.BusSubscribe; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【bus_subscribe(订阅)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface BusSubscribeService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/CargoUserRegService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/CargoUserRegService.java new file mode 100644 index 0000000..9fa4a91 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/CargoUserRegService.java @@ -0,0 +1,7 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.dto.EnterpriseVo; + +public interface CargoUserRegService { + boolean register(EnterpriseVo enterprise); +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictBrandService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictBrandService.java new file mode 100644 index 0000000..a6ff825 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictBrandService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictBrand; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_brand(品牌)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictBrandService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictCityService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictCityService.java new file mode 100644 index 0000000..aafb60d --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictCityService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictCity; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_city(全国城市列表)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictCityService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictEmployeeService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictEmployeeService.java new file mode 100644 index 0000000..4896afc --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictEmployeeService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictEmployee; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_employee(企业员工)】的数据库操作Service +* @createDate 2024-10-24 09:36:32 +*/ +public interface DictEmployeeService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictEnterpriseService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictEnterpriseService.java new file mode 100644 index 0000000..80d0d56 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictEnterpriseService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictEnterprise; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_enterprise(企业)】的数据库操作Service +* @createDate 2024-10-23 14:58:37 +*/ +public interface DictEnterpriseService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictPortService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictPortService.java new file mode 100644 index 0000000..8a315f2 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictPortService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictPort; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_port(港口)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictPortService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipChartService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipChartService.java new file mode 100644 index 0000000..677b8d7 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipChartService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictShipChart; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_ship_chart(船图)】的数据库操作Service +* @createDate 2024-10-24 15:39:46 +*/ +public interface DictShipChartService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipRoutePortService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipRoutePortService.java new file mode 100644 index 0000000..ef2dfdc --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipRoutePortService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictShipRoutePort; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_ship_route_port(航线-码头对照表)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictShipRoutePortService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipRouteService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipRouteService.java new file mode 100644 index 0000000..27f06e1 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipRouteService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictShipRoute; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_ship_route(航线)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictShipRouteService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipService.java new file mode 100644 index 0000000..00bff89 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictShipService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictShip; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_ship(船舶)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictShipService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictVehicleTypeDetailService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictVehicleTypeDetailService.java new file mode 100644 index 0000000..2aaa1af --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictVehicleTypeDetailService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictVehicleTypeDetail; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_vehicle_type_detail(车型明细)】的数据库操作Service +* @createDate 2024-10-24 15:23:16 +*/ +public interface DictVehicleTypeDetailService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictVehicleTypeService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictVehicleTypeService.java new file mode 100644 index 0000000..8998b26 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictVehicleTypeService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictVehicleType; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_vehicle_type(车型)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictVehicleTypeService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictWharfService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictWharfService.java new file mode 100644 index 0000000..ccee6d9 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/DictWharfService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.DictWharf; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【dict_wharf(码头)】的数据库操作Service +* @createDate 2024-10-23 10:12:20 +*/ +public interface DictWharfService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/HelpApiService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/HelpApiService.java new file mode 100644 index 0000000..c070d36 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/HelpApiService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.HelpApi; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【help_api(API)】的数据库操作Service +* @createDate 2024-11-07 16:46:58 +*/ +public interface HelpApiService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/HelpDocService.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/HelpDocService.java new file mode 100644 index 0000000..f7ab443 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/HelpDocService.java @@ -0,0 +1,13 @@ +package com.wsnet.cargo.service; + +import com.wsnet.cargo.entity.HelpDoc; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author dj +* @description 针对表【help_doc(help)】的数据库操作Service +* @createDate 2024-11-07 16:50:59 +*/ +public interface HelpDocService extends IService { + +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusManifestDetailServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusManifestDetailServiceImpl.java new file mode 100644 index 0000000..efd6e1f --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusManifestDetailServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.BusManifestDetail; +import com.wsnet.cargo.service.BusManifestDetailService; +import com.wsnet.cargo.mapper.BusManifestDetailMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【bus_manifest_detail(舱单明细)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:19 +*/ +@Service +public class BusManifestDetailServiceImpl extends ServiceImpl + implements BusManifestDetailService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusManifestServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusManifestServiceImpl.java new file mode 100644 index 0000000..cd1ec40 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusManifestServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.BusManifest; +import com.wsnet.cargo.service.BusManifestService; +import com.wsnet.cargo.mapper.BusManifestMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【bus_manifest(舱单信息)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:19 +*/ +@Service +public class BusManifestServiceImpl extends ServiceImpl + implements BusManifestService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusNoticeServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusNoticeServiceImpl.java new file mode 100644 index 0000000..77c0e54 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusNoticeServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.BusNotice; +import com.wsnet.cargo.service.BusNoticeService; +import com.wsnet.cargo.mapper.BusNoticeMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【bus_notice(公告)】的数据库操作Service实现 +* @createDate 2024-10-25 15:46:05 +*/ +@Service +public class BusNoticeServiceImpl extends ServiceImpl + implements BusNoticeService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusSailScheduleServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusSailScheduleServiceImpl.java new file mode 100644 index 0000000..753fb64 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusSailScheduleServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.BusSailSchedule; +import com.wsnet.cargo.service.BusSailScheduleService; +import com.wsnet.cargo.mapper.BusSailScheduleMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【bus_sail_schedule(船期)】的数据库操作Service实现 +* @createDate 2024-10-24 19:25:59 +*/ +@Service +public class BusSailScheduleServiceImpl extends ServiceImpl + implements BusSailScheduleService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusSubscribeServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusSubscribeServiceImpl.java new file mode 100644 index 0000000..543d6fc --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/BusSubscribeServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.BusSubscribe; +import com.wsnet.cargo.service.BusSubscribeService; +import com.wsnet.cargo.mapper.BusSubscribeMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【bus_subscribe(订阅)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class BusSubscribeServiceImpl extends ServiceImpl + implements BusSubscribeService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/CargoUserRegServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/CargoUserRegServiceImpl.java new file mode 100644 index 0000000..f65cf4e --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/CargoUserRegServiceImpl.java @@ -0,0 +1,59 @@ +package com.wsnet.cargo.service.impl; + +import com.wsnet.cargo.dto.EnterpriseVo; +import com.wsnet.cargo.entity.DictEnterprise; +import com.wsnet.cargo.enums.EnterpriseStatusEnums; +import com.wsnet.cargo.service.CargoUserRegService; +import com.wsnet.cargo.service.DictEnterpriseService; +import com.wsnet.core.enums.StatusEnums; +import com.wsnet.core.response.ResultData; +import com.wsnet.user.dto.RegUser; +import com.wsnet.user.service.impl.UserRegService; +import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +public class CargoUserRegServiceImpl implements CargoUserRegService { + + @Resource + private PasswordEncoder passwordEncoder; + + @Resource + private UserRegService userRegService; + + @Resource + private DictEnterpriseService enterpriseService; + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean register(EnterpriseVo enterprise) { + DictEnterprise e = new DictEnterprise(); + BeanUtils.copyProperties(enterprise, e); + e.setEnterpriseStatus(EnterpriseStatusEnums.AUDIT); + // 保存企业信息 + enterpriseService.save(e); + + // 创建管理员账号 + RegUser regUser = new RegUser(); + regUser.setPassword(passwordEncoder.encode(enterprise.getPassword())); + regUser.setUsername(enterprise.getPhone()); + regUser.setName(enterprise.getLinkman()); + regUser.setPhone(enterprise.getPhone()); + regUser.setDstatus(StatusEnums.active); + regUser.setOpenId("admin"); + + ResultData register = userRegService.register(regUser); + if (!StringUtils.equals(register.getCode(), "200")) { + throw new RuntimeException(register.getMessage()); + } + + // 修改企业的绑定管理员账号 + enterpriseService.lambdaUpdate().set(DictEnterprise::getUserId, register.getData()).eq(DictEnterprise::getId, e.getId()).update(); + + return true; + } +} diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictBrandServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictBrandServiceImpl.java new file mode 100644 index 0000000..61f3f47 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictBrandServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictBrand; +import com.wsnet.cargo.service.DictBrandService; +import com.wsnet.cargo.mapper.DictBrandMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_brand(品牌)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictBrandServiceImpl extends ServiceImpl + implements DictBrandService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictCityServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictCityServiceImpl.java new file mode 100644 index 0000000..fa3a0ef --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictCityServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictCity; +import com.wsnet.cargo.service.DictCityService; +import com.wsnet.cargo.mapper.DictCityMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_city(全国城市列表)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictCityServiceImpl extends ServiceImpl + implements DictCityService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictEmployeeServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictEmployeeServiceImpl.java new file mode 100644 index 0000000..cc64453 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictEmployeeServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictEmployee; +import com.wsnet.cargo.service.DictEmployeeService; +import com.wsnet.cargo.mapper.DictEmployeeMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_employee(企业员工)】的数据库操作Service实现 +* @createDate 2024-10-24 09:36:32 +*/ +@Service +public class DictEmployeeServiceImpl extends ServiceImpl + implements DictEmployeeService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictEnterpriseServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictEnterpriseServiceImpl.java new file mode 100644 index 0000000..2bf7554 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictEnterpriseServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictEnterprise; +import com.wsnet.cargo.service.DictEnterpriseService; +import com.wsnet.cargo.mapper.DictEnterpriseMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_enterprise(企业)】的数据库操作Service实现 +* @createDate 2024-10-23 14:58:37 +*/ +@Service +public class DictEnterpriseServiceImpl extends ServiceImpl + implements DictEnterpriseService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictPortServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictPortServiceImpl.java new file mode 100644 index 0000000..12deabd --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictPortServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictPort; +import com.wsnet.cargo.service.DictPortService; +import com.wsnet.cargo.mapper.DictPortMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_port(港口)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictPortServiceImpl extends ServiceImpl + implements DictPortService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipChartServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipChartServiceImpl.java new file mode 100644 index 0000000..9e41cee --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipChartServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictShipChart; +import com.wsnet.cargo.service.DictShipChartService; +import com.wsnet.cargo.mapper.DictShipChartMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_ship_chart(船图)】的数据库操作Service实现 +* @createDate 2024-10-24 15:39:46 +*/ +@Service +public class DictShipChartServiceImpl extends ServiceImpl + implements DictShipChartService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipRoutePortServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipRoutePortServiceImpl.java new file mode 100644 index 0000000..50c9d52 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipRoutePortServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictShipRoutePort; +import com.wsnet.cargo.service.DictShipRoutePortService; +import com.wsnet.cargo.mapper.DictShipRoutePortMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_ship_route_port(航线-码头对照表)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictShipRoutePortServiceImpl extends ServiceImpl + implements DictShipRoutePortService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipRouteServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipRouteServiceImpl.java new file mode 100644 index 0000000..546f5d4 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipRouteServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictShipRoute; +import com.wsnet.cargo.service.DictShipRouteService; +import com.wsnet.cargo.mapper.DictShipRouteMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_ship_route(航线)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictShipRouteServiceImpl extends ServiceImpl + implements DictShipRouteService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipServiceImpl.java new file mode 100644 index 0000000..0dea828 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictShipServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictShip; +import com.wsnet.cargo.service.DictShipService; +import com.wsnet.cargo.mapper.DictShipMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_ship(船舶)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictShipServiceImpl extends ServiceImpl + implements DictShipService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictVehicleTypeDetailServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictVehicleTypeDetailServiceImpl.java new file mode 100644 index 0000000..294a66a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictVehicleTypeDetailServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictVehicleTypeDetail; +import com.wsnet.cargo.service.DictVehicleTypeDetailService; +import com.wsnet.cargo.mapper.DictVehicleTypeDetailMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_vehicle_type_detail(车型明细)】的数据库操作Service实现 +* @createDate 2024-10-24 15:23:16 +*/ +@Service +public class DictVehicleTypeDetailServiceImpl extends ServiceImpl + implements DictVehicleTypeDetailService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictVehicleTypeServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictVehicleTypeServiceImpl.java new file mode 100644 index 0000000..6c270f4 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictVehicleTypeServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictVehicleType; +import com.wsnet.cargo.service.DictVehicleTypeService; +import com.wsnet.cargo.mapper.DictVehicleTypeMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_vehicle_type(车型)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictVehicleTypeServiceImpl extends ServiceImpl + implements DictVehicleTypeService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictWharfServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictWharfServiceImpl.java new file mode 100644 index 0000000..7530930 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/DictWharfServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.DictWharf; +import com.wsnet.cargo.service.DictWharfService; +import com.wsnet.cargo.mapper.DictWharfMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【dict_wharf(码头)】的数据库操作Service实现 +* @createDate 2024-10-23 10:12:20 +*/ +@Service +public class DictWharfServiceImpl extends ServiceImpl + implements DictWharfService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/HelpApiServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/HelpApiServiceImpl.java new file mode 100644 index 0000000..230f49d --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/HelpApiServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.HelpApi; +import com.wsnet.cargo.service.HelpApiService; +import com.wsnet.cargo.mapper.HelpApiMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【help_api(API)】的数据库操作Service实现 +* @createDate 2024-11-07 16:46:58 +*/ +@Service +public class HelpApiServiceImpl extends ServiceImpl + implements HelpApiService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/HelpDocServiceImpl.java b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/HelpDocServiceImpl.java new file mode 100644 index 0000000..87b49ac --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/java/com/wsnet/cargo/service/impl/HelpDocServiceImpl.java @@ -0,0 +1,22 @@ +package com.wsnet.cargo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wsnet.cargo.entity.HelpDoc; +import com.wsnet.cargo.service.HelpDocService; +import com.wsnet.cargo.mapper.HelpDocMapper; +import org.springframework.stereotype.Service; + +/** +* @author dj +* @description 针对表【help_doc(help)】的数据库操作Service实现 +* @createDate 2024-11-07 16:50:59 +*/ +@Service +public class HelpDocServiceImpl extends ServiceImpl + implements HelpDocService{ + +} + + + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/application.yml b/wsnet-cargo-sharing-service/src/main/resources/application.yml new file mode 100644 index 0000000..bfb81c6 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/application.yml @@ -0,0 +1,15 @@ +spring: + profiles: + active: dev # 表示生产环境 + cloud: + openfeign: + httpclient: + hc5: + enabled: true + compression: + request: + enabled: true + min-request-size: 2048 #最小触发压缩的大小 + mime-types: text/xml,application/xml,application/json #触发压缩数据类型 + response: + enabled: true \ No newline at end of file diff --git a/wsnet-cargo-sharing-service/src/main/resources/bootstrap.yml b/wsnet-cargo-sharing-service/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..720ed9c --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/bootstrap.yml @@ -0,0 +1,14 @@ +spring: + application: + name: wsnet-cargo-server + cloud: + nacos: + discovery: + server-addr: localhost:8848 #Nacos服务注册中心地址 + config: + server-addr: localhost:8848 #Nacos作为配置中心地址 + file-extension: yaml #指定yaml格式的配置 + group: DEFAULT_GROUP + namespace: 79855585-5921-4b8b-bfb6-ff502c66f19a + username: nacos + password: nacos diff --git a/wsnet-cargo-sharing-service/src/main/resources/config/logback-spring.xml b/wsnet-cargo-sharing-service/src/main/resources/config/logback-spring.xml new file mode 100644 index 0000000..41d9490 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/config/logback-spring.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + UTF-8 + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/${log.name}-debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 7 + + + + + debug + ACCEPT + DENY + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/${log.name}-info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 1 + + + + info + ACCEPT + DENY + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/${log.name}-warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 1 + + + + warn + ACCEPT + DENY + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/${log.name}-error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 1 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/BusManifestDetailMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusManifestDetailMapper.xml new file mode 100644 index 0000000..9ce8985 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusManifestDetailMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + manifest_id,vehicle_type_id,vehicle_type_detail, + vin,weight,volume, + length,width,height, + b_amm,l_rmm,damage, + damage_desc + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/BusManifestMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusManifestMapper.xml new file mode 100644 index 0000000..8efc42c --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusManifestMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + schedule_id,deck,cabin, + bill_no,goods_name,brand_id, + model,shipping_mark,car_num, + spare_num,weight,volume, + consigner,consignee,goods_status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/BusNoticeMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusNoticeMapper.xml new file mode 100644 index 0000000..eb39d85 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusNoticeMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + title,content + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/BusSailScheduleMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusSailScheduleMapper.xml new file mode 100644 index 0000000..57ff887 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusSailScheduleMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + ship_id,voyage,ship_route_id, + load_wharf_id,discharge_wharf_id,car_num_plan, + spare_num_plan,car_num_actual,spare_num_actual, + departure_date_plan,departure_date_actual,ship_status, + trade_type,load_port_id,discharge_port_id + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/BusSubscribeMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusSubscribeMapper.xml new file mode 100644 index 0000000..f19be35 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/BusSubscribeMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + enterprise_id,port_id,wharf_id, + sub_ship_route_id,sub_port_id,sub_wharf_id, + sub_info,begin_date,end_date, + sub_status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictBrandMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictBrandMapper.xml new file mode 100644 index 0000000..e111b5e --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictBrandMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,en_name, + status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictCityMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictCityMapper.xml new file mode 100644 index 0000000..670afa4 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictCityMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictEmployeeMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictEmployeeMapper.xml new file mode 100644 index 0000000..a461946 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictEmployeeMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + enterprise_id,name,nickname, + username,wharf_id,user_id, + status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictEnterpriseMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictEnterpriseMapper.xml new file mode 100644 index 0000000..8fb3418 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictEnterpriseMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,address, + legal_person,contract_no,linkman, + phone,enterprise_status,user_id, + port_id,enterprise_type,license_photo, + id_photo + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictPortMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictPortMapper.xml new file mode 100644 index 0000000..7cd23c1 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictPortMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,province_id, + city_id,address,port_type, + transit_capacity,storage_capacity,handling_capacity, + wharf_num,berthage_num,status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipChartMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipChartMapper.xml new file mode 100644 index 0000000..5b1dcba --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipChartMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + ship_id,decks_num,stowage_capacity, + floor_plan,status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipMapper.xml new file mode 100644 index 0000000..f7fd2ea --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,mmsi,ship_age, + ship_type,load,ship_length, + empty_ship_draft,full_load_draft,springboard_num, + springboard_location,seaworthiness,regular, + status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipRouteMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipRouteMapper.xml new file mode 100644 index 0000000..bd737f8 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipRouteMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipRoutePortMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipRoutePortMapper.xml new file mode 100644 index 0000000..739df04 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictShipRoutePortMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + route_id,port_id,wharf_id, + status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictVehicleTypeDetailMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictVehicleTypeDetailMapper.xml new file mode 100644 index 0000000..79f2da1 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictVehicleTypeDetailMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,en_name, + status,vehicle_type_id + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictVehicleTypeMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictVehicleTypeMapper.xml new file mode 100644 index 0000000..06c4e1a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictVehicleTypeMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,code,en_name, + status,port_id + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/DictWharfMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictWharfMapper.xml new file mode 100644 index 0000000..43b6e4a --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/DictWharfMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,port_id,address, + longitude,latitude,berthage_num, + transit_capacity,storage_capacity,handling_capacity, + status + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/HelpApiMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/HelpApiMapper.xml new file mode 100644 index 0000000..ee56480 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/HelpApiMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + name,url,remark, + req,resp + + diff --git a/wsnet-cargo-sharing-service/src/main/resources/mapper/HelpDocMapper.xml b/wsnet-cargo-sharing-service/src/main/resources/mapper/HelpDocMapper.xml new file mode 100644 index 0000000..75c13fd --- /dev/null +++ b/wsnet-cargo-sharing-service/src/main/resources/mapper/HelpDocMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + id,create_by,create_date, + update_by,update_date,version, + serial,name,remark, + type + + diff --git a/wsnet-cargo-sharing-service/src/test/java/com/wsnet/cargo/SqlTest.java b/wsnet-cargo-sharing-service/src/test/java/com/wsnet/cargo/SqlTest.java new file mode 100644 index 0000000..6f05ea0 --- /dev/null +++ b/wsnet-cargo-sharing-service/src/test/java/com/wsnet/cargo/SqlTest.java @@ -0,0 +1,108 @@ +package com.wsnet.cargo; + +import cn.hutool.core.util.ReflectUtil; +import com.alibaba.excel.util.DateUtils; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.wsnet.cargo.query.ManifestQuery; +import com.wsnet.web.query.BaseQuery; +import net.sf.jsqlparser.JSQLParserException; +import org.apache.commons.lang3.StringUtils; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; + +public class SqlTest { + public static void main(String[] args) throws JSQLParserException { + String sql = "select id from bus_sail_schedule b where b.id=bus_manifest.schedule_id and b.ship_id = ${shipId} and b.voyage = '${voyage}' and b.status='${status}' and b.create_date='${createDate}' and b.status in (${statusList}) and b.status in (${statusArray})"; + + + ManifestQuery query = new ManifestQuery(); +// query.setVoyage("12345"); + query.setShipId(123l); +// query.setStatus(StatusEnums.active); +// query.setCreateDate(new Date()); + + String[] statusArray = new String[3]; + statusArray[0] = "1"; + statusArray[1] = "2"; +// query.setStatusArray(statusArray); + +// query.setStatusList(Arrays.asList("4", "5")); + + SqlTest test = new SqlTest(); + String fmtSql = test.formatExistSql(sql, query); + + System.err.println(fmtSql); + + } + + public String formatExistSql(String sql, BaseQuery query) { + StringBuffer prefix = new StringBuffer(StringUtils.trim(StringUtils.substringBefore(sql, "and"))); + + String condition = StringUtils.trim(StringUtils.substringAfter(sql, "and")); + + // 所有的查询条件 + String[] strings = StringUtils.splitByWholeSeparator(condition, " and "); + + for (String str : strings) { + String s = str; + + // 获取字段的名称 + String field = StringUtils.substringBetween(s, "${", "}"); + + Object fieldValue = ReflectUtil.getFieldValue(query, field); + if (fieldValue == null) { + continue; + } + + if (fieldValue instanceof Object[]) { + Object[] arr = (Object[]) fieldValue; + if (arr.length == 0) continue; + StringBuffer sb = new StringBuffer(); + for (Object o : arr) { + if (o instanceof String) { + sb.append("'" + o + "',"); + } else if (o instanceof Enum) { + sb.append("'" + ReflectUtil.getFieldValue(fieldValue, "code") + "',"); + } else { + sb.append(o + ","); + } + } + fieldValue = StringUtils.substringBeforeLast(sb.toString(),","); + } else if (fieldValue instanceof Collection) { + Collection coll = (Collection) fieldValue; + if (coll.size() == 0) continue; + StringBuffer sb = new StringBuffer(); + for (Object o : coll) { + if (o instanceof String) { + sb.append("'" + o + "',"); + } else if (o instanceof Enum) { + sb.append("'" + ReflectUtil.getFieldValue(fieldValue, "code") + "',"); + } else { + sb.append(o + ","); + } + } + fieldValue = StringUtils.substringBeforeLast(sb.toString(),","); + } else if (fieldValue instanceof Enum) { + fieldValue = ReflectUtil.getFieldValue(fieldValue, "code"); + } else if (fieldValue instanceof Date){ + Field field1 = ReflectUtil.getField(ManifestQuery.class, field); + JsonFormat annotation = field1.getAnnotation(JsonFormat.class); + if (annotation != null) { + fieldValue = DateUtils.format((Date) fieldValue, annotation.pattern()); + } else { + fieldValue = DateUtils.format((Date) fieldValue, "yyyy-MM-dd"); + } + } + + if (fieldValue != null) { + prefix.append(" and "); + prefix.append(StringUtils.replace(s, "${" + field + "}", String.valueOf(fieldValue))); + } + } + + return prefix.toString(); + } +}