Commit b97783f1 by 焦凯

Merge branch 'develop' of gitlab.beecode.cn:kunlun/xyst_dinas/xyst_dinas_backend into develop

# Conflicts:
#	backend/inz.basis/src/main/java/com/beecode/inz/basis/web/WarehouseUserController.java
parents 9a05c7e5 469e247a
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_ID">
<display-name>inz.war</display-name>
<display-name>inz.platform.war</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
......
......@@ -53,9 +53,13 @@ import com.beecode.inz.authentication.handler.RESTAuthenticationEntryPoint;
import com.beecode.inz.authentication.handler.RESTAuthenticationFailureHandler;
import com.beecode.inz.authentication.handler.RESTAuthenticationSuccessHandler;
import com.beecode.inz.authentication.handler.RESTWarehouseUserAuthenticationSuccessHandler;
import com.beecode.inz.authentication.handler.SandUserAuthenticationSuccessHandler;
import com.beecode.inz.authentication.provider.AppUserAuthenticationProvider;
import com.beecode.inz.authentication.provider.SandUserAuthProvider;
import com.beecode.inz.authentication.provider.UserAuthenticationProvider;
import com.beecode.inz.authentication.provider.WarehouseUserAuthenticationProvider;
import com.beecode.inz.basis.context.sand.SandUserContextPersistenceFilter;
import com.beecode.inz.basis.context.sand.SandUserContextRepository;
import com.beecode.inz.basis.context.warehouse.WarehouseUserContextPersistenceFilter;
import com.beecode.inz.basis.context.warehouse.WarehouseUserContextRepository;
......@@ -115,6 +119,16 @@ public class SecurityConfig {
@Autowired
private WarehouseUserContextRepository warehouseUserContextRepository;
//采砂用户
@Autowired
private SandUserAuthenticationSuccessHandler sandUserAuthenticationSuccessHandler;
@Autowired
private SandUserAuthProvider sandUserAuthProvider;
@Autowired
private SandUserContextRepository sandUserContextRepository;
@Autowired
private RestLogoutHandler CLogoutHandler;
......@@ -240,7 +254,7 @@ public class SecurityConfig {
http.csrf().disable();
http.cors().disable();
http.antMatcher("/warehouse/**").authorizeRequests()
.antMatchers("/warehouse/user").permitAll()
// .antMatchers("/warehouse/user").permitAll()
.anyRequest().authenticated();
http.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint);
......@@ -252,8 +266,8 @@ public class SecurityConfig {
http.addFilterAfter(contextPersistenceFilter, SecurityContextPersistenceFilter.class);
http.addFilterAfter(new INZTenantAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
http.logout().logoutUrl("/logout")
http.logout().logoutUrl("/warehouse/logout")
.addLogoutHandler(logoutHandler).invalidateHttpSession(true)
.permitAll();
}
......@@ -266,6 +280,87 @@ public class SecurityConfig {
@Configuration
@Order(4)
public class SandUserSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
List<SessionAuthenticationStrategy> delegateStrategies = new ArrayList<SessionAuthenticationStrategy>();
delegateStrategies.add(concurrentSessionControlAuthenticationStrategy);
http.sessionManagement().maximumSessions(1);
http.csrf().disable();
http.cors().disable();
http.antMatcher("/sand/user/login").authorizeRequests().anyRequest().authenticated();
http.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint);
InzWebAuthenticationFilter filter = new InzWebAuthenticationFilter();
filter.setAuthenticationSuccessHandler(sandUserAuthenticationSuccessHandler);
filter.setAuthenticationFailureHandler(authenticationFailureHandler);
filter.setAuthenticationManager(authenticationManager());
filter.setSessionAuthenticationStrategy(new CompositeSessionAuthenticationStrategy(delegateStrategies));
RequestMatcher requestMatcher = new AntPathRequestMatcher("/sand/user/login", "POST");
filter.setRequiresAuthenticationRequestMatcher(requestMatcher);
http.addFilterAt(filter, UsernamePasswordAuthenticationFilter.class);
InzConcurrentSessionFilter inzConcurrentSessionFilter = new InzConcurrentSessionFilter(sessionRegistry) ;
http.addFilterAt(inzConcurrentSessionFilter, ConcurrentSessionFilter.class);
SandUserContextPersistenceFilter contextPersistenceFilter = new SandUserContextPersistenceFilter(metadataRuntime, sandUserContextRepository);
http.addFilterAfter(contextPersistenceFilter, SecurityContextPersistenceFilter.class);
http.addFilterAfter(new INZTenantAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(sandUserAuthProvider);
}
@Override
protected AuthenticationManager authenticationManager() throws Exception {
return super.authenticationManager();
}
}
@Configuration
@Order(5)
public class SandApiConfigurerAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
List<SessionAuthenticationStrategy> delegateStrategies = new ArrayList<SessionAuthenticationStrategy>();
delegateStrategies.add(concurrentSessionControlAuthenticationStrategy);
http.sessionManagement().maximumSessions(1);
http.csrf().disable();
http.cors().disable();
http.antMatcher("/sand/**").authorizeRequests()
.antMatchers("/sand/user").permitAll()
.anyRequest().authenticated();
http.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint);
InzConcurrentSessionFilter inzConcurrentSessionFilter = new InzConcurrentSessionFilter(sessionRegistry) ;
http.addFilterAt(inzConcurrentSessionFilter, ConcurrentSessionFilter.class);
SandUserContextPersistenceFilter contextPersistenceFilter = new SandUserContextPersistenceFilter(metadataRuntime, sandUserContextRepository);
http.addFilterAfter(contextPersistenceFilter, SecurityContextPersistenceFilter.class);
http.addFilterAfter(new INZTenantAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
http.logout().logoutUrl("/logout")
.addLogoutHandler(logoutHandler).invalidateHttpSession(true)
.permitAll();
}
@Override
protected AuthenticationManager authenticationManager() throws Exception {
return super.authenticationManager();
}
}
@Configuration
@Order(6)
public class WebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
......
......@@ -20,9 +20,11 @@ import com.beecode.inz.authentication.handler.RESTAuthenticationEntryPoint;
import com.beecode.inz.authentication.handler.RESTAuthenticationFailureHandler;
import com.beecode.inz.authentication.handler.RESTAuthenticationSuccessHandler;
import com.beecode.inz.authentication.handler.RESTWarehouseUserAuthenticationSuccessHandler;
import com.beecode.inz.authentication.handler.SandUserAuthenticationSuccessHandler;
import com.beecode.inz.authentication.internal.service.SMSsendingCustomerServiceImpl;
import com.beecode.inz.authentication.internal.service.SMSsendingServiceImpl;
import com.beecode.inz.authentication.provider.AppUserAuthenticationProvider;
import com.beecode.inz.authentication.provider.SandUserAuthProvider;
import com.beecode.inz.authentication.provider.WarehouseUserAuthenticationProvider;
import com.beecode.inz.authentication.service.SMSsendingCustomerService;
import com.beecode.inz.authentication.service.SMSsendingService;
......@@ -122,4 +124,13 @@ public class AuthenticationConfiguration {
return new WarehouseUserAuthenticationProvider();
}
@Bean
public SandUserAuthProvider sandUserAuthProvider() {
return new SandUserAuthProvider();
}
@Bean
public SandUserAuthenticationSuccessHandler sandUserAuthenticationSuccessHandler() {
return new SandUserAuthenticationSuccessHandler();
}
}
package com.beecode.inz.authentication.handler;
import java.io.IOException;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.beecode.inz.authentication.constants.AuthcConstants;
import com.beecode.inz.authentication.constants.LoginLogConstants;
import com.beecode.inz.authentication.constants.TenantUserConstants;
import com.beecode.inz.authentication.datamodel.LoginLog;
import com.beecode.inz.authentication.enumeration.LoginModeEnum;
import com.beecode.inz.authentication.enumeration.LoginStateEnum;
import com.beecode.inz.authentication.enumeration.LoginTerminalEnum;
import com.beecode.inz.authentication.service.LoginLogService;
import com.beecode.inz.authentication.util.LoginLogUtil;
import com.beecode.inz.basis.pojo.SandUser;
/**
* 处理采砂用户登录成功后的返回
*
* @author Jackpot
* @date 2021年3月19日
*/
@Component
public class SandUserAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
@Autowired
private LoginLogService loginLogService;
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
clearAuthenticationAttributes(request);
LoginLog loginLog = getLoginLog(request);
try {
String tenant = request.getParameter(AuthcConstants.TENANT);
SandUser SandUser = (SandUser) authentication.getPrincipal();
if (SandUser != null) {
JSONObject returnJson = new JSONObject();
request.getSession().setAttribute(AuthcConstants.SESSION_TENANTID, tenant);
request.getSession().setAttribute(AuthcConstants.USERID, SandUser.getId());
request.getSession().setAttribute(AuthcConstants.USERNAME, SandUser.getUsername());
request.getSession().setAttribute(AuthcConstants.TELEPHONE, SandUser.getTelephone());
request.getSession().setAttribute("mobile", true);
request.getSession().setMaxInactiveInterval(30 * 24 * 60 * 60);
loginLog.setTenantId(tenant);
loginLog.setDescription("SandUser login");
loginLogService.insert(loginLog);
ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
returnJson.put(AuthcConstants.USERID, SandUser.getId());
returnJson.put(AuthcConstants.USERNAME, SandUser.getUsername());
returnJson.put(AuthcConstants.TELEPHONE, SandUser.getTelephone());
returnJson.put(AuthcConstants.MESSAGE, "success");
returnJson.put(AuthcConstants.TOKEN, attr.getSessionId());
returnJson.put(AuthcConstants.TENANT, tenant);
response.getWriter().append(returnJson.toString());
}
} catch (IOException e) {
e.printStackTrace();
} finally {
}
}
public LoginLog getLoginLog(HttpServletRequest request) {
LoginLog loginLog = new LoginLog();
String userAgent = request.getHeader(LoginLogConstants.USER_AGENT);
if (userAgent.contains(LoginLogConstants.WINDOWS)) {
loginLog.setLoginTerminal(LoginTerminalEnum.WEB.getValue());
} else if (userAgent.contains(LoginLogConstants.ANDROID)) {
loginLog.setLoginTerminal(LoginTerminalEnum.ANDROID.getValue());
} else if (userAgent.contains(LoginLogConstants.IOS)) {
loginLog.setLoginTerminal(LoginTerminalEnum.ISO.getValue());
} else {
loginLog.setLoginTerminal(LoginTerminalEnum.WEB.getValue());
}
loginLog.setAccountNumber(request.getParameter(TenantUserConstants.USERNAME));
loginLog.setLoginMode(request.getParameter(TenantUserConstants.USERNAME) == null
? LoginModeEnum.QRCODELODIN.getValue() : LoginModeEnum.USERNAMEPASSWORD.getValue());
loginLog.setIp(LoginLogUtil.getClientIp(request));
loginLog.setLoginTime(new Date());
loginLog.setLoginState(LoginStateEnum.SUCCESS.getValue());
return loginLog;
}
}
package com.beecode.inz.authentication.provider;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.crypto.password.PasswordEncoder;
import com.beecode.inz.basis.pojo.SandUser;
import com.beecode.inz.basis.service.SandUserService;
/**
* 采砂用户验证器
*
* @author Jackpot
* @date 2021年3月19日
*/
public class SandUserAuthProvider implements AuthenticationProvider {
@Autowired
SandUserService sandUserService;
@Autowired
private PasswordEncoder passwordEncoder;
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
String username = authentication.getName();
String passWord = (String) authentication.getCredentials();
SandUser sandUser = sandUserService.getByUsername(username);
if(null == sandUser) {
throw new BadCredentialsException("用户名或密码错误!");
}
String pwd = sandUser.getPassword();
if (!passwordEncoder.matches(passWord, pwd)) {
throw new BadCredentialsException("密码错误!");
}
List<SimpleGrantedAuthority> roleList = new ArrayList<SimpleGrantedAuthority>();
return new UsernamePasswordAuthenticationToken(sandUser, passWord, roleList);
}
@Override
public boolean supports(Class<?> authentication) {
return authentication != null && authentication == UsernamePasswordAuthenticationToken.class;
}
}
......@@ -4,17 +4,22 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.beecode.inz.basis.context.sand.SandUserContextRepository;
import com.beecode.inz.basis.dao.CustomerDao;
import com.beecode.inz.basis.dao.WarehouseUserDao;
import com.beecode.inz.basis.handler.SMSsnedHandlers;
import com.beecode.inz.basis.internal.dao.CustomerDaoImpl;
import com.beecode.inz.basis.internal.dao.SandUserDaoImpl;
import com.beecode.inz.basis.internal.dao.WarehouseUserDaoImpl;
import com.beecode.inz.basis.internal.service.CustomerServiceImpl;
import com.beecode.inz.basis.internal.service.SandUserServiceImpl;
import com.beecode.inz.basis.internal.service.WarehouseUserServiceImpl;
import com.beecode.inz.basis.service.CustomerService;
import com.beecode.inz.basis.service.SandUserService;
import com.beecode.inz.basis.service.WarehouseUserService;
import com.beecode.inz.basis.sms.internal.SMSsendingServiceImpl;
import com.beecode.inz.basis.sms.service.SMSsendingService;
import com.beecode.inz.basis.web.SandUserController;
import com.beecode.inz.basis.web.WarehouseUserController;
@Configuration
......@@ -56,5 +61,25 @@ public class CommonConfig {
return new WarehouseUserController();
}
//采砂用户服务Bean
@Bean
public SandUserService sandUserService() {
return new SandUserServiceImpl();
}
@Bean
public SandUserDaoImpl sandUserDao() {
return new SandUserDaoImpl();
}
@Bean
public SandUserController sandUserController() {
return new SandUserController();
}
@Bean
public SandUserContextRepository sandUserContextRepository() {
return new SandUserContextRepository();
}
//end
}
package com.beecode.inz.basis.config.constants;
public class CommonBaseConst {
//数据模型元数据
public static final String BASE_INFO_ENTITY = "com.beecode.inz.common.datamodel.BaseInfo";
//员工元数据
public static final String STAFF_ENTITY = "com.beecode.bap.staff.datamodel.Staff";
public static final String ID = "id";
public static final String VERSION = "version";
public static final String CODE = "code";
public static final String NAME = "name";
public static final String TITLE = "title";
public static final String CREATOR = "creator";
public static final String CREATE_TIME = "createTime";
public static final String MODIFIER = "modifier";
public static final String MODIFY_TIME = "modifyTime";
public static final String APPROVAL_STATE = "approvalState";
public static final String STATE = "state";
public static final String DISCARD = "discard";
}
package com.beecode.inz.basis.config.constants;
public class SandUserConstants extends CommonBaseConst{
public static final String ENTITY = "com.beecode.inz.basis.datamodel.SandUser";
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String TYPE = "type";
public static final String ORG = "org";
public static final String PATH = "path";
public static final String ROLE = "role";
public static final String CONFIG = "config";
public static final String DESCRIPTION = "description";
public static final String TELEPHONE = "telephone";
public static final String ENABLED = "enabled";
}
......@@ -5,6 +5,7 @@ public interface WarehouseUserConstants extends CommonConstants{
String USERNAME = "username";
String PASSWORD = "password";
String TYPE = "type";
String STATION_ID = "stationId";
String ORG = "org";
String PATH = "path";
String ROLE = "role";
......
<model>
<header>
<type>bcp.type.DataModel</type>
<package>com.beecode.inz.basis.datamodel</package>
<title>采砂用户</title>
<name>SandUser</name>
<tags></tags>
<description></description>
<templateName>mk.ide.ui.editor.data.model.template.common</templateName>
<tablePrefix>xyst_dinas_</tablePrefix>
</header>
<content>
<dataModel id='2ea32765-853e-11eb-b258-54ee750ba988' multiVersion='undefined' domainInherit='undefined' tableName='xyst_dinas_basis_sand_user'>
<attribute id='2ea327a9-853e-11eb-b258-54ee750ba9b2' name='id' columnName='id' title='id' type='uuid' default='' precision='' isArray='false'>
<annotation id='2ea327ad-853e-11eb-b258-54ee750ba9b2' attributeId='2ea327b1-853e-11eb-b258-54ee750ba9b2' name='length' value='undefined'></annotation>
<annotation id='2ea327b2-853e-11eb-b258-54ee750ba9b2' attributeId='2ea327b4-853e-11eb-b258-54ee750ba9b2' name='unique' value='false'></annotation>
</attribute>
<attribute id='49a99e2e-853e-11eb-b258-54ee750ba9b2' name='username' columnName='username' title='用户名' type='string' default='' precision='' isArray='false'>
<annotation id='49a99e31-853e-11eb-b258-54ee750ba9b2' attributeId='49a99e35-853e-11eb-b258-54ee750ba9b2' name='length' value='50'></annotation>
</attribute>
<attribute id='49a99e36-853e-11eb-b258-54ee750ba9b2' name='password' columnName='password' title='密码' type='string' default='' precision='' isArray='false'>
<annotation id='49a99e39-853e-11eb-b258-54ee750ba9b2' attributeId='49a99e3a-853e-11eb-b258-54ee750ba9b2' name='length' value='100'></annotation>
</attribute>
<attribute id='6294310a-853e-11eb-b258-54ee750ba9b2' name='title' columnName='title' title='称呼' type='string' default='' precision='' isArray='false'>
<annotation id='62943111-853e-11eb-b258-54ee750ba9b2' attributeId='62943112-853e-11eb-b258-54ee750ba9b2' name='length' value='100'></annotation>
</attribute>
<attribute id='62943115-853e-11eb-b258-54ee750ba9b2' name='code' columnName='code' title='编号' type='string' default='' precision='' isArray='false'>
<annotation id='62943119-853e-11eb-b258-54ee750ba9b2' attributeId='6294311a-853e-11eb-b258-54ee750ba9b2' name='length' value='100'></annotation>
</attribute>
<attribute id='77aa55cb-853e-11eb-b258-54ee750ba9b2' name='type' columnName='type' title='用户类型' type='string' default='' precision='' isArray='false'>
<annotation id='77aa55d2-853e-11eb-b258-54ee750ba9b2' attributeId='77aa55d3-853e-11eb-b258-54ee750ba9b2' name='length' value='100'></annotation>
</attribute>
<attribute id='77aa55d6-853e-11eb-b258-54ee750ba9b2' name='telephone' columnName='telephone' title='手机号' type='string' default='' precision='' isArray='false'>
<annotation id='77aa55d7-853e-11eb-b258-54ee750ba9b2' attributeId='77aa55d8-853e-11eb-b258-54ee750ba9b2' name='length' value='20'></annotation>
</attribute>
<attribute id='8f8ad8b3-853e-11eb-b258-54ee750ba9b2' name='org' columnName='org' title='所属组织' type='string' default='' precision='' isArray='false'>
<annotation id='8f8ad8b7-853e-11eb-b258-54ee750ba9b2' attributeId='8f8ad8bb-853e-11eb-b258-54ee750ba9b2' name='length' value='100'></annotation>
</attribute>
<attribute id="8f8ad8bc-853e-11eb-b258-54ee750ba9b2" name="path" columnName='path' title="组织路径" type="string" default="" precision="" isArray="false">
<annotation name="length" value="300" id="8f8ad8be-853e-11eb-b258-54ee750ba9b2" attributeId="8f8ad8bf-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id='a4f104b3-853e-11eb-b258-54ee750ba9b2' name='role' columnName='role' title='所属角色' type='string' default='' precision='' isArray='false'>
<annotation id='a4f104be-853e-11eb-b258-54ee750ba9b2' attributeId='a4f104bf-853e-11eb-b258-54ee750ba9b2' name='length' value='100'></annotation>
</attribute>
<attribute id='a4f104c2-853e-11eb-b258-54ee750ba9b2' name='config' columnName='config' title='用户配置' type='string' default='' precision='' isArray='false'>
<annotation id='a4f104c3-853e-11eb-b258-54ee750ba9b2' attributeId='a4f104c4-853e-11eb-b258-54ee750ba9b2' name='length' value='1000'></annotation>
</attribute>
<attribute id='ba5bb842-853e-11eb-b258-54ee750ba9b2' name='description' columnName='description' title='描述' type='string' default='' precision='' isArray='false'>
<annotation id='ba5bb84a-853e-11eb-b258-54ee750ba9b2' attributeId='ba5bb84e-853e-11eb-b258-54ee750ba9b2' name='length' value='1000'></annotation>
</attribute>
<attribute id='ba5bb84f-853e-11eb-b258-54ee750ba9b2' name='state' columnName='state' title='状态' type='string' default='' precision='' isArray='false'>
<annotation id='ba5bb850-853e-11eb-b258-54ee750ba9b2' attributeId='ba5bb851-853e-11eb-b258-54ee750ba9b2' name='length' value='50'></annotation>
</attribute>
<attribute id="d2e9cc29-853e-11eb-b258-54ee750ba9b2" name="discard" title="是否废弃" type="boolean" default="false" precision="" isArray="false">
<annotation name="length" value="undefined" id="d2e9cc35-853e-11eb-b258-54ee750ba9b2" attributeId="d2e9cc36-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id="11c46718-8540-11eb-b258-54ee750ba9b2" name="enabled" title="是否启用" type="boolean" default="false" precision="" isArray="false">
<annotation name="length" value="undefined" id="11c46720-8540-11eb-b258-54ee750ba9b2" attributeId="11c46721-8540-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id="d2e9cc39-853e-11eb-b258-54ee750ba9b2" name="version" title="version" type="int" default="" precision="" isArray="false">
<annotation name="length" value="undefined" id="d2e9cc3c-853e-11eb-b258-54ee750ba9b2" attributeId="d2e9cc40-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id="e955bd08-853e-11eb-b258-54ee750ba9b2" name="creator" title="创建人" type="com.beecode.bap.staff.datamodel.Staff" default="" precision="" isArray="false">
<annotation name="length" value="undefined" id="e955bd14-853e-11eb-b258-54ee750ba9b2" attributeId="e955bd15-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id="e955bd18-853e-11eb-b258-54ee750ba9b2" name="createTime" columnName='create_time' title="创建时间" type="datetime" default="" precision="" isArray="false">
<annotation name="length" value="undefined" id="e955bd19-853e-11eb-b258-54ee750ba9b2" attributeId="e955bd1b-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id="fd8dbf78-853e-11eb-b258-54ee750ba9b2" name="modifyTime" columnName='modify_time' title="最后修改时间" type="datetime" default="" precision="" isArray="false">
<annotation name="length" value="undefined" id="fd8dbf80-853e-11eb-b258-54ee750ba9b2" attributeId="fd8dbf81-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<attribute id="fd8dbf84-853e-11eb-b258-54ee750ba9b2" name="modifier" title="修改人" type="com.beecode.bap.staff.datamodel.Staff" default="" precision="" isArray="false">
<annotation name="length" value="undefined" id="fd8dbf85-853e-11eb-b258-54ee750ba9b2" attributeId="fd8dbf87-853e-11eb-b258-54ee750ba9b2"/>
</attribute>
<hibernate>/inz.basis/src/main/resources/config/SandUser.hbm.xml</hibernate>
</dataModel>
</content>
</model>
\ No newline at end of file
package com.beecode.inz.basis.context.sand;
import java.io.Serializable;
import com.beecode.inz.basis.pojo.SandUser;
/**
* 采砂用户上下文
*
* @author Jackpot
* @date 2021年3月19日
*/
public interface SandUserContext extends Serializable {
public SandUser getSandUser();
}
package com.beecode.inz.basis.context.sand;
public interface SandUserContextConstants {
/**
* 当前用户
*/
public String CURRENT_WAREHOUSE_USER = "currentSandUser";
}
package com.beecode.inz.basis.context.sand;
import org.springframework.util.Assert;
public class SandUserContextHolder {
private static final ThreadLocal<SandUserContext> contextHolder = new ThreadLocal<SandUserContext>();
/**
* Explicitly clears the context value from the current thread.
*/
public static void clearContext() {
contextHolder.remove();
}
/**
* Obtain the current <code>SecurityContext</code>.
*
* @return the security context (never <code>null</code>)
*/
public static SandUserContext getContext() {
SandUserContext ctx = contextHolder.get();
if (ctx == null) {
ctx = createEmptyContext();
contextHolder.set(ctx);
}
return ctx;
}
/**
* Associates a new <code>SecurityContext</code> with the current thread of
* execution.
*
* @param context
* the new <code>SecurityContext</code> (may not be
* <code>null</code>)
*/
public static void setContext(SandUserContext context) {
Assert.notNull(context, "Only non-null AminoContext instances are permitted");
contextHolder.set(context);
}
/**
* Delegates the creation of a new, empty context to the configured
* strategy.
*/
public static SandUserContext createEmptyContext() {
return new SandUserContextImpl();
}
}
package com.beecode.inz.basis.context.sand;
import com.beecode.inz.basis.pojo.SandUser;
public class SandUserContextImpl implements SandUserContext {
private static final long serialVersionUID = 7659762847744346459L;
private SandUser SandUser;
@Override
public SandUser getSandUser() {
return SandUser;
}
public void setSandUser(SandUser SandUser) {
this.SandUser = SandUser;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((SandUser == null) ? 0 : SandUser.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
SandUserContextImpl other = (SandUserContextImpl) obj;
if (SandUser == null) {
if (other.SandUser != null) {
return false;
}
} else if (!SandUser.equals(other.SandUser)) {
return false;
}
return true;
}
@Override
public String toString() {
return "SandUserContextImpl [SandUser=" + SandUser + "]";
}
}
package com.beecode.inz.basis.context.sand;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.security.web.context.HttpRequestResponseHolder;
import org.springframework.web.filter.GenericFilterBean;
import com.beecode.amino.metadata.runtime.MetadataRuntime;
public class SandUserContextPersistenceFilter extends GenericFilterBean {
static final String FILTER_APPLIED = "__sand_user_acpf_applied";
private final MetadataRuntime metadataRuntime;
private final SandUserContextRepository repo;
private boolean forceEagerSessionCreation = false;
public SandUserContextPersistenceFilter(MetadataRuntime metadataRuntime) {
this(metadataRuntime, new SandUserContextRepository());
}
public SandUserContextPersistenceFilter(MetadataRuntime metadataRuntime, SandUserContextRepository repo) {
this.metadataRuntime = metadataRuntime;
this.repo = repo;
}
/* (non-Javadoc)
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
if (request.getAttribute(FILTER_APPLIED) != null) {
// ensure that filter is only applied once per request
chain.doFilter(request, response);
return;
}
if (!metadataRuntime.isActive()) {
// TODO 元数据服务还没有启动好
return;
}
final boolean debug = logger.isDebugEnabled();
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
if (forceEagerSessionCreation) {
HttpSession session = request.getSession();
if (debug && session.isNew()) {
logger.debug("Eagerly created session: " + session.getId());
}
}
HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, response);
try {
SandUserContext contextBeforeChainExecution = repo.loadContext(holder);
SandUserContextHolder.setContext(contextBeforeChainExecution);
chain.doFilter(holder.getRequest(), holder.getResponse());
}
finally {
// Crucial removal of SecurityContextHolder contents - do this before anything
// else.
SandUserContextHolder.clearContext();
request.removeAttribute(FILTER_APPLIED);
if (debug) {
logger.debug("SandUserContextHolder now cleared, as request processing completed");
}
}
}
public void setForceEagerSessionCreation(boolean forceEagerSessionCreation) {
this.forceEagerSessionCreation = forceEagerSessionCreation;
}
}
package com.beecode.inz.basis.context.sand;
import javax.servlet.AsyncContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationTrustResolver;
import org.springframework.security.authentication.AuthenticationTrustResolverImpl;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.context.HttpRequestResponseHolder;
import org.springframework.security.web.util.OnCommittedResponseWrapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
import com.beecode.inz.basis.pojo.SandUser;
import com.beecode.inz.basis.service.SandUserService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class SandUserContextRepository {
@Autowired
private SandUserService SandUserService;
@Autowired
private ObjectMapper objectMapper;
public static final String WAREHOUSE_USER_CONTEXT_KEY = "WAREHOUSE_USER_CONTEXT";
protected final Log logger = LogFactory.getLog(this.getClass());
private final Object contextObject = SandUserContextHolder.createEmptyContext();
private boolean isServlet3 = ClassUtils.hasMethod(ServletRequest.class, "startAsync");
private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
@Transactional(readOnly=true)
public SandUserContext loadContext(HttpRequestResponseHolder requestResponseHolder) {
HttpServletRequest request = requestResponseHolder.getRequest();
HttpServletResponse response = requestResponseHolder.getResponse();
HttpSession httpSession = request.getSession(false);
SandUserContext context = generateNewContext(httpSession);
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && !trustResolver.isAnonymous(authentication)) {
SandUserContextImpl contextImpl = (SandUserContextImpl)context;
if(contextImpl.getSandUser() == null) {
loadContext(httpSession, contextImpl);
}
}
SaveToSessionResponseWrapper wrappedResponse = new SaveToSessionResponseWrapper(response, request, httpSession != null, context);
requestResponseHolder.setResponse(wrappedResponse);
if (isServlet3) {
requestResponseHolder.setRequest(new Servlet3SaveToSessionRequestWrapper(request, wrappedResponse));
}
return context;
}
public boolean containsContext(HttpServletRequest request) {
HttpSession session = request.getSession(false);
if (session == null) {
return false;
}
return session.getAttribute(WAREHOUSE_USER_CONTEXT_KEY) != null;
}
protected SandUserContext generateNewContext(HttpSession httpSession) {
return SandUserContextHolder.createEmptyContext();
}
/**
* 获取当前用户context
* @throws Exception
*/
private void loadContext(HttpSession httpSession, SandUserContextImpl contextImpl) {
if (null == httpSession) {
return;
}
SandUser SandUser = null;
String SandUserJsonObj = (String)httpSession.getAttribute(SandUserContextConstants.CURRENT_WAREHOUSE_USER);
if (StringUtils.isEmpty(SandUserJsonObj)) {
try {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if(null == authentication) {
return;
}
String userName = authentication.getName();
if(StringUtils.isEmpty(userName)) {
return;
}
SandUser = SandUserService.getByUsername(userName);
if(null == SandUser) {
throw new RuntimeException("not found SandUser#" + userName);
}
httpSession.setAttribute(SandUserContextConstants.CURRENT_WAREHOUSE_USER, objectMapper.writeValueAsString(SandUser));
} catch (JsonProcessingException e) {
e.printStackTrace();
}
} else if (SandUserJsonObj instanceof String) {
try {
SandUser = objectMapper.readValue(SandUserJsonObj, SandUser.class);
}catch(Exception e) {
e.printStackTrace();
httpSession.removeAttribute(SandUserContextConstants.CURRENT_WAREHOUSE_USER);
}
}
contextImpl.setSandUser(SandUser);
}
//~ Inner Classes ==================================================================================================
private static class Servlet3SaveToSessionRequestWrapper extends HttpServletRequestWrapper {
private final SaveToSessionResponseWrapper response;
public Servlet3SaveToSessionRequestWrapper(HttpServletRequest request, SaveToSessionResponseWrapper response) {
super(request);
this.response = response;
}
@Override
public AsyncContext startAsync() {
response.disableSaveOnResponseCommitted();
return super.startAsync();
}
@Override
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
throws IllegalStateException {
response.disableSaveOnResponseCommitted();
return super.startAsync(servletRequest, servletResponse);
}
}
final class SaveToSessionResponseWrapper extends OnCommittedResponseWrapper {
private final HttpServletRequest request;
private final boolean httpSessionExistedAtStartOfRequest;
public SaveToSessionResponseWrapper(HttpServletResponse response, HttpServletRequest request,
boolean httpSessionExistedAtStartOfRequest, SandUserContext context) {
super(response);
this.request = request;
this.httpSessionExistedAtStartOfRequest = httpSessionExistedAtStartOfRequest;
// this.contextBeforeExecution = context;
// this.authBeforeExecution = context.getAuthentication();
}
public void disableSaveOnResponseCommitted() {
disableOnResponseCommitted();
}
protected void saveContext(SandUserContext context) {
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
HttpSession httpSession = request.getSession(false);
// See SEC-776
if (authentication == null || trustResolver.isAnonymous(authentication)) {
if (logger.isDebugEnabled()) {
logger.debug(
"SandUserContext is empty or contents are anonymous - context will not be stored in HttpSession.");
}
if (httpSession != null) {
// SEC-1587 A non-anonymous context may still be in the
// session
// SEC-1735 remove if the contextBeforeExecution was not
// anonymous
httpSession.removeAttribute(WAREHOUSE_USER_CONTEXT_KEY);
}
return;
}
if (httpSession == null) {
httpSession = createNewSessionIfAllowed(context);
}
// If HttpSession exists, store current CustomerContext but only if
// it has
// actually changed in this thread (see SEC-37, SEC-1307, SEC-1528)
if (httpSession != null) {
// We may have a new session, so check also whether the context
// attribute
// is set SEC-1561
if (contextChanged(context) || httpSession.getAttribute(WAREHOUSE_USER_CONTEXT_KEY) == null) {
// httpSession.setAttribute(customerContextKey, context);
if (logger.isDebugEnabled()) {
logger.debug("SandUserContext '" + context + "' stored to HttpSession: '" + httpSession);
}
}
}
}
private boolean contextChanged(SandUserContext context) {
return true;
}
private HttpSession createNewSessionIfAllowed(SandUserContext context) {
if (httpSessionExistedAtStartOfRequest) {
return null;
}
// Generate a HttpSession only if we need to
if (contextObject.equals(context)) {
return null;
}
try {
return request.getSession(true);
} catch (IllegalStateException e) {
logger.warn("Failed to create a session, as response has been committed. Unable to store"
+ " SandUserContext.");
}
return null;
}
@Override
protected void onResponseCommitted() {
saveContext(SandUserContextHolder.getContext());
}
@Override
public final String encodeRedirectUrl(String url) {
return super.encodeURL(url);
}
}
}
package com.beecode.inz.basis.internal.dao;
import java.util.List;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Repository;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.config.constants.SandUserConstants;
@Repository
public class SandUserDaoImpl extends AbstractBaseDao {
@Autowired
private HibernateTemplate template;
@Override
protected HibernateTemplate getHibernateTemplate() {
return template;
}
@Override
protected String getModelName() {
return SandUserConstants.ENTITY;
}
public KObject findByUsernameOrTelephone(String username) {
return getHibernateTemplate().execute(session -> {
StringBuffer sql = new StringBuffer("FROM " + getModelName() + " WHERE username = :username OR telephone = :username ");
Query<KObject> query = session.createQuery(sql.toString(), KObject.class);
query.setParameter("username", username);
List<KObject> result = query.getResultList();
if(result != null && result.size() > 0) {
return result.get(0);
}
return null;
});
}
public List<KObject> listByUserName(String username) {
return listByAttributes(buildSingleMap(SandUserConstants.USERNAME, username));
}
public List<KObject> listByTelephone(String telephone) {
return listByAttributes(buildSingleMap(SandUserConstants.TELEPHONE, telephone));
}
}
package com.beecode.inz.basis.internal.service;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.transaction.Transactional;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.util.Assert;
import com.beecode.amino.core.Amino;
import com.beecode.bcp.core.context.AminoContextHolder;
import com.beecode.bcp.type.KClass;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.config.constants.SandUserConstants;
import com.beecode.inz.basis.internal.dao.SandUserDaoImpl;
import com.beecode.inz.basis.pojo.SandUser;
import com.beecode.inz.basis.service.SandUserService;
/**
* 采砂用户 service
*
* @author Jackpot
* @date 2021年3月19日
*/
@Transactional
public class SandUserServiceImpl implements SandUserService {
@Autowired
private PasswordEncoder passwordEncoder;
@Autowired
private SandUserDaoImpl dao;
@Override
public SandUser getById(UUID id) {
Assert.notNull(id, "'id' must be not null!");
KObject entity = dao.findById(id);
return SandUser.fromCustomerKObject(entity);
}
@Override
public SandUser getByUsernameOrTelephone(String userame) {
Assert.notNull(userame, "'userName' must be not null!");
KObject object = dao.findByUsernameOrTelephone(userame);
if (object != null) {
return SandUser.fromCustomerKObject(object);
}
return null;
}
@Override
public SandUser getByUsername(String userame) {
Assert.notNull(userame, "'userName' must be not null!");
List<KObject> list = dao.listByUserName(userame);
if (list != null && list.size() > 0) {
return SandUser.fromCustomerKObject(list.get(0));
}
return null;
}
@Override
public SandUser getByTelephone(String telephone) {
Assert.notNull(telephone, "'telephone' must be not null!");
List<KObject> list = dao.listByTelephone(telephone);
if (list != null && list.size() > 0) {
return SandUser.fromCustomerKObject(list.get(0));
}
return null;
}
@Override
public UUID create(SandUser SandUser) {
Assert.notNull(SandUser, "'SandUser' must be not null!");
Assert.notNull(SandUser.getUsername(), "'username' must be not null!");
Assert.notNull(SandUser.getTitle(), "'title' must be not null!");
Assert.notNull(SandUser.getPassword(), "'password' must be not null!");
if(SandUser.getId() == null) {
SandUser.setId(UUID.randomUUID());
}
SandUser.setState("NORMAL");
SandUser.setEnabled(true);
SandUser.setCreator(AminoContextHolder.getContext().getStaff());
if (SandUser.getCreateTime() == null) {
SandUser.setCreateTime(new Date());
}
//密码加密
SandUser.setPassword(passwordEncoder.encode(SandUser.getPassword()));
return dao.insert(beanToObject(SandUser));
}
public KObject beanToObject(SandUser SandUser){
KClass kclass = Amino.getApplicationMetadataContext().getBean(SandUserConstants.ENTITY, KClass.class);
KObject obj = kclass.newInstance();
obj.set(SandUserConstants.ID, SandUser.getId());
obj.set(SandUserConstants.USERNAME, SandUser.getUsername());
obj.set(SandUserConstants.PASSWORD, SandUser.getPassword());
obj.set(SandUserConstants.TITLE, SandUser.getTitle());
obj.set(SandUserConstants.CODE, SandUser.getCode());
obj.set(SandUserConstants.TYPE, SandUser.getType());
obj.set(SandUserConstants.TELEPHONE, SandUser.getTelephone());
obj.set(SandUserConstants.ORG, SandUser.getOrg());
obj.set(SandUserConstants.PATH, SandUser.getPath());
obj.set(SandUserConstants.ROLE, SandUser.getRole());
obj.set(SandUserConstants.CONFIG, SandUser.getConfig());
obj.set(SandUserConstants.DESCRIPTION, SandUser.getDescription());
obj.set(SandUserConstants.STATE, SandUser.getState());
obj.set(SandUserConstants.ENABLED, SandUser.isEnabled());
obj.set(SandUserConstants.CREATOR, SandUser.getCreator());
obj.set(SandUserConstants.CREATE_TIME, SandUser.getCreateTime());
obj.set(SandUserConstants.MODIFIER, SandUser.getModifier());
obj.set(SandUserConstants.MODIFY_TIME, SandUser.getModifyTime());
obj.set(SandUserConstants.VERSION, SandUser.getVersion());
return obj;
}
@Transactional
@Override
public void modify(SandUser SandUser) {
Assert.notNull(SandUser, "'SandUser' must be not null!");
Assert.notNull(SandUser.getId(), "'SandUser.id' must be not null!");
Assert.notNull(SandUser.getUsername(), "'SandUser.userName' must be not null!");
Assert.notNull(SandUser.getTitle(), "'SandUser.title' must be not null!");
Assert.notNull(SandUser.getCreateTime(), "'SandUser.createTime' must be not null!");
KObject entity = dao.findById(SandUser.getId());
if(entity != null) {
//赋值,更新
if(StringUtils.isNotBlank(SandUser.getUsername())) {
entity.set(SandUserConstants.USERNAME, SandUser.getUsername());
}
if(StringUtils.isNotBlank(SandUser.getTitle())) {
entity.set(SandUserConstants.TITLE, SandUser.getTitle());
}
if(StringUtils.isNotBlank(SandUser.getTelephone())) {
entity.set(SandUserConstants.TELEPHONE, SandUser.getTelephone());
}
if(StringUtils.isNotBlank(SandUser.getOrg())) {
entity.set(SandUserConstants.ORG, SandUser.getOrg());
}
if(StringUtils.isNotBlank(SandUser.getPath())) {
entity.set(SandUserConstants.PATH, SandUser.getPath());
}
if(StringUtils.isNotBlank(SandUser.getRole())) {
entity.set(SandUserConstants.ROLE, SandUser.getRole());
}
if(StringUtils.isNotBlank(SandUser.getDescription())) {
entity.set(SandUserConstants.DESCRIPTION, SandUser.getDescription());
}
if(StringUtils.isNotBlank(SandUser.getState())) {
entity.set(SandUserConstants.STATE, SandUser.getState());
}
if(StringUtils.isNotBlank(SandUser.getConfig())) {
entity.set(SandUserConstants.CONFIG, SandUser.getConfig());
}
if(SandUser.getModifier() != null) {
entity.set(SandUserConstants.MODIFIER, SandUser.getModifier());
}
entity.set(SandUserConstants.MODIFY_TIME, SandUser.getModifyTime());
dao.update(entity);
}
}
@Override
public void updatePassword(UUID id, String newPassword) {
Assert.notNull(id, "'id' must be not null!");
Assert.notNull(newPassword, "'newPassword' must be not null!");
KObject entity = dao.findById(id);
if(entity != null) {
//密码加密
entity.set(SandUserConstants.PASSWORD, passwordEncoder.encode(newPassword));
dao.update(entity);
}
}
}
......@@ -38,7 +38,7 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
public WarehouseUser getById(UUID id) {
Assert.notNull(id, "'id' must be not null!");
KObject entity = dao.findById(id);
return WarehouseUser.fromCustomerKObject(entity);
return WarehouseUser.fromKObject(entity);
}
@Override
......@@ -46,7 +46,7 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
Assert.notNull(userame, "'userName' must be not null!");
KObject object = dao.findByUsernameOrTelephone(userame);
if (object != null) {
return WarehouseUser.fromCustomerKObject(object);
return WarehouseUser.fromKObject(object);
}
return null;
}
......@@ -56,21 +56,32 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
Assert.notNull(userame, "'userName' must be not null!");
List<KObject> list = dao.listByUserName(userame);
if (list != null && list.size() > 0) {
return WarehouseUser.fromCustomerKObject(list.get(0));
return WarehouseUser.fromKObject(list.get(0));
}
return null;
}
@Transactional
@Override
public WarehouseUser getByTelephone(String telephone) {
Assert.notNull(telephone, "'telephone' must be not null!");
List<KObject> list = dao.listByTelephone(telephone);
if (list != null && list.size() > 0) {
return WarehouseUser.fromCustomerKObject(list.get(0));
return WarehouseUser.fromKObject(list.get(0));
}
return null;
}
/**
* 获取指定场站下所有用户
* @param stationId
* @return
*/
@Override
public List<KObject> getAllByStationId(UUID stationId) {
Assert.notNull(stationId, "'stationId' must be not null!");
List<KObject> list = dao.findAllByStationId(stationId);
return list;
}
@Transactional
@Override
......@@ -108,6 +119,7 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
obj.set(WarehouseUserConstants.CODE, warehouseUser.getCode());
obj.set(WarehouseUserConstants.TYPE, warehouseUser.getType());
obj.set(WarehouseUserConstants.TELEPHONE, warehouseUser.getTelephone());
obj.set(WarehouseUserConstants.STATION_ID, warehouseUser.getStationId());
obj.set(WarehouseUserConstants.ORG, warehouseUser.getOrg());
obj.set(WarehouseUserConstants.PATH, warehouseUser.getPath());
obj.set(WarehouseUserConstants.ROLE, warehouseUser.getRole());
......
package com.beecode.inz.basis.pojo;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.UUID;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.config.constants.SandUserConstants;
/**
* 采砂用户
*
* @author Jackpot
* @date 2021年3月19日
*/
public class SandUser implements UserDetails, Serializable {
private static final long serialVersionUID = -553263854279399734L;
/**
* 用户ID
*/
private UUID id;
/**
* 版本号
*/
private Long version;
/**
* 登录名
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 用户名称
*/
private String title;
/**
* 客户编码
*/
private String code;
/**
* 客户类型
*/
private String type;
/**
* 手机号
*/
private String telephone;
/**
* 所属组织
*/
private String org;
/**
* 组织路径
*/
private String path;
/**
* 所属角色
*/
private String role;
/**
* 用户配置
*/
private String config;
/**
* 描述
*/
private String description;
/**
* 状态
*/
private String state;
/**
* 是否可用
*/
private Boolean enabled;
/**
* 创建人
*/
private KObject creator;
/**
* 创建日期
*/
private Date createTime;
/**
* 修改日期
*/
private Date modifyTime;
/**
* 修改人
*/
private KObject modifier;
public SandUser() {
}
public static SandUser fromCustomerKObject(KObject object) {
try {
SandUser model = new SandUser();
model.setId(object.getUuid(SandUserConstants.ID));
model.setVersion(object.getLong(SandUserConstants.VERSION));
model.setUsername(object.getString(SandUserConstants.USERNAME));
model.setPassword(object.getString(SandUserConstants.PASSWORD));
model.setTitle(object.getString(SandUserConstants.TITLE));
model.setCode(object.getString(SandUserConstants.CODE));
model.setType(object.getString(SandUserConstants.TYPE));
model.setTelephone(object.getString(SandUserConstants.TELEPHONE));
model.setOrg(object.getString(SandUserConstants.ORG));
model.setPath(object.getString(SandUserConstants.PATH));
model.setRole(object.getString(SandUserConstants.ROLE));
model.setDescription(object.getString(SandUserConstants.DESCRIPTION));
model.setState(object.getString(SandUserConstants.STATE));
model.setConfig(object.getString(SandUserConstants.CONFIG));
model.setEnabled(object.getBoolean(SandUserConstants.ENABLED));
model.setCreateTime(object.getDate(SandUserConstants.CREATE_TIME));
model.setCreator(object.get(SandUserConstants.MODIFIER).isNull() ? null : object.get(SandUserConstants.CREATOR));
model.setModifyTime(object.getDate(SandUserConstants.MODIFY_TIME));
model.setModifier(object.get(SandUserConstants.MODIFIER).isNull() ? null : object.get(SandUserConstants.MODIFIER));
return model;
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return new ArrayList<SimpleGrantedAuthority>();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return !getEnabled();
}
@Override
public boolean isCredentialsNonExpired() {
return false;
}
@Override
public boolean isEnabled() {
return this.enabled != null ? this.enabled : false ;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getOrg() {
return org;
}
public void setOrg(String org) {
this.org = org;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getConfig() {
return config;
}
public void setConfig(String config) {
this.config = config;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public KObject getCreator() {
return creator;
}
public void setCreator(KObject creator) {
this.creator = creator;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public KObject getModifier() {
return modifier;
}
public void setModifier(KObject modifier) {
this.modifier = modifier;
}
}
......@@ -65,6 +65,11 @@ public class WarehouseUser implements UserDetails, Serializable {
private String telephone;
/**
* 所属场站id
*/
private UUID stationId;
/**
* 所属组织
*/
private String org;
......@@ -122,7 +127,7 @@ public class WarehouseUser implements UserDetails, Serializable {
}
public static WarehouseUser fromCustomerKObject(KObject object) {
public static WarehouseUser fromKObject(KObject object) {
try {
WarehouseUser model = new WarehouseUser();
model.setId(object.getUuid(WarehouseUserConstants.ID));
......@@ -133,6 +138,7 @@ public class WarehouseUser implements UserDetails, Serializable {
model.setCode(object.getString(WarehouseUserConstants.CODE));
model.setType(object.getString(WarehouseUserConstants.TYPE));
model.setTelephone(object.getString(WarehouseUserConstants.TELEPHONE));
model.setStationId(object.getUuid(WarehouseUserConstants.STATION_ID));
model.setOrg(object.getString(WarehouseUserConstants.ORG));
model.setPath(object.getString(WarehouseUserConstants.PATH));
model.setRole(object.getString(WarehouseUserConstants.ROLE));
......@@ -241,6 +247,14 @@ public class WarehouseUser implements UserDetails, Serializable {
this.telephone = telephone;
}
public UUID getStationId() {
return stationId;
}
public void setStationId(UUID stationId) {
this.stationId = stationId;
}
public String getOrg() {
return org;
}
......
package com.beecode.inz.basis.service;
import java.util.UUID;
import com.beecode.inz.basis.pojo.SandUser;
/**
* 采砂用户服务
*
* @author Jackpot
* @date 2021年3月19日
*/
public interface SandUserService {
/**
* 创建客户
* @param SandUser
* @return
*/
UUID create(SandUser SandUser);
/**
* 根据电话获取客户
* @param telephone
* @return
*/
SandUser getByTelephone(String telephone);
/**
* 根据用户名获取客户
* @param userame
* @return
*/
SandUser getByUsername(String userame);
/**
* 根据id获取客户
* @param userame
* @return
*/
SandUser getById(UUID id);
SandUser getByUsernameOrTelephone(String userame);
/**
* 根据传参对每个字段进行识别更新,不包含id,code,createtime,version等字段
* @param SandUser
*/
void modify(SandUser SandUser);
/**
* 更新指定客户的密码
* @param id
* @param newPassword
*/
void updatePassword(UUID id, String newPassword);
}
package com.beecode.inz.basis.service;
import java.util.List;
import java.util.UUID;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.pojo.WarehouseUser;
/**
......@@ -54,4 +56,11 @@ public interface WarehouseUserService {
*/
void updatePassword(UUID id, String newPassword);
/**
* 获取指定场站下所有用户
* @param stationId
* @return
*/
List<KObject> getAllByStationId(UUID stationId);
}
package com.beecode.inz.basis.web;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
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;
import com.beecode.bcp.core.context.AminoContextHolder;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.basis.context.sand.SandUserContextHolder;
import com.beecode.inz.basis.context.warehouse.WarehouseUserContextHolder;
import com.beecode.inz.basis.pojo.SandUser;
import com.beecode.inz.basis.pojo.WarehouseUser;
import com.beecode.inz.basis.service.SandUserService;
import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.beecode.inz.basis.util.JsonUtil;
import com.beecode.xlib.utils.StringUtil;
/**
* 采砂用户
* @author Jackpot
*/
@RestController
@RequestMapping("/sand/user")
public class SandUserController {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private SandUserService sandUserService;
/**
* 创建采砂用户
*
* @param obj
* @return
*/
@PostMapping
public Object create(@RequestBody SandUser sandUser) {
try {
sandUserService.create(sandUser);
} catch(Exception e) {
logger.error("", e);
return ResponseObj.error(e.getMessage());
}
return ResponseObj.success("操作成功",null);
}
/**
* 创建采砂用户
*
* @param obj
* @return
*/
@PostMapping("/test")
public Object test() {
SandUser sandUser = SandUserContextHolder.getContext().getSandUser();
WarehouseUser user = WarehouseUserContextHolder.getContext().getWarehouseUser();
KObject staff = AminoContextHolder.getContext().getStaff();
return ResponseObj.success("操作成功",null);
}
}
package com.beecode.inz.basis.web;
import java.util.List;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -25,7 +30,6 @@ import com.beecode.xlib.utils.StringUtil;
*
*/
@RestController
@RequestMapping("/warehouse/user")
public class WarehouseUserController {
private static final Logger logger = LoggerFactory.getLogger(WarehouseUserController.class);
......@@ -35,11 +39,10 @@ public class WarehouseUserController {
/**
* 创建场站用户
*
* @param obj
* @return
*/
@PostMapping
@PostMapping("/warehouse/user")
public Object create(@RequestBody String body) {
if(StringUtil.isEmpty(body)) {
return ResponseObj.error("参数不能为空");
......@@ -58,6 +61,29 @@ public class WarehouseUserController {
return ResponseObj.success("操作成功",null);
}
/**
* 创建场站用户
* @param obj
* @return
*/
@GetMapping("/warehouse/user/station/{stationId}")
public Object getByStationId(@PathVariable(name="stationId") String stationId) {
if(StringUtil.isEmpty(stationId)) {
return ResponseObj.error("stationId不能为空");
}
try {
UUID id = UUID.fromString(stationId);
List<KObject> list = warehouseUserService.getAllByStationId(id);
return ResponseObj.success("操作成功", list);
} catch (IllegalArgumentException e) {
return ResponseObj.error("stationId错误");
} catch (Exception e) {
return ResponseObj.error("操作失败");
}
}
/**
* 创建场站用户
......@@ -65,7 +91,7 @@ public class WarehouseUserController {
* @param obj
* @return
*/
@PostMapping(value="test")
@PostMapping(value="/warehouse/user/test")
public Object test(@RequestBody String body) {
WarehouseUser user = WarehouseUserContextHolder.getContext().getWarehouseUser();
......@@ -79,7 +105,7 @@ public class WarehouseUserController {
* @return
* @throws Exception
*/
@RequestMapping(value ="/login/status",method = RequestMethod.GET)
@RequestMapping(value ="/warehouse/login/status",method = RequestMethod.GET)
public String loginState(){
return Integer.toString(HttpStatus.OK.value());
}
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-type">
<specification>1.0</specification>
<id>2ea32765-853e-11eb-b258-54ee750ba988</id>
<name>com.beecode.inz.basis.datamodel.SandUser</name>
<title>采砂用户</title>
<define>bcp.type.Class</define>
<define-version>1.0</define-version>
<dependency>bcp.type.constraint.StringLength</dependency>
<dependency>com.beecode.bap.staff.datamodel.Staff</dependency>
<content>
<m:class>
<m:parents/>
<m:attributes>
<m:attribute>
<m:annotations/>
<m:id>2ea327a9-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>id</m:name>
<m:title>id</m:title>
<m:type>uuid</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>50</m:value>
</m:annotation>
</m:annotations>
<m:id>49a99e2e-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>username</m:name>
<m:title>用户名</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
</m:annotations>
<m:id>49a99e36-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>password</m:name>
<m:title>密码</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
</m:annotations>
<m:id>6294310a-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>title</m:name>
<m:title>称呼</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
</m:annotations>
<m:id>62943115-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>code</m:name>
<m:title>编号</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
</m:annotations>
<m:id>77aa55cb-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>type</m:name>
<m:title>用户类型</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>20</m:value>
</m:annotation>
</m:annotations>
<m:id>77aa55d6-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>telephone</m:name>
<m:title>手机号</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
</m:annotations>
<m:id>8f8ad8b3-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>org</m:name>
<m:title>所属组织</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>300</m:value>
</m:annotation>
</m:annotations>
<m:id>8f8ad8bc-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>path</m:name>
<m:title>组织路径</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
</m:annotations>
<m:id>a4f104b3-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>role</m:name>
<m:title>所属角色</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>1000</m:value>
</m:annotation>
</m:annotations>
<m:id>a4f104c2-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>config</m:name>
<m:title>用户配置</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>1000</m:value>
</m:annotation>
</m:annotations>
<m:id>ba5bb842-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>description</m:name>
<m:title>描述</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>50</m:value>
</m:annotation>
</m:annotations>
<m:id>ba5bb84f-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>state</m:name>
<m:title>状态</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>d2e9cc29-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>discard</m:name>
<m:title>是否废弃</m:title>
<m:type>boolean</m:type>
<m:description></m:description>
<m:default>false</m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>11c46718-8540-11eb-b258-54ee750ba9b2</m:id>
<m:name>enabled</m:name>
<m:title>是否启用</m:title>
<m:type>boolean</m:type>
<m:description></m:description>
<m:default>false</m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>d2e9cc39-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>version</m:name>
<m:title>version</m:title>
<m:type>int</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>e955bd08-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>creator</m:name>
<m:title>创建人</m:title>
<m:type>com.beecode.bap.staff.datamodel.Staff</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>e955bd18-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>createTime</m:name>
<m:title>创建时间</m:title>
<m:type>datetime</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>fd8dbf78-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>modifyTime</m:name>
<m:title>最后修改时间</m:title>
<m:type>datetime</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>fd8dbf84-853e-11eb-b258-54ee750ba9b2</m:id>
<m:name>modifier</m:name>
<m:title>修改人</m:title>
<m:type>com.beecode.bap.staff.datamodel.Staff</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
</m:attributes>
</m:class>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping
http://www.hibernate.org/xsd/hibernate-mapping/hibernate-mapping-4.0.xsd">
<class entity-name="com.beecode.inz.basis.datamodel.SandUser" table="xyst_dinas_basis_sand_user" optimistic-lock="version">
<tuplizer entity-mode="dynamic-map" class="com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"/>
<id name="id" type="uuid-binary">
<column name="id" length="16"/>
<generator class="uuid2" />
</id>
<version name="version" type="long" column="version"></version>
<property name="username" type="string" >
<column name="username" length="50" unique="true"></column>
</property>
<property name="password" type="string" >
<column name="password" length="100"></column>
</property>
<property name="title" type="string" >
<column name="title" length="100"></column>
</property>
<property name="code" type="string" >
<column name="code" length="100" unique="true"></column>
</property>
<property name="type" type="string" >
<column name="type" length="100"></column>
</property>
<property name="telephone" type="string" >
<column name="telephone" length="20"></column>
</property>
<property name="org" type="string" >
<column name="org" length="100"></column>
</property>
<property name="path" type="string" >
<column name="path" length="100"></column>
</property>
<property name="role" type="string" >
<column name="role" length="100"></column>
</property>
<property name="config" type="text" >
<column name="config"></column>
</property>
<property name="description" type="text">
<column name="description" />
</property>
<property name="state" type="string" >
<column name="state" length="50"></column>
</property>
<property name="discard" type="boolean" >
<column name="discard" />
</property>
<property name="enabled" type="boolean" >
<column name="enabled" />
</property>
<property name="createTime" type="timestamp">
<column name="create_time" />
</property>
<many-to-one name="creator" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
<column name="creator_id" not-null="false"/>
</many-to-one>
<property name="modifyTime" type="timestamp">
<column name="modify_time" />
</property>
<many-to-one name="modifier" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
<column name="modifier_id" not-null="false"/>
</many-to-one>
</class>
</hibernate-mapping>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<<<<<<< HEAD
<id>7f76e0b6-30c6-4365-b7a8-ed44b83ac742</id>
=======
<id>2a96eab1-c316-400c-8dfe-73277f5a618e</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.biz.bill.Position$sequence</name>
<title>岗位$sequence</title>
<description>岗位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<<<<<<< HEAD
<id>4ab0c98c-a865-4cc5-aa98-65062df17a7e</id>
=======
<id>15a90012-30db-4266-b2dc-f05cac8f5865</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.biz.bill.Position$serial</name>
<title>岗位$serial</title>
<description>岗位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<<<<<<< HEAD
<id>33903504-3e8e-48a9-bdc3-05c7197f842c</id>
=======
<id>be913aae-6093-474c-b008-ba25211f107e</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.biz.bill.Position</name>
<title>岗位</title>
<description>岗位</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<<<<<<< HEAD
<id>e7136a79-9d58-4402-a53c-af0629a9b9a4</id>
=======
<id>61aee674-615d-4458-8f8d-c05110452d33</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.BusinessTripApply$sequence</name>
<title>出差申请$sequence</title>
<description>出差申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<<<<<<< HEAD
<id>55bb1063-d13c-4862-a854-cb60be8239d5</id>
=======
<id>79839413-2bfb-4318-a1eb-e7814f596d32</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.BusinessTripApply$serial</name>
<title>出差申请$serial</title>
<description>出差申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<<<<<<< HEAD
<id>ec447a08-5c30-4ecc-a85a-f277f50dbc4e</id>
=======
<id>49c6c36a-38a9-46b4-a84b-899535ce796b</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.BusinessTripApply</name>
<title>出差申请</title>
<description>出差申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<<<<<<< HEAD
<id>9409d229-d33b-433d-9e26-2633c863fea4</id>
=======
<id>322b4f87-72ba-4d4e-8455-512d61b449e1</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.ProtocolDocument$sequence</name>
<title>拟文$sequence</title>
<description>拟文</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<<<<<<< HEAD
<id>defcdd02-7707-4a13-a368-5d5d5080ee23</id>
=======
<id>b050fc3f-9e62-4dee-8e53-a1ab61737dde</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.ProtocolDocument$serial</name>
<title>拟文$serial</title>
<description>拟文</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<<<<<<< HEAD
<id>c6741756-a59b-448f-ba12-7573d0916500</id>
=======
<id>4c19c3a8-6955-4f7a-aa97-989e22b20ffe</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.ProtocolDocument</name>
<title>拟文</title>
<description>拟文</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<<<<<<< HEAD
<id>3a4943d0-5867-4e75-bd3a-4383cdbe177e</id>
=======
<id>5a583754-de0c-4884-a37e-613a82e0db8f</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.SealBorrow$sequence</name>
<title>证章借出$sequence</title>
<description>证章借出</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<<<<<<< HEAD
<id>a05be48f-04b2-4ce4-8479-6b72b61f60ad</id>
=======
<id>9311fb59-73d8-4241-a570-a962f280034f</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.SealBorrow$serial</name>
<title>证章借出$serial</title>
<description>证章借出</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<<<<<<< HEAD
<id>e37cda04-f87d-4654-9f21-584266c2943d</id>
=======
<id>e705d36c-0ca6-46be-9f89-48389d162e3e</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.SealBorrow</name>
<title>证章借出</title>
<description>证章借出</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<<<<<<< HEAD
<id>c9f4221c-5f56-43d8-bf3f-823fdee8e35a</id>
=======
<id>cf3798f9-c744-4ee5-afe5-52cf07e246cb</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.UseCarApply$sequence</name>
<title>用车申请$sequence</title>
<description>用车申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<<<<<<< HEAD
<id>13edff2f-bc4d-4041-9d09-2881245d1ccd</id>
=======
<id>8087d2fa-7450-4054-961e-01f5cc35b3c9</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.UseCarApply$serial</name>
<title>用车申请$serial</title>
<description>用车申请</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<<<<<<< HEAD
<id>4ede1d03-e4a0-4a64-836c-e6e9f8f203a3</id>
=======
<id>6f73f099-8c03-4ee5-80f3-527c0bd4ed37</id>
>>>>>>> e1eeb4e1cecf0ac7f3c02d6be14a7a3c953e6551
<name>com.xyst.dinas.oa.bill.UseCarApply</name>
<title>用车申请</title>
<description>用车申请</description>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment