Browse Source

日志处理

guq 7 years ago
parent
commit
f33e9056fb

+ 52 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/config/WebConfig.java

@@ -0,0 +1,52 @@
+package com.usoftchina.saas.sale.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+
+/**
+ * @author: guq
+ * @create: 2018-10-30 11:20
+ **/
+
+@Configuration
+public class WebConfig extends WebMvcConfigurationSupport{
+    @Bean
+    public HttpMessageConverter<String> responseBodyConverter() {
+        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        return converter;
+    }
+
+    @Bean
+    public MappingJackson2HttpMessageConverter MappingJacksonHttpMessageConverter(){
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
+        converter.setObjectMapper(objectMapper);
+        return converter;
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        super.configureMessageConverters(converters);
+        converters.add(responseBodyConverter());
+        converters.add(MappingJacksonHttpMessageConverter());
+    }
+
+    @Override
+    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
+        configurer.favorPathExtension(false);
+    }
+
+}
+

+ 1 - 0
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -16,6 +16,7 @@
     <result column="sd_delivery" property="sd_delivery" jdbcType="TIMESTAMP" />
     <result column="sd_sendqty" property="sd_sendqty" jdbcType="DOUBLE" />
     <result column="sd_pdqty" property="sd_pdqty" jdbcType="DOUBLE" />
+    <result column="sd_yqty" property="sd_yqty" jdbcType="DOUBLE" />
     <result column="sd_remark" property="sd_remark" jdbcType="VARCHAR" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />