zelong.shao

customer|查询调整

......@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.WebApplicationInitializer;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
......@@ -13,6 +14,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@MapperScan({"com.fedex.connect.common.dao.*.**","com.fedex.connect.customer.repository.dao"})
@EnableTransactionManagement
@ComponentScan(basePackages = {"com.fedex.connect.common.dependencies.i18n", "com.fedex.connect.customer"})
@EnableSwagger2
public class CustomerApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
public static void main(String[] args) {
......
......@@ -34,6 +34,7 @@ public class ConsignmentControllerImpl extends AbstractEtController implements I
Long userId = null;
try {
userId = CurrentUserInfo.getUserId();
//userId = 0L;
} catch (Exception e) {
logger.error(LogShowModel.showException("Exception", e));
return ResponseResultVo.fail(localeMessageUtil.getMessage(ResponseCode.TOKEN_FORMAT_ERROR.getMsg()));
......
......@@ -18,6 +18,6 @@ public class ConsignmentExtRepositoryImpl extends BaseDao implements IConsignmen
@Override
public Long findAllCount(ConsignmentQuery query) {
return null;
return consignmentExtMapper.findAllCount(query);
}
}
......
......@@ -33,7 +33,7 @@ public class ConsignmentServiceImpl extends AbstractEtService implements IConsig
pageResult.setTotal(total);
pageResult.setPage(query.getPage());
pageResult.setSize(query.getSize());
if (total > 0) {
if (total != null && total > 0) {
List<Consignment> consignments = consignmentExtRepository.findConsignments(query);
pageResult.setList(consignments);
}
......
spring:
datasource:
url: jdbc:oracle:thin:@192.168.1.250:1521:orcl
username: icleartw
password: icleartw
username: iclearimp
password: iclearimp
driver-class-name: oracle.jdbc.OracleDriver
profiles:
#系统环境
......@@ -40,7 +40,7 @@ export:
resetpwd: { from: 'tao.mo@erry.com',password: 'xiaozhen!1'}
# propertyPath:
# redis: /opt/fedex/exporttw/redis/export-redis.properties
language: zh_TW
language: en_US
emailActiveTime: 60
upload:
......
......@@ -33,7 +33,7 @@ export:
mailAccountFlag: false
# propertyPath:
# redis: /opt/fedex/exporttw/redis/export-redis.properties
language: zh_TW
language: en_US
emailActiveTime: 60
upload:
......
......@@ -2,9 +2,10 @@ package com.fedex.connect.common.dao.log;
import com.fedex.connect.common.model.log.UserLoginInfo;
import com.fedex.connect.common.model.log.UserLoginInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface UserLoginInfoMapper {
long countByExample(UserLoginInfoExample example);
......
package com.fedex.connect.common.dependencies.i18n;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.LocaleResolver;
......@@ -19,25 +17,13 @@ public class MessageLocaleResolver implements LocaleResolver {
@Value("${export.language}")
private String exportTwLanguage;
/*private static final String I18N_LANGUAGE = "i18n_language";
private static final String I18N_LANGUAGE_SESSION = "i18n_language_session";*/
private Logger logger = LoggerFactory.getLogger(MessageLocaleResolver.class);
@Override
public Locale resolveLocale(HttpServletRequest request) {
Locale locale;
// String language = request.getParameter("I18N_LANGUAGE");
if (StringUtils.isNotEmpty(exportTwLanguage)) {
//获取知道配置文件中的语言为: exportTwLanguage;
locale = new Locale(exportTwLanguage);
/*//将国际化语言保存到session
HttpSession session = req.getSession();
session.setAttribute(I18N_LANGUAGE_SESSION, locale);*/
} else {
//如果没有带国际化参数,则判断session有没有保存,有保存,则使用保存的,也就是之前设置的,避免之后的请求不带国际化参数造成语言显示不对
/*HttpSession session = req.getSession();
Locale localeInSession = (Locale) session.getAttribute(I18N_LANGUAGE_SESSION);*/
//读取不到指定语言文件,采用默认中文。即默认的message.properties
locale = Locale.getDefault();
}
......