tao.mo

为运单分配西门子用户

mt
2022年7月12日16:04:12
......@@ -18,8 +18,8 @@ public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, Jp
@Query(nativeQuery = true, value = "select * from t_au_user where login_name = ?1")
public List<SysUser> findByLoginName(String loginName);
@Query(nativeQuery = true, value = "select TOP 1 * from t_au_user where login_name = ?1 ")
public SysUser findByLoginName(String loginName);
/**
* 根据用户登录名list查询用户列表信息
......
......@@ -503,6 +503,13 @@ public class ChmConsignmentService {
//2、校验 7天+运单 ,如果有数据并且 还未报关就更新,如果数据就插入
ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(chmConsignment.getConsignmentCode(), DateUtils.addDate(DateUtils.getCurrentDate(),-7));
//获取用户账号信息
SysUser sysUser = sysUserRepository.findByLoginName("CUSTOMS");
//设置当前运单创建人ID
chmConsignment.setCreatorId(sysUser);
//设置创建人名称
chmConsignment.setCreator(sysUser.getUserName());
//3、新增或更新
//新增:如果没有就插入
if (Objects.equals(chmConsignmentDB,null)){
......@@ -538,6 +545,7 @@ public class ChmConsignmentService {
}
chmConsignment.setId(chmConsignmentDB.getId());
chmConsignment.setCreateTime(chmConsignmentDB.getCreateTime());
chmConsignment.setUpdateTime(pushTime);
ChmConsignment updateResult = this.saveChmConsignment(chmConsignment);
......
......@@ -48,7 +48,7 @@ public class SHA256Util {
}
public static void main(String[] args){
String secretKey = "BASFiClearExportC6db193cb4165a71b1582465812478";
String secretKey = "IDEiClearExport89b358b0cc07788c1654745105866";
String token = getSHA256String(secretKey);
System.out.println(token);
}
......