Merge branch 'dev' into master

# Conflicts:
#	mhd-common/mhd-common-core/src/main/java/minio/MinIoUploadService.java
#	mhd_product/pom.xml
This commit is contained in:
hjx
2025-12-17 23:27:46 +08:00
87 changed files with 1339 additions and 209 deletions
@@ -38,6 +38,10 @@ public class LoginUser implements Serializable
* 用户名
*/
private String username;
/**
* 用户名
*/
private String realname;
/**
* 登录时间
+1 -1
View File
@@ -156,7 +156,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<version>1.18.22</version>
</dependency>
<dependency>
@@ -522,4 +522,22 @@ public class TmsOrder implements Serializable {
@ApiModelProperty(value = "付款方名称")
private String payer;
@ApiModelProperty("客户编码nc")
private String customsCodeNc;
@ApiModelProperty("制单人编码nc")
private String makerCodeNc;
@ApiModelProperty("业务员编码nc")
private String salesmanCodeNc;
@ApiModelProperty("税率")
private BigDecimal taxRate;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("合同编号")
private String contractNo;
}
@@ -301,4 +301,13 @@ public class UserDriverListPo {
@ApiModelProperty(value = "是否允许竞价(0-不允许竞价,1-允许参与竞价,2-允许查看竞价)")
private Integer isDriverBidding;
@ApiModelProperty(value = "用户身份")
private Integer userIdentity;
@ApiModelProperty(name = "车辆主体")
private String vehicleBody;
@ApiModelProperty(name = "")
private String wlhydriverId;
}
@@ -185,6 +185,9 @@ public class UserDriverPo {
@ApiModelProperty(name = "用户实名认证状态:0-无状态,1-已注册未认证,2-已认证待审核,3-审核通过,4-已驳回")
private Integer userAuthStatus;
@ApiModelProperty(name = "车辆主体")
private String vehicleBody;
//===================车队司机参数===============
@ApiModelProperty("车队队长userId")
@@ -15,10 +15,12 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@Service
public class MinIoUploadService {
@Autowired(required=false)
private MinioClient minioClient;
private static String bucket="ngwl";
private static String host="http://10.102.192.5:6000";
private static String accessKey="minioadmin";
@@ -32,7 +34,7 @@ public class MinIoUploadService {
/**
* 上传到minio
* @param
* @param fileName
* @throws Exception
*/
@@ -65,7 +67,7 @@ public class MinIoUploadService {
.stream(inputStream,inputStream.available(),-1).build();
//文件名称相同会覆盖
minioClient.putObject(objectArgs);
String url =host+ "/"+bucket + "/"+fileName;
String url =host+"/browser/"+bucket + "/"+fileName;
//
return url;
@@ -129,6 +129,7 @@ public class TokenService
if (StringUtils.isNotEmpty(token))
{
String userkey = JwtUtils.getUserKey(token);
redisService.deleteObject(userkey);
redisService.deleteObject(getTokenKey(userkey));
}
}
@@ -2042,6 +2042,7 @@ public class UserApplicationService {
VehiclePo vehiclePo = new VehiclePo();
sysUser.setUserid(userPo.getUserId());
sysUser.setUsername(userPo.getUserAccount());
sysUser.setRealname(userPo.getUserName());
UserDriverPo userDriverPo = userDriverDomainService.selectByUserId(userPo.getUserId());
if (ObjectUtil.isNull(userDriverPo)) {
userDriverPo = new UserDriverPo();
@@ -2052,6 +2052,42 @@ public class UserDriverApplicationService {
return mapList;
}
public List<Map<String, String>> userPersonalDriverAuthList() {
//获取当前登录人
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
UserDriverDO userDriverDO = new UserDriverDO();
//20240227 修改为查询用户关联的司机数据包括车队长承运企业
List<UserDriverPo> userDriverPos = userDriverDomainService.userPersonalDriverAuthList(userDriverDO);
List<Map<String, String>> mapList = new ArrayList<>();
if (CollUtil.isNotEmpty(userDriverPos)) {
for (UserDriverPo u : userDriverPos) {
Map<String, String> map = new HashMap<>();
map.put("userId", u.getUserId().toString());
StringBuilder str = new StringBuilder();
str.append(u.getUserName());
if (StrUtil.isNotEmpty(u.getUserPhone())) {
str.append(", ").append(u.getUserPhone());
}
if (StrUtil.isNotEmpty(u.getDriverEnterpriseName())) {
str.append("").append(u.getDriverEnterpriseName()).append("");
}
map.put("label", String.valueOf(str));
mapList.add(map);
}
}
return mapList;
}
/**
* 车队认证-车队长查询
*/
@@ -750,6 +750,15 @@ public class UserDriverEnterpriseApplicationService {
public UserDriverEnterprisePo getEnterpriseByUserId(Long userId) {
return userDriverEnterpriseDomainService.getEnterpriseByUserId(userId);
}
/**
* 根据用户id查询用户企业信息
*
* @param userId
* @return
*/
public UserDriverEnterprisePo getEnterpriseByUserIds(Long userId) {
return userDriverEnterpriseDomainService.getEnterpriseByUserIds(userId);
}
/**
* @param driverEnterpriseCode
@@ -127,4 +127,7 @@ public class UserDriverEntity extends BaseVOEntity {
@ApiModelProperty(name = "tms推送状态: 1-未推送 2- 已推送")
private Integer tmsPushStatus;
@ApiModelProperty(name = "用户身份")
private Integer userIdentity;
}
@@ -1,5 +1,6 @@
package com.mhd.user.domain.userAggregate.factory;
import cn.hutool.core.util.ObjectUtil;
import com.mhd.user.domain.userAggregate.entity.UserEntity;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.user.domain.userAggregate.repository.todo.UserDO;
@@ -20,6 +21,7 @@ public class UserFactory {
public UserEntity getUserEntity(UserDO userDO) {
UserEntity userEntity = new UserEntity();
BeanUtils.copyProperties(userDO,userEntity, IgnoreNullUtil.getNullPropertyNames(userDO));
userEntity.setDepartmentId(ObjectUtil.isNotEmpty(userDO.getDepartmentId())?Integer.valueOf(userDO.getDepartmentId()):null);
return userEntity;
}
public CheckDO getCheckDo(UserDO userDO) {
@@ -52,4 +52,6 @@ public interface UserDriverEnterpriseService extends IService<UserDriverEnterpri
List<UserDriverEnterprisePo> queryCaptainList(UserDriverEnterpriseDo userDriverEnterpriseDo);
UserDriverEnterprisePo getEnterpriseByUserId(Long userId);
UserDriverEnterprisePo getEnterpriseByUserIds(Long userId);
}
@@ -55,6 +55,8 @@ public interface UserDriverRepositoryInterface extends IService<UserDriverEntity
List<UserDriverPo> userDriverAuthList(UserDriverDO userDriverDO);
List<UserDriverPo> userPersonalDriverAuthList(UserDriverDO userDriverDO);
List<Map<String, Object>> motorcadeAuthCaptainList(Long organizationId);
List<UserDriverPo> getRegionDriverList(UserDriverDO userDriverDO);
@@ -35,4 +35,6 @@ public interface UserDriverEnterpriseMapper extends BaseMapper<UserDriverEnterpr
List<UserDriverEnterprisePo> queryCaptainList(@Param("userDriverEnterpriseDo") UserDriverEnterpriseDo userDriverEnterpriseDo);
UserDriverEnterprisePo getEnterpriseByUserId(@Param("userId") Long userId);
UserDriverEnterprisePo getEnterpriseByUserIds(@Param("userId") Long userId);
}
@@ -54,6 +54,8 @@ public interface UserDriverMapper extends BaseMapper<UserDriverEntity> {
List<UserDriverPo> userDriverAuthList(UserDriverDO userDriverDO);
List<UserDriverPo> userPersonalDriverAuthList(UserDriverDO userDriverDO);
List<Map<String, Object>> motorcadeAuthCaptainList(Long organizationId);
List<UserDriverPo> getRegionDriverList(@Param("userDriverDO") UserDriverDO userDriverDO);
@@ -111,4 +111,9 @@ public class UserDriverEnterpriseImpl extends ServiceImpl<UserDriverEnterpriseMa
public UserDriverEnterprisePo getEnterpriseByUserId(Long userId) {
return userDriverEnterpriseMapper.getEnterpriseByUserId(userId);
}
@Override
public UserDriverEnterprisePo getEnterpriseByUserIds(Long userId) {
return userDriverEnterpriseMapper.getEnterpriseByUserIds(userId);
}
}
@@ -183,6 +183,11 @@ public class UserDriverRepositoryImpl extends ServiceImpl<UserDriverMapper,UserD
return userDriverMapper.userDriverAuthList(userDriverDO);
}
@Override
public List<UserDriverPo> userPersonalDriverAuthList(UserDriverDO userDriverDO) {
return userDriverMapper.userPersonalDriverAuthList(userDriverDO);
}
@Override
public List<Map<String, Object>> motorcadeAuthCaptainList(Long organizationId) {
return userDriverMapper.motorcadeAuthCaptainList(organizationId);
@@ -228,4 +228,13 @@ public class UserDriverPo extends BaseVOEntity {
@ApiModelProperty(name = "tms推送状态: 1-未推送 2- 已推送")
private Integer tmsPushStatus;
@ApiModelProperty(name = "用户身份")
private Integer userIdentity;
@ApiModelProperty(name = "经营许可证")
private String driverBusinessLicenseFrontUrl;
@ApiModelProperty(name = "经营许可证号")
private String driverBusinessLicenseNumber;
}
@@ -283,4 +283,10 @@ public class UserDriverDO extends UserDO {
@ApiModelProperty(name = "车队名称")
private String motorcadeName;
@ApiModelProperty(name = "用户身份")
private Integer userIdentity;
@ApiModelProperty(name = "车辆主体")
private String vehicleBody;
}
@@ -187,6 +187,11 @@ public class UserDriverDomainService {
return userDriverRepositoryInterface.userDriverAuthList(userDriverDO);
}
@DataPermissions(cacheName = "master")
public List<UserDriverPo> userPersonalDriverAuthList(UserDriverDO userDriverDO) {
return userDriverRepositoryInterface.userPersonalDriverAuthList(userDriverDO);
}
public List<Map<String, Object>> motorcadeAuthCaptainList(Long organizationId) {
return userDriverRepositoryInterface.motorcadeAuthCaptainList(organizationId);
}
@@ -154,4 +154,8 @@ public class UserDriverEnterpriseDomainService {
.eq(UserDriverEnterprise::getUserId, userId)
.update();
}
public UserDriverEnterprisePo getEnterpriseByUserIds(Long userId) {
return userDriverEnterpriseService.getEnterpriseByUserIds(userId);
}
}
@@ -308,4 +308,10 @@ public class UserDriverDTO extends UserDTO {
@ApiModelProperty(name = "部门id")
private String departmentId;
@ApiModelProperty(name = "用户身份")
private Integer userIdentity;
@ApiModelProperty(name = "车辆主体")
private String vehicleBody;
}
@@ -8,6 +8,7 @@ import com.mhd.common.log.enums.BusinessType;
import com.mhd.user.application.service.*;
import com.mhd.user.domain.userAggregate.entity.DriverExcel;
import com.mhd.user.domain.userAggregate.repository.po.DriverVehicleBindPo;
import com.mhd.user.domain.userAggregate.repository.po.UserDriverEnterprisePo;
import com.mhd.user.domain.userAggregate.repository.todo.*;
import com.mhd.user.interfaces.assember.*;
import com.mhd.user.interfaces.dto.DriverExcelDto;
@@ -246,6 +247,17 @@ public class UserDriverAPI extends BaseController {
return AjaxResult.success(userDriverApplicationService.userDriverAuthList());
}
/**
* 车辆认证-承运人查询(个人司机)
* @return
*/
@Log(title = "承运人管理-查询", description ="车辆认证-承运人查询(个人司机)",businessType = BusinessType.INQUIRE)
@ApiOperation("车辆认证-承运人查询(个人司机)")
@GetMapping("/userPersonalDriverAuthList")
public AjaxResult userPersonalDriverAuthList() {
return AjaxResult.success(userDriverApplicationService.userPersonalDriverAuthList());
}
/**
* 车辆导入-承运人查询
* @return
@@ -303,6 +315,12 @@ public class UserDriverAPI extends BaseController {
return AjaxResult.success(userDriverEnterpriseApplicationService.getEnterpriseByUserId(userId));
}
@ApiOperation("根据用户id查询企业信息(返回值不同)")
@GetMapping("/getEnterpriseByUserIds")
public UserDriverEnterprisePo getEnterpriseByUserIds(@RequestParam("userId") Long userId) {
return userDriverEnterpriseApplicationService.getEnterpriseByUserIds(userId);
}
/**
* 获取司机校验相应值
*/
@@ -58,4 +58,10 @@ public class QueryAllShipperInfoVo {
@ApiModelProperty("是否有默认地址")
private Boolean hasDefaultAddress;
@ApiModelProperty("用户nc")
private String documentPreparerNcCode;
@ApiModelProperty(name = "客户nc编码")
private String customerNcCode;
}
@@ -106,4 +106,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND a.user_id = #{userId}
</select>
<select id="getEnterpriseByUserIds" resultType="com.mhd.user.domain.userAggregate.repository.po.UserDriverEnterprisePo" parameterType="java.lang.Long">
SELECT
a.*
FROM
user_driver_enterprise a
WHERE
a.del_flag = 1
AND a.driver_type = 2
AND a.user_id = #{userId}
</select>
</mapper>
@@ -120,6 +120,7 @@
a.driver_work_license_front_url,
a.work_certificate_back_img_url,
b.create_time,
a.user_identity,
b.create_by,
b.create_by_name,
b.update_time,
@@ -186,6 +187,7 @@
ude.driver_corp_idcard_number,
r.roleName,
dvb.vehicle_id,
wlhydriver.id as wlhydriverId,
WM_CONCAT(DISTINCT dvb.vehicle_license_plate_number ) AS vehicleLicensePlateNumber,
WM_CONCAT(DISTINCT m.motorcade_name ) AS driverTeamName
FROM
@@ -205,6 +207,8 @@
user_id
) r ON r.user_id = b.user_id
LEFT JOIN user_driver a ON a.user_id = b.user_id
LEFT JOIN NGWL_TEST_WLHY.sys_user wlhyuser ON wlhyuser.szwl_user_id = b.user_id
LEFT JOIN NGWL_TEST_WLHY.tms_driver wlhydriver ON wlhydriver.driver_id = wlhyuser.id
LEFT JOIN user_driver_enterprise ude ON b.user_id = ude.user_id
AND ude.driver_type = 1
LEFT JOIN user_driver_enterprise ud ON b.user_id = ud.user_id
@@ -228,6 +232,7 @@
<sql id="selectUserDriverVo2">
SELECT a.driver_id,
a.user_driver_type,
a.driver_allow_driving_type_id,
a.driver_allow_driving_type_name,
a.driver_certification_authority,
@@ -262,6 +267,7 @@
a.driver_fill_auth_id,
a.driver_fill_auth_name,
a.driver_fill_auth_remark,
a.user_identity,
b.user_id,
b.top_organization_id,
b.organization_id,
@@ -300,11 +306,13 @@
ude.driver_corp_legal_name,
ude.driver_corp_name,
ude.driver_corp_idcard_number,
ude.driver_business_license_front_url,
ude.driver_business_license_number,
WM_CONCAT(dvb.vehicle_license_plate_number) AS vehicleLicensePlateNumber,
WM_CONCAT(m.motorcade_name) AS driverTeamName,
md.motorcade_id motorcade_header_id
FROM "USER" b
LEFT JOIN user_driver a ON a.user_id = b.user_id AND b.del_flag = 1
LEFT JOIN user_driver a ON a.user_id = b.user_id AND a.del_flag = 1
LEFT JOIN user_driver_enterprise ude ON a.user_id = ude.user_id AND ude.del_flag = 1
LEFT JOIN driver_vehicle_bind dvb ON a.user_id = dvb.user_id AND dvb.del_flag = 1
LEFT JOIN motorcade m ON a.driver_id = m.motorcade_header_id AND m.del_flag = 1
@@ -602,6 +610,9 @@
<if test="userDriverDO.userDriverType != null">
and a.user_driver_type = #{userDriverDO.userDriverType}
</if>
<if test="userDriverDO.userIdentity != null">
and a.user_identity = #{userDriverDO.userIdentity}
</if>
/*准驾车型id*/
<if test="userDriverDO.driverAllowDrivingTypeId != null and userDriverDO.driverAllowDrivingTypeId != ''">
and a.driver_allow_driving_type_id = #{userDriverDO.driverAllowDrivingTypeId}
@@ -973,6 +984,37 @@
</if>
</select>
<select id="userPersonalDriverAuthList" resultType="com.mhd.user.domain.userAggregate.repository.po.UserDriverPo">
select ud.driver_id,
u.user_id,
u.user_name,
u.user_phone,
u.user_account,
ude.user_driver_enterprise_id,
ude.driver_enterprise_name
from "USER" u
left join user_driver ud on ud.user_id = u.user_id and u.del_flag = 1
left join user_driver_enterprise ude
on u.user_id = ude.user_id and ude.del_flag = 1
where u.del_flag = 1 and u.role_code = 'driver'
<if test="createBy != null"> and u.create_by = #{createBy}</if>
<if test="createBy != null and organizationIdList == null">
and u.create_by = #{createBy}</if>
<if test="organizationIdList != null and createBy == null">
AND u.organization_id in
<foreach item="id" collection="organizationIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="organizationIdList != null and createBy != null">
AND (u.organization_id in
<foreach item="id" collection="organizationIdList" open="(" separator="," close=")">
#{id}
</foreach>
OR u.create_by = #{createBy})
</if>
</select>
<select id="motorcadeAuthCaptainList" resultType="java.util.HashMap">
select u.user_id userId,
u.top_organization_id topOrganizationId,
@@ -70,7 +70,7 @@
a.department_id,
a.ding_user_id,
a.ding_dept_id,
a.validity_period_management
a.validity_period_management,a.salesperson_nc_code,a.document_preparer_nc_code
FROM "USER" a
where a.del_flag = 1
</sql>
@@ -708,7 +708,7 @@
</select>
<select id="findAllShipperInfo" resultType="com.mhd.user.interfaces.vo.QueryAllShipperInfoVo">
SELECT u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name ,u.user_phone,u.has_default_address,b.shipper_id,b.shipper_enterprise_name
SELECT u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name ,u.user_phone,u.has_default_address,b.shipper_id,b.shipper_enterprise_name,u.DOCUMENT_PREPARER_NC_CODE,b.CUSTOMER_NC_CODE
FROM "USER" u
LEFT JOIN user_shipper b ON u.user_id = b.user_id
left join (select user_id, LISTAGG(r.role_name, '&amp;') WITHIN GROUP(ORDER BY r.role_name) AS roleName
@@ -1,6 +1,7 @@
package com.mhd.modules.monitor.config;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@@ -9,7 +10,7 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
/**
* 监控权限配置
*
*
* @author mhd
*/
@EnableWebSecurity
@@ -32,11 +33,23 @@ public class WebSecurityConfigurer
return httpSecurity
.headers().frameOptions().disable()
.and().authorizeRequests()
.antMatchers("/actuator/health", "/actuator/info").permitAll() //扫描漏洞添加
.antMatchers("/actuator/**").authenticated() //扫描漏洞添加
.antMatchers(adminContextPath + "/assets/**"
, adminContextPath + "/login"
, adminContextPath + "/actuator/**"
, adminContextPath + "/instances/**"
).permitAll()
// 管理端点需要认证
.antMatchers("/actuator/**").hasRole("ADMIN")//扫描漏洞添加
.antMatchers("/admin/**").hasRole("ADMIN")//扫描漏洞添加
.antMatchers("/actuator/env").hasRole("plat_admin") // 仅允许ADMIN角色访问/env端点 //扫描漏洞添加
// 允许公开访问的端点
.requestMatchers(EndpointRequest.to("health", "info", "prometheus"))//扫描漏洞添加
.permitAll()
// 敏感端点需要管理员权限
.requestMatchers(EndpointRequest.to("env", "configprops", "beans", "mappings"))//扫描漏洞添加
.hasRole("ADMIN")
.anyRequest().authenticated()
.and()
.formLogin().loginPage(adminContextPath + "/login")
+1 -1
View File
@@ -92,7 +92,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<!--链路追踪-->
@@ -7,11 +7,15 @@ import com.linke.finance.domain.approvalDocument.repository.todo.ApprovalDocumen
import com.linke.finance.domain.approvalDocument.repository.todo.WorkflowProcessInstancesByIdDO;
import com.linke.finance.domain.approvalDocument.service.ApprovalDocumentDomainService;
import com.linke.finance.interfaces.vo.ApprovalStatsVO;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.rmi.ServerException;
import java.util.List;
/**
* 审批单据ApplicationService
@@ -30,8 +34,12 @@ public class ApprovalDocumentApplicationService {
* 分页查询审批单据列表
*/
public List<ApprovalDocumentPO> queryList(ApprovalDocumentDO approvalDocumentDO) {
public List<ApprovalDocumentPO> queryList(ApprovalDocumentDO approvalDocumentDO) throws Exception{
LoginUser loginUser = SecurityUtils.getLoginUser();
UserPo userPo=loginUser.getUserPo();
if(!userPo.getRoleCode().equals("plat_admin")){
throw new ServerException("您没有权限访问");
}
if (loginUser != null){
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
if (topOrganizationId != null && topOrganizationId != 1){
@@ -0,0 +1,100 @@
package com.linke.finance.application.server.receivingAccount;
import com.linke.finance.domain.receivingAccount.entity.ReceivingAccount;
import com.linke.finance.domain.receivingAccount.repository.persistence.ReceivingAccountRepository;
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
import com.mhd.common.core.utils.bean.BeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 收款账户ApplicationService
*
* @author system
* @date 2025-12-06
*/
@Service
@Slf4j
public class ReceivingAccountApplicationService {
@Resource
private ReceivingAccountRepository receivingAccountRepository;
/**
* 查询收款账户列表
*
* @param receivingAccountDO 查询条件
* @return 收款账户列表
*/
public List<ReceivingAccountPO> queryList(ReceivingAccountDO receivingAccountDO) {
log.info("查询收款账户列表,查询条件:{}", receivingAccountDO);
return receivingAccountRepository.queryList(receivingAccountDO);
}
/**
* 新增收款账户
*
* @param receivingAccountDTO 收款账户DTO
* @return 是否成功
*/
public Boolean insert(ReceivingAccountDO receivingAccountDTO) {
log.info("新增收款账户,参数:{}", receivingAccountDTO);
ReceivingAccount receivingAccount = new ReceivingAccount();
BeanUtils.copyProperties(receivingAccountDTO, receivingAccount);
receivingAccount.setDelFlag(1); // 1-正常
receivingAccount.setCreateTime(new Date());
receivingAccount.setUpdateTime(new Date());
int result = receivingAccountRepository.insert(receivingAccount);
return result > 0;
}
/**
* 批量新增收款账户先删除所有再新增
*
* @param receivingAccountDTOList 收款账户DTO列表
* @return 是否成功
*/
@Transactional
public Boolean batchInsert(List<ReceivingAccountDO> receivingAccountDTOList) {
log.info("批量新增收款账户,数量:{}", receivingAccountDTOList.size());
// 先删除所有现有数据
int deleteCount = receivingAccountRepository.deleteAll();
log.info("已删除现有收款账户数量:{}", deleteCount);
List<ReceivingAccount> receivingAccountList = new ArrayList<>();
Date now = new Date();
for (ReceivingAccountDO dto : receivingAccountDTOList) {
ReceivingAccount receivingAccount = new ReceivingAccount();
BeanUtils.copyProperties(dto, receivingAccount);
receivingAccount.setDelFlag(1); // 1-正常
receivingAccount.setCreateTime(now);
receivingAccount.setUpdateTime(now);
receivingAccountList.add(receivingAccount);
}
int result = receivingAccountRepository.batchInsert(receivingAccountList);
log.info("新增收款账户数量:{}", result);
return result > 0;
}
/**
* 根据ID删除收款账户
*
* @param id 主键ID
* @return 是否成功
*/
public Boolean deleteById(Long id) {
log.info("删除收款账户,ID{}", id);
int result = receivingAccountRepository.deleteById(id);
return result > 0;
}
}
@@ -113,6 +113,8 @@ public class TmsReceiptApplicationService {
tmsReceiptDO.setOrganizationId(organizationId);
tmsReceiptDO.setOrganizationName(organizationName);
tmsReceiptDO.setCreateBy(userId);
tmsReceiptDO.setAccountName(dto.getAccountName());
tmsReceiptDO.setAccountInformation(dto.getAccountInformation());
tmsReceiptDO.setCreateByName(userName);
tmsReceiptDO.setReceivePaymentNumber(OrderSequence.getOrderCode());
tmsReceiptDO.setCreateTime(now);
@@ -0,0 +1,42 @@
package com.linke.finance.domain.receivingAccount.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mhd.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* 收款账户实体类
*
* @author system
* @date 2025-12-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("receiving_account")
public class ReceivingAccount extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键ID */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 账户名称 */
private String accountName;
/** 账户信息 */
private String accountInformation;
/** 删除标记:1-正常,2-已删除 */
private Integer delFlag;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -0,0 +1,56 @@
package com.linke.finance.domain.receivingAccount.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linke.finance.domain.receivingAccount.entity.ReceivingAccount;
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
import java.util.List;
/**
* 收款账户Mapper接口
*
* @author system
* @date 2025-12-06
*/
public interface ReceivingAccountMapper extends BaseMapper<ReceivingAccount> {
/**
* 查询收款账户列表
*
* @param receivingAccountDO 查询条件
* @return 收款账户列表
*/
List<ReceivingAccountPO> queryList(ReceivingAccountDO receivingAccountDO);
/**
* 新增收款账户
*
* @param receivingAccount 收款账户
* @return 影响行数
*/
int insert(ReceivingAccount receivingAccount);
/**
* 批量新增收款账户
*
* @param receivingAccountList 收款账户列表
* @return 影响行数
*/
int batchInsert(List<ReceivingAccount> receivingAccountList);
/**
* 删除所有收款账户
*
* @return 影响行数
*/
int deleteAll();
/**
* 根据ID删除收款账户
*
* @param id 主键ID
* @return 影响行数
*/
int deleteById(Long id);
}
@@ -0,0 +1,72 @@
package com.linke.finance.domain.receivingAccount.repository.persistence;
import com.linke.finance.domain.receivingAccount.entity.ReceivingAccount;
import com.linke.finance.domain.receivingAccount.repository.mapper.ReceivingAccountMapper;
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
/**
* 收款账户Repository
*
* @author system
* @date 2025-12-06
*/
@Repository
public class ReceivingAccountRepository {
@Resource
private ReceivingAccountMapper receivingAccountMapper;
/**
* 查询收款账户列表
*
* @param receivingAccountDO 查询条件
* @return 收款账户列表
*/
public List<ReceivingAccountPO> queryList(ReceivingAccountDO receivingAccountDO) {
return receivingAccountMapper.queryList(receivingAccountDO);
}
/**
* 新增收款账户
*
* @param receivingAccount 收款账户
* @return 影响行数
*/
public int insert(ReceivingAccount receivingAccount) {
return receivingAccountMapper.insert(receivingAccount);
}
/**
* 批量新增收款账户
*
* @param receivingAccountList 收款账户列表
* @return 影响行数
*/
public int batchInsert(List<ReceivingAccount> receivingAccountList) {
return receivingAccountMapper.batchInsert(receivingAccountList);
}
/**
* 删除所有收款账户
*
* @return 影响行数
*/
public int deleteAll() {
return receivingAccountMapper.deleteAll();
}
/**
* 根据ID删除收款账户
*
* @param id 主键ID
* @return 影响行数
*/
public int deleteById(Long id) {
return receivingAccountMapper.deleteById(id);
}
}
@@ -0,0 +1,51 @@
package com.linke.finance.domain.receivingAccount.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 收款账户响应对象
*
* @author system
* @date 2025-12-06
*/
@Data
@ApiModel(value = "收款账户对象", description = "收款账户响应对象")
public class ReceivingAccountPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:1-正常,2-已删除")
private Integer delFlag;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ApiModelProperty("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -0,0 +1,34 @@
package com.linke.finance.domain.receivingAccount.repository.todo;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 收款账户查询对象
*
* @author system
* @date 2025-12-06
*/
@Data
public class ReceivingAccountDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("账户名称")
private String accountName;
@ApiModelProperty("账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:1-正常,2-已删除")
private Integer delFlag;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -404,12 +404,6 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
}else{
throw new ServiceException("查询当前登录人用户信息失败");
}
if (org.apache.commons.lang.StringUtils.isBlank(userPo.getSalespersonNcCode())) {
throw new ServiceException("请先维护业务员编码");
}
if (org.apache.commons.lang.StringUtils.isBlank(userPo.getDocumentPreparerNcCode())) {
throw new ServiceException("请先维护制单员编码");
}
for (String businessDocumentDetaliId:businessDocumentDetaliIdArray){
Reconciliation reconciliation=reconciliationMapper.selectById(businessDocumentDetaliId);
if(reconciliation.getSynchronousStatus()==1){
@@ -431,6 +425,7 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
ReconciliationDTO reconciliationDTO=new ReconciliationDTO();
reconciliationDTO.setInnerNumber(reconciliation.getInnerNumber());
R<List<TmsOrder>> result=wlhyServiceFeign.getOrderListByReconciliation(reconciliationDTO);
String makerCodeNc="";
if(result.getCode()==200){
List<TmsOrder> list=result.getData();
if(ObjectUtil.isNotNull(list)){
@@ -448,123 +443,128 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
if(null==reconciliation.getSettlementPartyId()){
throw new ServiceException("没有结算方,请核对");
}
AjaxResult ajaxResult=userServiceFeign.getShipperSummaryData(Long.valueOf(reconciliation.getSettlementPartyId()));
if(ajaxResult.get("code").toString().equals("200")){
Object userShipperPo= ajaxResult.get("data");
JSONObject jsonObject = new JSONObject((Map) userShipperPo);
if(org.apache.commons.lang.StringUtils.isBlank(jsonObject.get("customerNcCode").toString())){
throw new ServiceException("请先维护客户编码");
}
Ysitem item=new Ysitem();
item.setSo_deptid("NG040104");
item.setPk_deptid("NG040104");
item.setPk_psndoc(userPo.getSalespersonNcCode());
item.setCustomer(jsonObject.get("customerNcCode").toString());
item.setObjtype("0");
item.setDirection("1");
item.setScomment(jsonObject.get("shipperEnterpriseName").toString());
item.setPk_currtype("CNY");
item.setPurchaseorder(tmsOrder.getGoodsNumber());
item.setTaxrate("0");
item.setQuantity_de("0");
item.setMoney_de(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setMoney_bal(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setNotax_de(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setLocal_tax_de(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setTax_de(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setPrice(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setTaxprice(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setDef75("T10");
item.setInvoiceno("");
ysitemList.add(item);
if (org.apache.commons.lang.StringUtils.isBlank(tmsOrder.getSalesmanCodeNc())) {
throw new ServiceException("请先维护业务员编码");
}
if (org.apache.commons.lang.StringUtils.isBlank(tmsOrder.getMakerCodeNc())) {
throw new ServiceException("请先维护制单员编码");
}
if (org.apache.commons.lang.StringUtils.isBlank(tmsOrder.getCustomsCodeNc())) {
throw new ServiceException("请先维护制单员编码");
}
makerCodeNc=tmsOrder.getMakerCodeNc();
Ysitem item=new Ysitem();
item.setSo_deptid("NG040104");
item.setPk_deptid("NG040104");
item.setPk_psndoc(tmsOrder.getSalesmanCodeNc());
item.setCustomer(tmsOrder.getCustomsCodeNc());
item.setObjtype("0");
item.setDirection("1");
item.setScomment(tmsOrder.getAppointShipper());
// item.setPk_currtype("CNY");
item.setPk_currtype(tmsOrder.getSettlementCurrency());
item.setPurchaseorder(tmsOrder.getGoodsNumber());
item.setTaxrate("0");
item.setQuantity_de("0");
item.setMoney_de(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setMoney_bal(String.valueOf(tmsOrder.getDeliveryFreight()));
BigDecimal tax_de=tmsOrder.getDeliveryFreight().multiply(tmsOrder.getTaxRate()).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal notax_de=tmsOrder.getDeliveryFreight().subtract(tax_de);
item.setNotax_de(String.valueOf(notax_de));
item.setLocal_tax_de(String.valueOf(notax_de));
item.setTax_de(String.valueOf(tax_de));
item.setPrice(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setTaxprice(String.valueOf(tmsOrder.getDeliveryFreight()));
item.setDef75("T10");
item.setInvoiceno("");
ysitemList.add(item);
}
Ysbodys bodys=new Ysbodys();
bodys.setItem(ysitemList);
Ysbillhead billhead=new Ysbillhead();
billhead.setPk_group("CNK");
billhead.setPk_org("NG0401");
billhead.setSett_org("NG0401");
billhead.setCreationtime(dateString);
billhead.setCreator(makerCodeNc);
billhead.setPk_billtype("F0");
billhead.setPk_tradetype("D0");
billhead.setBillclass("ys");
billhead.setIsinit("N");
date=reconciliation.getCreateTime();
dateString = sdf.format(date);
billhead.setBilldate(dateString);
billhead.setSyscode("0");
billhead.setBillno("");
billhead.setDef59("");
billhead.setSrc_syscode("0");
billhead.setBillstatus("0");
billhead.setBillmaker(makerCodeNc);
billhead.setPk_busitype("");
billhead.setBillyear(sdf1.format(date));
billhead.setBillperiod(sdf2.format(date));
billhead.setEffectstatus("0");
billhead.setDef28("nqyw");
billhead.setDef29(reconciliation.getInnerNumber());
billhead.setBodys(bodys);
Ysbill bill=new Ysbill();
bill.setId("ys"+String.valueOf(reconciliation.getReconciliationId()));
bill.setBillhead(billhead);
Ysufinterface ufinterface=new Ysufinterface();
ufinterface.setAccount("NKNC");
ufinterface.setBilltype("F0");
ufinterface.setBusinessunitcode("");
ufinterface.setFilename("");
ufinterface.setIsexchange("Y");
ufinterface.setOrgcode("NG0401");
ufinterface.setReceiver("NG0401");
ufinterface.setReplace("Y");
ufinterface.setRoottag("");
ufinterface.setSender("nqyw");
ufinterface.setBill(bill);
JAXBContext jaxbContext = JAXBContext.newInstance(Ysufinterface.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); // 格式化输出可选
StringWriter sw = new StringWriter();
marshaller.marshal(ufinterface, sw);
String xmlString = sw.toString(); // 这是要发送的XML字符串
System.out.println(xmlString);
NcLog ncLog=new NcLog();
ncLog.setOrderId(reconciliation.getReconciliationId());
ncLog.setRequestBody(xmlString);
ncLog.setResponeBody("");
ncLog.setType(0L);
ncLog.setOrganizationId(reconciliation.getOrganizationId());
ncLog.setOrganizationName(reconciliation.getOrganizationName());
ncLog.setTopOrganizationId(reconciliation.getTopOrganizationId());
ncLogMapper.insert(ncLog);
reconciliation.setSynchronousStatus(1);
reconciliation.setSynchronousTime(new Date());
reconciliation.setNcId("ys"+String.valueOf(reconciliation.getReconciliationId()));
reconciliationMapper.updateById(reconciliation);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
StringEntity postingString = new StringEntity(xmlString, "UTF-8");
httpPost.setEntity(postingString);
httpPost.setHeader("Content-type", "application/xml");
try {
CloseableHttpResponse response = httpClient.execute(httpPost);
String responseString = EntityUtils.toString(response.getEntity());
System.out.println(responseString);
response.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
Ysbodys bodys=new Ysbodys();
bodys.setItem(ysitemList);
Ysbillhead billhead=new Ysbillhead();
billhead.setPk_group("CNK");
billhead.setPk_org("NG0401");
billhead.setSett_org("NG0401");
billhead.setCreationtime(dateString);
billhead.setCreator(userPo.getDocumentPreparerNcCode());
billhead.setPk_billtype("F0");
billhead.setPk_tradetype("D0");
billhead.setBillclass("ys");
billhead.setIsinit("N");
date=reconciliation.getCreateTime();
dateString = sdf.format(date);
billhead.setBilldate(dateString);
billhead.setSyscode("0");
billhead.setBillno("");
billhead.setDef59("");
billhead.setSrc_syscode("0");
billhead.setBillstatus("0");
billhead.setBillmaker(userPo.getDocumentPreparerNcCode());
billhead.setPk_busitype("");
billhead.setBillyear(sdf1.format(date));
billhead.setBillperiod(sdf2.format(date));
billhead.setEffectstatus("0");
billhead.setDef28("nqyw");
billhead.setDef29(reconciliation.getInnerNumber());
billhead.setBodys(bodys);
Ysbill bill=new Ysbill();
bill.setId("ys"+String.valueOf(reconciliation.getReconciliationId()));
bill.setBillhead(billhead);
Ysufinterface ufinterface=new Ysufinterface();
ufinterface.setAccount("NKNC");
ufinterface.setBilltype("F0");
ufinterface.setBusinessunitcode("");
ufinterface.setFilename("");
ufinterface.setIsexchange("Y");
ufinterface.setOrgcode("NG0401");
ufinterface.setReceiver("NG0401");
ufinterface.setReplace("Y");
ufinterface.setRoottag("");
ufinterface.setSender("nqyw");
ufinterface.setBill(bill);
JAXBContext jaxbContext = JAXBContext.newInstance(Ysufinterface.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); // 格式化输出可选
StringWriter sw = new StringWriter();
marshaller.marshal(ufinterface, sw);
String xmlString = sw.toString(); // 这是要发送的XML字符串
System.out.println(xmlString);
NcLog ncLog=new NcLog();
ncLog.setOrderId(reconciliation.getReconciliationId());
ncLog.setRequestBody(xmlString);
ncLog.setResponeBody("");
ncLog.setType(0L);
ncLog.setOrganizationId(reconciliation.getOrganizationId());
ncLog.setOrganizationName(reconciliation.getOrganizationName());
ncLog.setTopOrganizationId(reconciliation.getTopOrganizationId());
ncLogMapper.insert(ncLog);
reconciliation.setSynchronousStatus(1);
reconciliation.setSynchronousTime(new Date());
reconciliation.setNcId("ys"+String.valueOf(reconciliation.getReconciliationId()));
reconciliationMapper.updateById(reconciliation);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
StringEntity postingString = new StringEntity(xmlString, "UTF-8");
httpPost.setEntity(postingString);
httpPost.setHeader("Content-type", "application/xml");
try {
CloseableHttpResponse response = httpClient.execute(httpPost);
String responseString = EntityUtils.toString(response.getEntity());
System.out.println(responseString);
response.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
httpClient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} catch (JAXBException e) {
e.printStackTrace();
@@ -611,12 +611,7 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
if(reconciliation.getCollectionState()!=2){
throw new ServiceException("该记录还未结算完成,不允许同步");
}
/* if(org.apache.commons.lang.StringUtils.isBlank(userPo.getSalespersonNcCode())){
throw new ServiceException("请先维护业务员编码");
}
if(org.apache.commons.lang.StringUtils.isBlank(userPo.getDocumentPreparerNcCode())){
throw new ServiceException("请先维护制单员编码");
}*/
try {
Date date = reconciliation.getCreateTime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -626,36 +621,50 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
List<SKitem> ysitemList=new ArrayList<SKitem>();
ReconciliationDTO reconciliationDTO=new ReconciliationDTO();
reconciliationDTO.setInnerNumber(reconciliation.getInnerNumber());
if(null==reconciliation.getSettlementPartyId()){
throw new ServiceException("没有结算方,请核对");
}
String makerCodeNc="";
R<List<TmsOrder>> result=wlhyServiceFeign.getOrderListByReconciliation(reconciliationDTO);
if(result.getCode()==200){
List<TmsOrder> list=result.getData();
if(ObjectUtil.isNotNull(list)){
for(TmsOrder tmsOrder:list){
if(null==reconciliation.getSettlementPartyId()){
throw new ServiceException("没有结算方,请核对");
if (org.apache.commons.lang.StringUtils.isBlank(tmsOrder.getSalesmanCodeNc())) {
throw new ServiceException("请先维护业务员编码");
}
AjaxResult ajaxResult=userServiceFeign.getShipperSummaryData(Long.valueOf(reconciliation.getSettlementPartyId()));
if (org.apache.commons.lang.StringUtils.isBlank(tmsOrder.getMakerCodeNc())) {
throw new ServiceException("请先维护制单员编码");
}
if (org.apache.commons.lang.StringUtils.isBlank(tmsOrder.getCustomsCodeNc())) {
throw new ServiceException("请先维护制单员编码");
}
SKitem item=new SKitem();
item.setSo_deptid("NG040104");
item.setPk_deptid("NG040104");
item.setCheckdirection("ar");
item.setPk_psndoc(tmsOrder.getSalesmanCodeNc());
item.setCustomer(tmsOrder.getCustomsCodeNc());
item.setPurchaseorder(tmsOrder.getGoodsNumber());
item.setObjtype("0");
item.setDirection("1");
item.setScomment(tmsOrder.getAppointShipper());
item.setPk_currtype(tmsOrder.getSettlementCurrency());
item.setMoney_cr(String.valueOf(tmsOrder.getCollectedFreight()));
item.setMoney_bal(String.valueOf(tmsOrder.getCollectedFreight()));
ysitemList.add(item);
/* AjaxResult ajaxResult=userServiceFeign.getShipperSummaryData(Long.valueOf(reconciliation.getSettlementPartyId()));
if(ajaxResult.get("code").toString().equals("200")){
Object userShipperPo= ajaxResult.get("data");
JSONObject jsonObject = new JSONObject((Map) userShipperPo);
if(org.apache.commons.lang.StringUtils.isBlank(jsonObject.get("customerNcCode").toString())){
throw new ServiceException("请先维护客户编码");
}
SKitem item=new SKitem();
item.setSo_deptid("NG040104");
item.setPk_deptid("NG040104");
item.setCheckdirection("ar");
item.setPk_psndoc(userPo.getSalespersonNcCode());
item.setCustomer(jsonObject.get("customerNcCode").toString());
item.setPurchaseorder(tmsOrder.getGoodsNumber());
item.setObjtype("0");
item.setDirection("1");
item.setScomment(jsonObject.get("shipperEnterpriseName").toString());
item.setPk_currtype("CNY");
item.setMoney_cr(String.valueOf(tmsOrder.getCollectedFreight()));
item.setMoney_bal(String.valueOf(tmsOrder.getCollectedFreight()));
ysitemList.add(item);
}
}*/
}
}
@@ -668,7 +677,7 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
billhead.setSett_org("NG0401");
billhead.setCreationtime(dateString);
billhead.setPk_billtype("F2");
billhead.setCreator(userPo.getDocumentPreparerNcCode());
billhead.setCreator(makerCodeNc);
billhead.setPk_tradetype("D2");
billhead.setBillclass("sk");
billhead.setBilldate(dateString);
@@ -677,7 +686,7 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
billhead.setDef59("");
billhead.setSrc_syscode("0");
billhead.setBillstatus("0");
billhead.setBillmaker(userPo.getDocumentPreparerNcCode());
billhead.setBillmaker(makerCodeNc);
billhead.setPk_busitype("");
billhead.setBillyear(sdf1.format(date));
billhead.setBillperiod(sdf2.format(date));
@@ -93,6 +93,14 @@ public class TmsReceipt extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -88,6 +88,14 @@ public class TmsReceiptPO extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -99,6 +99,14 @@ public class TmsReceiptDO extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -4,6 +4,7 @@ import com.linke.finance.domain.accountManage.entity.AccountExpendRecords;
import com.linke.finance.interfaces.dto.*;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import java.util.Date;
@@ -26,6 +27,7 @@ public class AccountAssembler {
// 拷贝vehicleDto到vehicle中
BeanUtils.copyProperties(accountCashWalletDto, accountCashWallet);
// 获取登录人id
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = SecurityUtils.getLoginUser().getUserid();
if(accountCashWalletDto.getAccountCashWalletId() != null){
if(userId != null){
@@ -0,0 +1,43 @@
package com.linke.finance.interfaces.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 收款账户DTO
*
* @author system
* @date 2025-12-06
*/
@Data
public class ReceivingAccountDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("账户名称")
private String accountName;
@ApiModelProperty("账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:1-正常,2-已删除")
private Integer delFlag;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -95,6 +95,14 @@ public class TmsReceiptDTO extends BaseVOEntity{
@Excel(name = "收款备注")
private String remark;
@ApiModelProperty("账户名称")
@Excel(name = "账户名称")
private String accountName;
@ApiModelProperty("账户信息")
@Excel(name = "账户信息")
private String accountInformation;
@ApiModelProperty("删除标记:0-无状态,1-正常,2-已删除")
@Excel(name = "是否删除", readConverterExp = "删除标记:0-无状态,1-正常,2-已删除")
private Integer delFlag;
@@ -7,6 +7,8 @@ import com.linke.finance.interfaces.dto.approvalDocument.DingDingHuiDiaoDTO;
import com.linke.finance.interfaces.vo.ApprovalStatsVO;
import com.linke.finance.until.DingCallbackCrypto;
import com.mhd.common.core.domain.entity.R;
import java.rmi.ServerException;
import java.util.List;
import java.util.Map;
@@ -15,9 +17,12 @@ import com.linke.finance.domain.approvalDocument.repository.po.ApprovalDocumentP
import com.linke.finance.domain.approvalDocument.repository.todo.ApprovalDocumentDO;
import com.linke.finance.interfaces.assemble.approvalDocument.ApprovalDocumentAssembler;
import com.linke.finance.interfaces.dto.approvalDocument.ApprovalDocumentDTO;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.feign.ThirdPartyServiceFeign;
import com.mhd.common.log.annotation.Log;
import com.mhd.common.log.enums.BusinessType;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -53,11 +58,26 @@ public class ApprovalDocumentApi extends BaseController{
@GetMapping("/list")
public TableDataInfo list(ApprovalDocumentDTO approvalDocumentDTO)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
UserPo userPo = loginUser.getUserPo();
String roleCode = userPo.getRoleCode();
if (!"plat_admin".equals(roleCode)) {
return null;
}
//转换实体
ApprovalDocumentDO approvalDocumentDO = approvalDocumentAssembler.toDO(approvalDocumentDTO);
startPage();
List<ApprovalDocumentPO> list = approvalDocumentApplicationService.queryList(approvalDocumentDO);
return getDataTable(list);
List<ApprovalDocumentPO> list = null;
try {
list = approvalDocumentApplicationService.queryList(approvalDocumentDO);
return getDataTable(list);
} catch (ServerException e) {
e.printStackTrace();
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
@@ -1,11 +1,16 @@
package com.linke.finance.interfaces.facadeApp.tmsReceipt;
import java.util.ArrayList;
import java.util.List;
import com.linke.finance.application.server.receivingAccount.ReceivingAccountApplicationService;
import com.linke.finance.application.server.tmsReceipt.TmsReceiptApplicationService;
import com.linke.finance.application.server.tmsReceipt.TmsReceiptAssembler;
import com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO;
import com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO;
import com.linke.finance.domain.tmsReceipt.repository.po.TmsReceiptPO;
import com.linke.finance.domain.tmsReceipt.repository.todo.TmsReceiptDO;
import com.linke.finance.interfaces.dto.ReceivingAccountDTO;
import com.linke.finance.interfaces.dto.TmsReceiptDTO;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.bean.BeanUtils;
@@ -33,6 +38,8 @@ public class TmsReceiptApi extends BaseController{
@Autowired
private TmsReceiptApplicationService tmsReceiptApplicationService;
@Autowired
private ReceivingAccountApplicationService receivingAccountApplicationService;
@Resource
private TmsReceiptAssembler tmsReceiptAssembler;
@@ -53,6 +60,66 @@ public class TmsReceiptApi extends BaseController{
List<TmsReceiptPO> list = tmsReceiptApplicationService.queryList(tmsReceiptDO);
return getDataTable(list);
}
/**
* 查询收款账户列表
*/
// @ApiOperation("查询收款账户列表")
@Log(title = "查询收款账户列表", description = "查询收款账户列表", businessType = BusinessType.INQUIRE)
@GetMapping("/listAccount")
public TableDataInfo listAccount(ReceivingAccountDTO receivingAccountDTO)
{
//转换实体
ReceivingAccountDO receivingAccountDO = new ReceivingAccountDO();
BeanUtils.copyProperties(receivingAccountDTO, receivingAccountDO);
startPage();
List<ReceivingAccountPO> list = receivingAccountApplicationService.queryList(receivingAccountDO);
return getDataTable(list);
}
/**
* 新增收款账户
*/
// @ApiOperation("新增收款账户")
@Log(title = "新增收款账户", description = "新增收款账户", businessType = BusinessType.INSERT)
@PostMapping("/addAccount")
public AjaxResult addAccount(@RequestBody ReceivingAccountDTO receivingAccountDTO)
{
//转换实体
ReceivingAccountDO receivingAccountDO = new ReceivingAccountDO();
BeanUtils.copyProperties(receivingAccountDTO, receivingAccountDO);
return toAjax(receivingAccountApplicationService.insert(receivingAccountDO));
}
/**
* 批量新增收款账户
*/
// @ApiOperation("批量新增收款账户")
@Log(title = "批量新增收款账户", description = "批量新增收款账户", businessType = BusinessType.INSERT)
@PostMapping("/batchAddAccount")
public AjaxResult batchAddAccount(@RequestBody List<ReceivingAccountDTO> receivingAccountDTOList)
{
//转换实体
List<ReceivingAccountDO> receivingAccountDOList = new ArrayList<>();
for (ReceivingAccountDTO dto : receivingAccountDTOList) {
ReceivingAccountDO receivingAccountDO = new ReceivingAccountDO();
BeanUtils.copyProperties(dto, receivingAccountDO);
receivingAccountDOList.add(receivingAccountDO);
}
return toAjax(receivingAccountApplicationService.batchInsert(receivingAccountDOList));
}
/**
* 删除收款账户
*/
// @ApiOperation("删除收款账户")
@Log(title = "删除收款账户", description = "删除收款账户", businessType = BusinessType.DELETE)
@DeleteMapping("/deleteAccount/{id}")
public AjaxResult deleteAccount(@PathVariable("id") Long id)
{
return toAjax(receivingAccountApplicationService.deleteById(id));
}
/**
* 编辑&保存收款单
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linke.finance.domain.receivingAccount.repository.mapper.ReceivingAccountMapper">
<resultMap type="com.linke.finance.domain.receivingAccount.repository.po.ReceivingAccountPO" id="ReceivingAccountResult">
<result property="id" column="id" />
<result property="accountName" column="account_name" />
<result property="accountInformation" column="account_information" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectReceivingAccountPo">
select id, account_name, account_information, del_flag, create_time, update_time
from receiving_account
</sql>
<sql id="selectReceivingAccountWhere">
<where>
and del_flag = 1
<if test="id != null">
and id = #{id}
</if>
<if test="accountName != null and accountName != ''">
and account_name like concat('%', #{accountName}, '%')
</if>
<if test="accountInformation != null and accountInformation != ''">
and account_information like concat('%', #{accountInformation}, '%')
</if>
order by create_time desc
</where>
</sql>
<select id="queryList" parameterType="com.linke.finance.domain.receivingAccount.repository.todo.ReceivingAccountDO" resultMap="ReceivingAccountResult">
<include refid="selectReceivingAccountPo"/>
<include refid="selectReceivingAccountWhere"/>
</select>
<insert id="insert" parameterType="com.linke.finance.domain.receivingAccount.entity.ReceivingAccount">
insert into receiving_account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="accountName != null and accountName != ''">account_name,</if>
<if test="accountInformation != null and accountInformation != ''">account_information,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="accountName != null and accountName != ''">#{accountName},</if>
<if test="accountInformation != null and accountInformation != ''">#{accountInformation},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<insert id="batchInsert" parameterType="java.util.List">
insert into receiving_account (account_name, account_information, del_flag, create_time, update_time,top_organization_id, organization_id)
values
<foreach collection="list" item="item" separator=",">
(
#{item.accountName},
#{item.accountInformation},
#{item.delFlag},
#{item.createTime},
#{item.updateTime},#{item.topOrganizationId},#{item.organizationId}
)
</foreach>
</insert>
<update id="deleteById" parameterType="Long">
update receiving_account
set del_flag = 2,
update_time = now()
where id = #{id}
</update>
<update id="deleteAll">
update receiving_account
set del_flag = 2,
update_time = now()
where del_flag = 1
</update>
</mapper>
@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="creditReason" column="credit_reason" />
<result property="serialNumber" column="serial_number" />
<result property="remark" column="remark" />
<result property="accountName" column="account_name" />
<result property="accountInformation" column="account_information" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@@ -35,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectTmsReceiptPo">
select id, top_organization_id,organization_id,organization_name,department_name,settlement_party_name,receive_payment_number, receive_payment_amount,
assignable_amount,assignment_status,credit_amount,credit_reason, receive_payment_time, serial_number,receive_voucher_url,
remark, create_by,create_by_name, create_time, update_by,update_by_name, update_time, del_flag from tms_receipt
remark, account_name, account_information, create_by,create_by_name, create_time, update_by,update_by_name, update_time, del_flag from tms_receipt
</sql>
<sql id="selectTmsReceiptPo1">
@@ -89,6 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
<if test="accountName != null and accountName != ''">
and account_name like concat('%', #{accountName}, '%')
</if>
<if test="accountInformation != null and accountInformation != ''">
and account_information like concat('%', #{accountInformation}, '%')
</if>
order by create_time desc
</where>
+7 -2
View File
@@ -93,7 +93,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<!--import mybatis plus 它会自动引入mybatis及mybatis spring切勿重复引用以免冲突-->
@@ -132,7 +132,12 @@
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.2</version>
<version>8.4.3</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
@@ -1,3 +1,4 @@
/*
package com.linke.product.application.event.menu.publish;
import com.linke.product.infrastructure.util.mq.MenuChannel;
@@ -6,13 +7,15 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;
*/
/**
* 消息发布
*
* 2022-12-21
*
* @author 王子豪
*/
*//*
@EnableBinding(value = { MenuChannel.class })
@Service
public class MenuPublish {
@@ -27,3 +30,4 @@ public class MenuPublish {
source.outputLog().send(MessageBuilder.withPayload(content).build());
}
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.application.event.menu.subscribe;
import com.linke.product.infrastructure.util.mq.MenuChannel;
@@ -5,13 +6,15 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
*/
/**
* 消息接收
*
* 2022-12-1
*
* @author 王子豪
*/
*//*
@EnableBinding(value = { MenuChannel.class })
public class MenuSubscribe {
@@ -29,3 +32,4 @@ public class MenuSubscribe {
// menuApplicationService.selectTreeMenu();
}
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.application.event.modules.publish;
import com.linke.product.infrastructure.util.mq.ModulesChannel;
@@ -6,13 +7,15 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;
*/
/**
* 消息发布
*
* 2022-12-1
*
* @author 王子豪
*/
*//*
@EnableBinding(value = { ModulesChannel.class })
@Service
public class ModulesPublish {
@@ -27,3 +30,4 @@ public class ModulesPublish {
source.outputLog().send(MessageBuilder.withPayload(content).build());
}
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.application.event.modules.subscribe;
import com.linke.product.infrastructure.util.mq.ModulesChannel;
@@ -5,13 +6,15 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
*/
/**
* 消息接收
*
* 2022-12-1
*
* @author 王子豪
*/
*//*
@EnableBinding(value = { ModulesChannel.class })
public class ModulesSubscribe {
@@ -29,3 +32,4 @@ public class ModulesSubscribe {
// sysModulesApplicationService.selectTreeModules();
}
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.application.event.organization.publish;
import com.linke.product.infrastructure.util.mq.OrganizationChannel;
@@ -6,13 +7,15 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;
*/
/**
* 消息发布
*
* 2022-11-22
*
* @author 王子豪
*/
*//*
@EnableBinding(value = { OrganizationChannel.class })
@Service
public class OrganizationPublish {
@@ -27,3 +30,4 @@ public class OrganizationPublish {
source.outputLog().send(MessageBuilder.withPayload(content).build());
}
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.application.event.organization.subscribe;
import com.linke.product.application.service.organization.OrganizationApplicationService;
@@ -8,13 +9,15 @@ import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
*/
/**
* 消息接收
*
* 2022-11-25
*
* @author 王子豪
*/
*//*
@EnableBinding(value = { OrganizationChannel.class })
public class OrganizationSubscribe {
@@ -32,3 +35,4 @@ public class OrganizationSubscribe {
// organizationASvc.selectTreeOrganization();
}
}
*/
@@ -46,6 +46,7 @@ import lombok.extern.slf4j.Slf4j;
import minio.MinIoUploadService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@@ -100,6 +101,7 @@ public class MenuApplicationService {
@Autowired(required = false)
private MinIoUploadService minIoUploadService;
/**
* 查询菜单集合
*
@@ -1,6 +1,6 @@
package com.linke.product.application.service.modules;
import com.linke.product.application.event.modules.publish.ModulesPublish;
//import com.linke.product.application.event.modules.publish.ModulesPublish;
import com.linke.product.domain.modules.entity.ModulesMenu;
import com.linke.product.domain.modules.entity.SysModules;
import com.linke.product.domain.modules.service.ModulesMenuDomainService;
@@ -27,8 +27,8 @@ public class SysModulesApplicationService {
private SysModulesDomainService iSysModulesSvc;
@Autowired
private ModulesMenuDomainService iModulesMenuSvc;
@Autowired
private ModulesPublish modulesPublish;
/*@Autowired
private ModulesPublish modulesPublish;*/
/**
* 查询产品中台-模块
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.linke.product.application.event.organization.publish.OrganizationPublish;
//import com.linke.product.application.event.organization.publish.OrganizationPublish;
import com.linke.product.domain.common.entity.DataPermission;
import com.linke.product.domain.customAuth.service.CustomAuthDomainService;
import com.linke.product.domain.customAuth.service.CustomAuthOrganizationDomainService;
@@ -72,8 +72,8 @@ public class OrganizationApplicationService {
private OrganizationWlhyDomainService organizationWlhyDomainService;
@Autowired
private OrganizationMenuDomainService iOrganizationMenuSvc;
@Autowired
private OrganizationPublish organizationPublish;
/* @Autowired
private OrganizationPublish organizationPublish;*/
@Autowired
private MenuDomainService menuDomainService;
@Autowired
@@ -1,3 +1,4 @@
/*
package com.linke.product.infrastructure.util.mq;
import org.springframework.cloud.stream.annotation.Input;
@@ -5,6 +6,7 @@ import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;
*/
/**
* 自定义消息通道
*
@@ -12,7 +14,8 @@ import org.springframework.messaging.SubscribableChannel;
* 2022-12-1
*
* @author 王子豪
*/
*//*
public interface MenuChannel {
String INPUT_LOG = "inputMenu";
@@ -22,3 +25,4 @@ public interface MenuChannel {
@Output(OUTPUT_LOG)
MessageChannel outputLog();
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.infrastructure.util.mq;
import org.springframework.cloud.stream.annotation.Input;
@@ -5,6 +6,7 @@ import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;
*/
/**
* 自定义消息通道
*
@@ -12,7 +14,8 @@ import org.springframework.messaging.SubscribableChannel;
* 2022-12-1
*
* @author 王子豪
*/
*//*
public interface ModulesChannel {
String INPUT_LOG = "inputModules";
@@ -22,3 +25,4 @@ public interface ModulesChannel {
@Output(OUTPUT_LOG)
MessageChannel outputLog();
}
*/
@@ -1,3 +1,4 @@
/*
package com.linke.product.infrastructure.util.mq;
import org.springframework.cloud.stream.annotation.Input;
@@ -5,6 +6,7 @@ import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;
*/
/**
* 自定义消息通道
*
@@ -12,7 +14,8 @@ import org.springframework.messaging.SubscribableChannel;
* 2022-11-22
*
* @author 王子豪
*/
*//*
public interface OrganizationChannel {
String INPUT_LOG = "inputOrganization";
@@ -22,3 +25,4 @@ public interface OrganizationChannel {
@Output(OUTPUT_LOG)
MessageChannel outputLog();
}
*/
@@ -30,7 +30,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/tenants")
@CrossOrigin
//@CrossOrigin
public class SysTenantsApi extends BaseController
{
@Autowired
+1 -1
View File
@@ -99,7 +99,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<!--链路追踪-->
+1 -12
View File
@@ -93,7 +93,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<!--链路追踪-->
@@ -101,17 +101,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.4.3</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.8.1</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -405,9 +405,7 @@ public class VehicleApplicationService {
throw new ServiceException("车牌号不能为空");
}
if (! Pattern.matches(Constants.LICENSE_PLATE_REGEX, vehicleLicensePlateNumber)) {
throw new ServiceException("车牌号格式不正确");
}
// Removed license plate regex validation as per requirement
VehicleDto query = new VehicleDto();
query.setVehicleLicensePlateNumber(vehicle.getVehicleLicensePlateNumber());
@@ -680,9 +678,7 @@ public class VehicleApplicationService {
if (StrUtil.isEmpty(vehicleLicensePlateNumber)) {
throw new ServiceException("车牌号不能为空");
}
if (! Pattern.matches(Constants.LICENSE_PLATE_REGEX, vehicleLicensePlateNumber)) {
throw new ServiceException("车牌号格式不正确");
}
// Removed license plate regex validation as per requirement
VehicleDto query = new VehicleDto();
query.setVehicleLicensePlateNumber(vehicle.getVehicleLicensePlateNumber());
@@ -2920,4 +2916,41 @@ public class VehicleApplicationService {
public void addVehicle(VehicleDto vehicleDto) {
}
/**
*
* @param vehicleDto
* @return
*/
public Integer updatePilotDriver(VehicleDto vehicleDto) {
if (vehicleDto.getVehicleId() == null) {
throw new IllegalArgumentException("车辆ID不能为空");
}
boolean hasPilot1 = StringUtils.hasText(vehicleDto.getPilot1());
boolean hasPilot2 = StringUtils.hasText(vehicleDto.getPilot2());
// 两个都传了
if (hasPilot1 && hasPilot2) {
throw new IllegalArgumentException("不可同时传入");
}
// 两个都没传
if (!hasPilot1 && !hasPilot2) {
throw new IllegalArgumentException("请选择副驾");
}
UserDriverDTO userDriverDTO = new UserDriverDTO();
//将pilot1或是pilot2的id传给userDriverDTO,判断一下谁有值传谁
userDriverDTO.setUserId(Long.valueOf(hasPilot1 ? vehicleDto.getPilot1Id() : vehicleDto.getPilot2Id()));
userDriverDTO.setVehicleId(vehicleDto.getVehicleId());
// 更新
vehicleMapper.updatePilotDriver(vehicleDto);
userServiceFeign.bindVehicle(userDriverDTO);
return 1;
}
}
@@ -104,11 +104,11 @@ public class InboundOrderService extends ServiceImpl<InboundOrderMapper, Inbound
// 2.2 校验整机编号管理
if (material.isCodeManaged()) { // 如果物料需要编号管理
if (!StringUtils.hasText(detailDTO.getMachineSerialNo())) {
/*if (!StringUtils.hasText(detailDTO.getMachineSerialNo())) {
log.error("物料校验失败: 物料 '{}' 需要整机编号,但未提供", material.getName());
throw new IllegalArgumentException(
"物料 '" + material.getName() + "' 需要整机编号");
}
}*/
// 校验数量必须为 1
if (detailDTO.getQuantity().compareTo(BigDecimal.ONE) != 0) {
log.error("物料校验失败: 编号管理的物料 '{}' 数量必须为 1, 实际为 {}",
@@ -120,12 +120,12 @@ public class InboundOrderService extends ServiceImpl<InboundOrderMapper, Inbound
// 检查当前入库单内整机编号是否在库存中存在
boolean existsInStock = checkSerialNumberExistsInStock(createDTO.getOwnerId(),
detailDTO.getMaterialId(), detailDTO.getMachineSerialNo());
if (existsInStock) {
/*if (existsInStock) {
throw new IllegalArgumentException(
"当前货主ID " + createDTO.getOwnerId() + "货主名称:" + ownerName + " (" + ownerName
+ ") 的整机编号为"
+ detailDTO.getMachineSerialNo() + "的货物已在库存中");
}
}*/
} else { // 如果物料不需要编号管理
if (StringUtils.hasText(detailDTO.getMachineSerialNo())) {
@@ -47,4 +47,15 @@ public class CreateMaterialCommand {
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "物料体积")
private BigDecimal materialVolume;
@ApiModelProperty(value = "物料内容")
private String materialContent;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -36,7 +36,9 @@ public class MaterialCommandService {
command.getValue(),
command.getCodeManaged(),
command.getWeight(),
command.getRemark(),
command.getMaterialVolume(),
command.getMaterialContent(),
command.getRemark(),command.getTopOrganizationId(),command.getOrganizationId(),
codeGenerator
);
return materialRepository.save(material).getId();
@@ -57,7 +59,9 @@ public class MaterialCommandService {
command.getValue(),
command.getCodeManaged(),
command.getWeight(),
command.getRemark()
command.getMaterialVolume(),
command.getMaterialContent(),
command.getRemark(),command.getTopOrganizationId(),command.getOrganizationId()
);
materialRepository.update(material);
@@ -40,4 +40,15 @@ public class UpdateMaterialCommand {
private Boolean codeManaged;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "物料体积")
private BigDecimal materialVolume;
@ApiModelProperty(value = "物料内容")
private String materialContent;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
@Data
@ApiModel("查询参数")
@@ -29,4 +30,8 @@ public class MaterialQueryCommand {
private Long pageNo = 1L;
@ApiModelProperty(name = "每页条数")
private Long pageSize = 10L;
@ApiModelProperty(value = "物料体积")
private BigDecimal materialVolume;
@ApiModelProperty(value = "物料内容")
private String materialContent;
}
@@ -28,6 +28,7 @@ public class MaterialQueryService {
param.getMaterialCode(),
param.getCodeManaged(),
param.getRemark(),
param.getMaterialContent(),
param.getPageNo(),
param.getPageSize()
).convert(MaterialConverter :: convertToVO);
@@ -38,6 +38,12 @@ public class MaterialVO{
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty(value = "物料体积")
private BigDecimal materialVolume;
@ApiModelProperty(value = "物料内容")
private String materialContent;
@ApiModelProperty("创建时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@@ -322,5 +322,29 @@ public class Vehicle extends BaseVOEntity implements Serializable
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date insuranceValidityPeriod;
@ApiModelProperty(value = "副驾1")
private String pilot1;
@ApiModelProperty(value = "副驾1的Id")
private String pilot1Id;
@ApiModelProperty(value = "副驾2")
private String pilot2;
@ApiModelProperty(value = "副驾2的Id")
private String pilot2Id;
@ApiModelProperty(value = "跨境车牌")
private String crossPlate;
@ApiModelProperty(value = "保险")
private String insurance;
@ApiModelProperty(value = "签证本")
private String visa;
@ApiModelProperty(value = "车辆主体")
private Integer vehicleBody;
}
@@ -122,4 +122,6 @@ public interface VehicleMapper extends BaseMapper<Vehicle>
* APP绑定车辆我的车辆列表查询
*/
List<DriverVehicleBindPo> driverBindMyCarList(@Param("driverVehicleBindDto") DriverVehicleBindDto driverVehicleBindDto);
Integer updatePilotDriver(VehicleDto vehicleDto);
}
@@ -425,4 +425,28 @@ public class VehiclePo extends BaseVOEntity implements Serializable
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date insuranceValidityPeriod;
@ApiModelProperty(value = "副驾1")
private String pilot1;
@ApiModelProperty(value = "副驾1的Id")
private String pilot1Id;
@ApiModelProperty(value = "副驾2")
private String pilot2;
@ApiModelProperty(value = "副驾2的Id")
private String pilot2Id;
@ApiModelProperty(value = "跨境车牌")
private String crossPlate;
@ApiModelProperty(value = "保险")
private String insurance;
@ApiModelProperty(value = "签证本")
private String visa;
@ApiModelProperty(value = "车辆主体")
private Integer vehicleBody;
}
@@ -29,8 +29,15 @@ public class Material {
private boolean codeManaged;
private String remark;
private BigDecimal weight;
private BigDecimal materialVolume;
private String materialContent;
private LocalDateTime createTime;
private LocalDateTime updateTime;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
// 私有构造方法
private Material(Long ownerId,
@@ -42,7 +49,9 @@ public class Material {
BigDecimal value,
boolean codeManaged,
BigDecimal weight,
String remark) {
BigDecimal materialVolume,
String materialContent,
String remark,String topOrganizationId,String organizationId ) {
validateRequiredFields( category, name, unit);
this.ownerId = ownerId;
this.shipper = shipper;
@@ -54,8 +63,12 @@ public class Material {
this.codeManaged = codeManaged;
this.remark = remark;
this.weight = weight;
this.materialVolume = materialVolume;
this.materialContent = materialContent;
this.createTime = LocalDateTime.now();
this.updateTime = LocalDateTime.now();
this.topOrganizationId = topOrganizationId;
this.organizationId = organizationId;
}
@@ -69,10 +82,13 @@ public class Material {
BigDecimal value,
boolean codeManaged,
BigDecimal weight,
String remark,
BigDecimal materialVolume,
String materialContent,
String remark,String topOrganizationId,String organizationId,
MaterialCodeGenerator codeGenerator) {
Material material = new Material(ownerId, shipper, category, name, model,
unit, value, codeManaged, weight,remark
unit, value, codeManaged, weight, materialVolume, materialContent, remark,
topOrganizationId,organizationId
);
material.materialCode = codeGenerator.generate();
return material;
@@ -86,7 +102,9 @@ public class Material {
BigDecimal value,
boolean codeManaged,
BigDecimal weight,
String remark) {
BigDecimal materialVolume,
String materialContent,
String remark,String topOrganizationId,String organizationId ) {
this.ownerId = ownerId;
this.shipper = shipper;
this.category = category;
@@ -94,10 +112,14 @@ public class Material {
this.model = model;
this.unit = unit;
this.weight = weight;
this.materialVolume = materialVolume;
this.materialContent = materialContent;
this.value = validateValue(value);
this.codeManaged = codeManaged;
this.remark = remark;
this.updateTime = LocalDateTime.now();
this.topOrganizationId = topOrganizationId;
this.organizationId = organizationId;
}
// 保留的核心校验
@@ -56,7 +56,7 @@ public interface MaterialRepository {
* @param size 每页大小
* @return 分页的物料数据
*/
IPage<Material> search(String shipper, String category, String name,String model,String materialCode,Boolean codeManaged,String remark,
IPage<Material> search(String shipper, String category, String name,String model,String materialCode,Boolean codeManaged,String remark,String materialContent,
Long current, Long size);
/**
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@@ -33,4 +34,10 @@ public class MaterialDO {
@TableLogic
@TableField("is_deleted")
private Boolean deleted;
private BigDecimal materialVolume;
private String materialContent;
/**组织相关*/
private String topOrganizationId;
/**组织相关*/
private String organizationId;
}
@@ -58,7 +58,7 @@ public class MaterialRepositoryImpl implements MaterialRepository {
}
@Override
public IPage<Material> search(String shipper, String category, String name, String model,String materialCode,Boolean codeManaged,String remark,
public IPage<Material> search(String shipper, String category, String name, String model,String materialCode,Boolean codeManaged,String remark,String materialContent,
Long current, Long size) {
LambdaQueryWrapper<MaterialDO> wrapper = Wrappers.<MaterialDO>lambdaQuery()
.eq(StringUtils.isNotBlank(shipper), MaterialDO :: getShipper, shipper)
@@ -68,6 +68,7 @@ public class MaterialRepositoryImpl implements MaterialRepository {
.like(StringUtils.isNotBlank(materialCode), MaterialDO :: getMaterialCode, materialCode)
.eq(null!=codeManaged, MaterialDO :: getCodeManaged, codeManaged)
.like(StringUtils.isNotBlank(remark), MaterialDO :: getRemark, remark)
.like(StringUtils.isNotBlank(materialContent), MaterialDO :: getMaterialContent, materialContent)
.orderByDesc(MaterialDO :: getCreateTime);
return materialMapper.selectPage(new Page<>(current, size), wrapper)
@@ -413,4 +413,28 @@ public class VehicleDto extends BaseVOEntity implements Serializable
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date insuranceValidityPeriod;
@ApiModelProperty(value = "副驾1")
private String pilot1;
@ApiModelProperty(value = "副驾1的Id")
private String pilot1Id;
@ApiModelProperty(value = "副驾2")
private String pilot2;
@ApiModelProperty(value = "副驾2的Id")
private String pilot2Id;
@ApiModelProperty(value = "跨境车牌")
private String crossPlate;
@ApiModelProperty(value = "保险")
private String insurance;
@ApiModelProperty(value = "签证本")
private String visa;
@ApiModelProperty(value = "车辆主体")
private Integer vehicleBody;
}
@@ -65,6 +65,15 @@ public class VehicleApi extends BaseController
return getDataTable(list);
}
/**
* 车辆绑定副驾
*/
@Log(title = "车辆管理-车辆绑定副驾", description = "车辆绑定副驾", businessType = BusinessType.UPDATE)
@PostMapping("/bindVehicle")
public R<Integer> bindVehicle(@RequestBody VehicleDto vehicleDto){
return R.ok(vehicleApplicationService.updatePilotDriver(vehicleDto));
}
/**
* 查询未绑定车辆列表
*/
@@ -102,4 +102,16 @@ public class MaterialApi {
public R<MaterialVO> getMaterial(@PathVariable Long id) {
return R.ok(queryService.getMaterialDetail(id));
}
/**
* 获取订单选择货物详情(包含体积和物料内容)
*
* @param id 物料ID
* @return 物料详情,包含体积和物料内容字段
*/
@GetMapping("/forOrderSelection")
@Log(title = "物料管理(PC)", description = "TMS-订单选择货物详情", businessType = BusinessType.OTHER)
public R<MaterialVO> getMaterialsForOrderSelection(@RequestParam(name = "id") Long id) {
return R.ok(queryService.getMaterialDetail(id));
}
}
@@ -113,9 +113,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectVehicleVo">
SELECT
*
*
FROM
vehicle
</sql>
<select id="selectVehicleList" parameterType="com.linke.transport.domain.vehicle.repository.po.VehiclePo" resultMap="VehicleResult">
@@ -124,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
del_flag = 1
<if test="vehicleLicensePlateNumber != null and vehicleLicensePlateNumber != ''"> and vehicle_license_plate_number like concat('%', #{vehicleLicensePlateNumber}, '%')</if>
<if test="vehicleTypeId != null and vehicleTypeId != ''"> and vehicle_type_id = #{vehicleTypeId}</if>
<if test="vehicleBody != null and vehicleBody!='' "> and vehicle_body like concat('%', #{vehicleBody}, '%') </if>
<if test="vehicleSourceId != null and vehicleTypeId != ''"> and vehicle_source_id = #{vehicleSourceId}</if>
<if test="vehicleSource != null"> and vehicle_source = #{vehicleSource}</if>
<if test="trailerLicensePlateNumber != null and trailerLicensePlateNumber != ''"> and trailer_license_plate_number like concat('%', #{trailerLicensePlateNumber}, '%')</if>
@@ -643,6 +645,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where vehicle_id = #{item.vehicleId}
</foreach>
</update>
<update id="updatePilotDriver" parameterType="com.linke.transport.interfaces.dto.vehicle.VehicleDto">
UPDATE ngwl_test_transport.vehicle v
SET
<if test="pilot1Id != null and pilot1Id != ''">
v.pilot1_id = #{pilot1Id},
</if>
<if test="pilot1 != null and pilot1 != ''">
v.pilot1 = #{pilot1},
</if>
<if test="pilot2Id != null and pilot2Id != ''">
v.pilot2_id = #{pilot2Id},
</if>
<if test="pilot2 != null and pilot2 != ''">
v.pilot2 = #{pilot2},
</if>
v.update_time = NOW()
WHERE v.vehicle_id = #{vehicleId};
</update>
<delete id="deleteVehicleByVehicleId" parameterType="Long">
delete from vehicle where vehicle_id = #{vehicleId}
+1 -1
View File
@@ -38,7 +38,7 @@
<jjwt.version>0.9.1</jjwt.version>
<minio.version>8.2.2</minio.version>
<poi.version>4.1.2</poi.version>
<lombok.version>1.18.4</lombok.version>
<lombok.version>1.18.22</lombok.version>
<commons-collections.version>3.2.2</commons-collections.version>
<transmittable-thread-local.version>2.13.2</transmittable-thread-local.version>
<redisson.version>3.16.2</redisson.version>
+11
View File
@@ -0,0 +1,11 @@
-- 添加SYS_ORG_CODE字段
ALTER TABLE RECEIVING_ACCOUNT
ADD ORGANIZATION_ID VARCHAR(128);
-- 添加字段注释(备注)
COMMENT ON COLUMN RECEIVING_ACCOUNT.ORGANIZATION_ID IS '所属部门';
-- 添加SYS_ORG_CODE字段
ALTER TABLE RECEIVING_ACCOUNT
ADD TOP_ORGANIZATION_ID VARCHAR(128);
-- 添加字段注释(备注)
COMMENT ON COLUMN RECEIVING_ACCOUNT.TOP_ORGANIZATION_ID IS '所属部门';
+12
View File
@@ -0,0 +1,12 @@
-- 添加SYS_ORG_CODE字段
ALTER TABLE MATERIAL
ADD ORGANIZATION_ID VARCHAR(128);
-- 添加字段注释(备注)
COMMENT ON COLUMN MATERIAL.ORGANIZATION_ID IS '所属部门';
-- 添加SYS_ORG_CODE字段
ALTER TABLE MATERIAL
ADD TOP_ORGANIZATION_ID VARCHAR(128);
-- 添加字段注释(备注)
COMMENT ON COLUMN MATERIAL.TOP_ORGANIZATION_ID IS '所属部门';