├── order-api-server ├── src │ ├── main │ │ ├── webapp │ │ │ ├── index.jsp │ │ │ └── WEB-INF │ │ │ │ └── web.xml │ │ ├── resources │ │ │ ├── config.properties │ │ │ ├── log4j.xml │ │ │ ├── applicationContext-dubbo.xml │ │ │ ├── applicationContext.xml │ │ │ └── log4j.dtd │ │ └── java │ │ │ └── com │ │ │ └── cl │ │ │ └── order │ │ │ ├── api │ │ │ └── impl │ │ │ │ └── OrderBaseApiServiceImpl.java │ │ │ └── utils │ │ │ └── SpringContextHolder.java │ └── test │ │ ├── resources │ │ ├── config.properties │ │ └── applicationContext-test.xml │ │ └── java │ │ └── com │ │ └── cl │ │ └── order │ │ └── api │ │ └── impl │ │ └── test │ │ └── OrderBaseApiServiceImplTest.java └── pom.xml ├── order-server ├── src │ └── main │ │ ├── webapp │ │ ├── index.html │ │ ├── WEB-INF │ │ │ ├── ftl │ │ │ │ ├── footer.ftl │ │ │ │ ├── sidebar.ftl │ │ │ │ ├── header.ftl │ │ │ │ ├── modifypasswordform.ftl │ │ │ │ └── main.ftl │ │ │ ├── springmvc-servlet.xml │ │ │ └── web.xml │ │ └── scripts │ │ │ └── custom │ │ │ └── cl.js │ │ ├── resources │ │ ├── config.properties │ │ ├── cas-order.xml │ │ ├── applicationContext-dubbo.xml │ │ ├── log4j.xml │ │ ├── applicationContext.xml │ │ └── log4j.dtd │ │ └── java │ │ └── com │ │ └── cl │ │ └── order │ │ ├── utils │ │ ├── ConstantUtil.java │ │ ├── ConfigUtil.java │ │ ├── SessionUtil.java │ │ ├── SpringContextHolder.java │ │ ├── JsonUtil.java │ │ └── ReflectionUtil.java │ │ ├── interceptor │ │ └── OrderInterceptor.java │ │ └── controller │ │ └── IndexController.java └── pom.xml ├── order-api ├── src │ └── main │ │ └── java │ │ └── com │ │ └── cl │ │ └── order │ │ └── api │ │ └── IOrderBaseApiService.java └── pom.xml ├── order-data ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── cl │ │ │ └── order │ │ │ └── mapper │ │ │ ├── book │ │ │ ├── OrderLogMapper.java │ │ │ ├── OrderFormMapper.java │ │ │ ├── OrderDetailMapper.java │ │ │ ├── OrderPaymentMapper.java │ │ │ ├── OrderMainFormMapper.java │ │ │ └── OrderMainDetailMapper.java │ │ │ ├── base │ │ │ └── DictionaryMapper.java │ │ │ └── aftersales │ │ │ ├── AcceptLogMapper.java │ │ │ ├── RefundLogMapper.java │ │ │ ├── AcceptDetailMapper.java │ │ │ ├── AcceptFormMapper.java │ │ │ ├── RefundFormMapper.java │ │ │ └── ReturnPaymentMapper.java │ │ └── resources │ │ └── com │ │ └── cl │ │ └── order │ │ └── mapper │ │ ├── base │ │ └── DictionaryMapper.xml │ │ ├── book │ │ ├── OrderLogMapper.xml │ │ ├── OrderPaymentMapper.xml │ │ ├── OrderDetailMapper.xml │ │ └── OrderMainDetailMapper.xml │ │ └── aftersales │ │ ├── AcceptLogMapper.xml │ │ ├── RefundLogMapper.xml │ │ ├── ReturnPaymentMapper.xml │ │ └── RefundFormMapper.xml └── pom.xml ├── order-model ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── cl │ └── order │ └── model │ ├── base │ └── Dictionary.java │ ├── book │ ├── OrderLog.java │ ├── OrderPayment.java │ ├── OrderDetail.java │ ├── OrderMainDetail.java │ ├── OrderMainForm.java │ └── OrderForm.java │ └── aftersales │ ├── AcceptLog.java │ ├── RefundLog.java │ ├── ReturnPayment.java │ ├── RefundForm.java │ ├── AcceptDetail.java │ └── AcceptForm.java ├── .gitignore ├── order-schedule └── pom.xml ├── pom.xml ├── README.md ├── init_order.sql ├── init_order_privilege.sql └── config_order.xml /order-api-server/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /order-api-server/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | #ZooKeeper 2 | dubbo.registry.address=127.0.0.1:2181 3 | dubbo.registry.address.client=127.0.0.1:2181 -------------------------------------------------------------------------------- /order-api-server/src/test/resources/config.properties: -------------------------------------------------------------------------------- 1 | #ZooKeeper 2 | dubbo.registry.address=127.0.0.1:2181 3 | dubbo.registry.address.client=127.0.0.1:2181 -------------------------------------------------------------------------------- /order-server/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /order-api/src/main/java/com/cl/order/api/IOrderBaseApiService.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.api; 2 | 3 | import com.cl.order.model.base.Dictionary;; 4 | 5 | public interface IOrderBaseApiService { 6 | 7 | Dictionary getDictionaryById(Integer id); 8 | } 9 | -------------------------------------------------------------------------------- /order-api-server/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/ftl/footer.ftl: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /order-server/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | #CAS authentication address 2 | cas.server.url=http://127.0.0.1:8080/cas 3 | cas.service.url=http://127.0.0.1:10010/order-server 4 | 5 | #Base Path 6 | web.basepath=http://127.0.0.1:10010/order-server 7 | #Inc File Path 8 | inc.basepath=http://127.0.0.1/privilege_inc 9 | 10 | #ZooKeeper 11 | dubbo.registry.address=127.0.0.1:2181 12 | dubbo.registry.address.client=127.0.0.1:2181 -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/utils/ConstantUtil.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | public class ConstantUtil { 4 | 5 | public static final String Fail = "fail"; 6 | 7 | public static final String Success = "success"; 8 | 9 | public static final String Exists = "exists"; 10 | 11 | public static final String EmptyJsonObject = "{}"; 12 | 13 | public static final String DefaultMd5Password = "63a9f0ea7bb98050796b649e85481845"; //root 14 | } 15 | -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/book/OrderLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.book; 2 | 3 | import com.cl.order.model.book.OrderLog; 4 | 5 | public interface OrderLogMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(OrderLog record); 9 | 10 | int insertSelective(OrderLog record); 11 | 12 | OrderLog selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(OrderLog record); 15 | 16 | int updateByPrimaryKey(OrderLog record); 17 | } -------------------------------------------------------------------------------- /order-model/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | cl 5 | order 6 | 1.0.0-SNAPSHOT 7 | 8 | order-model 9 | order-model 10 | jar 11 | -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/base/DictionaryMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.base; 2 | 3 | import com.cl.order.model.base.Dictionary; 4 | 5 | public interface DictionaryMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(Dictionary record); 9 | 10 | int insertSelective(Dictionary record); 11 | 12 | Dictionary selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(Dictionary record); 15 | 16 | int updateByPrimaryKey(Dictionary record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/book/OrderFormMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.book; 2 | 3 | import com.cl.order.model.book.OrderForm; 4 | 5 | public interface OrderFormMapper { 6 | int deleteByPrimaryKey(String formCode); 7 | 8 | int insert(OrderForm record); 9 | 10 | int insertSelective(OrderForm record); 11 | 12 | OrderForm selectByPrimaryKey(String formCode); 13 | 14 | int updateByPrimaryKeySelective(OrderForm record); 15 | 16 | int updateByPrimaryKey(OrderForm record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/aftersales/AcceptLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.aftersales; 2 | 3 | import com.cl.order.model.aftersales.AcceptLog; 4 | 5 | public interface AcceptLogMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(AcceptLog record); 9 | 10 | int insertSelective(AcceptLog record); 11 | 12 | AcceptLog selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(AcceptLog record); 15 | 16 | int updateByPrimaryKey(AcceptLog record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/aftersales/RefundLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.aftersales; 2 | 3 | import com.cl.order.model.aftersales.RefundLog; 4 | 5 | public interface RefundLogMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(RefundLog record); 9 | 10 | int insertSelective(RefundLog record); 11 | 12 | RefundLog selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(RefundLog record); 15 | 16 | int updateByPrimaryKey(RefundLog record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/book/OrderDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.book; 2 | 3 | import com.cl.order.model.book.OrderDetail; 4 | 5 | public interface OrderDetailMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(OrderDetail record); 9 | 10 | int insertSelective(OrderDetail record); 11 | 12 | OrderDetail selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(OrderDetail record); 15 | 16 | int updateByPrimaryKey(OrderDetail record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/book/OrderPaymentMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.book; 2 | 3 | import com.cl.order.model.book.OrderPayment; 4 | 5 | public interface OrderPaymentMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(OrderPayment record); 9 | 10 | int insertSelective(OrderPayment record); 11 | 12 | OrderPayment selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(OrderPayment record); 15 | 16 | int updateByPrimaryKey(OrderPayment record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/aftersales/AcceptDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.aftersales; 2 | 3 | import com.cl.order.model.aftersales.AcceptDetail; 4 | 5 | public interface AcceptDetailMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(AcceptDetail record); 9 | 10 | int insertSelective(AcceptDetail record); 11 | 12 | AcceptDetail selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(AcceptDetail record); 15 | 16 | int updateByPrimaryKey(AcceptDetail record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/aftersales/AcceptFormMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.aftersales; 2 | 3 | import com.cl.order.model.aftersales.AcceptForm; 4 | 5 | public interface AcceptFormMapper { 6 | int deleteByPrimaryKey(String acceptCode); 7 | 8 | int insert(AcceptForm record); 9 | 10 | int insertSelective(AcceptForm record); 11 | 12 | AcceptForm selectByPrimaryKey(String acceptCode); 13 | 14 | int updateByPrimaryKeySelective(AcceptForm record); 15 | 16 | int updateByPrimaryKey(AcceptForm record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/aftersales/RefundFormMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.aftersales; 2 | 3 | import com.cl.order.model.aftersales.RefundForm; 4 | 5 | public interface RefundFormMapper { 6 | int deleteByPrimaryKey(String refundCode); 7 | 8 | int insert(RefundForm record); 9 | 10 | int insertSelective(RefundForm record); 11 | 12 | RefundForm selectByPrimaryKey(String refundCode); 13 | 14 | int updateByPrimaryKeySelective(RefundForm record); 15 | 16 | int updateByPrimaryKey(RefundForm record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/book/OrderMainFormMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.book; 2 | 3 | import com.cl.order.model.book.OrderMainForm; 4 | 5 | public interface OrderMainFormMapper { 6 | int deleteByPrimaryKey(String formCode); 7 | 8 | int insert(OrderMainForm record); 9 | 10 | int insertSelective(OrderMainForm record); 11 | 12 | OrderMainForm selectByPrimaryKey(String formCode); 13 | 14 | int updateByPrimaryKeySelective(OrderMainForm record); 15 | 16 | int updateByPrimaryKey(OrderMainForm record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/book/OrderMainDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.book; 2 | 3 | import com.cl.order.model.book.OrderMainDetail; 4 | 5 | public interface OrderMainDetailMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(OrderMainDetail record); 9 | 10 | int insertSelective(OrderMainDetail record); 11 | 12 | OrderMainDetail selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(OrderMainDetail record); 15 | 16 | int updateByPrimaryKey(OrderMainDetail record); 17 | } -------------------------------------------------------------------------------- /order-data/src/main/java/com/cl/order/mapper/aftersales/ReturnPaymentMapper.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.mapper.aftersales; 2 | 3 | import com.cl.order.model.aftersales.ReturnPayment; 4 | 5 | public interface ReturnPaymentMapper { 6 | int deleteByPrimaryKey(Integer id); 7 | 8 | int insert(ReturnPayment record); 9 | 10 | int insertSelective(ReturnPayment record); 11 | 12 | ReturnPayment selectByPrimaryKey(Integer id); 13 | 14 | int updateByPrimaryKeySelective(ReturnPayment record); 15 | 16 | int updateByPrimaryKey(ReturnPayment record); 17 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | .project 16 | /*/.project 17 | 18 | .classpath 19 | /*/.classpath 20 | 21 | .settings 22 | /*/.settings 23 | /*/.settings/* 24 | 25 | target 26 | /*/target 27 | /*/target/* 28 | 29 | .DS_Store 30 | 31 | .svn 32 | .svn/* 33 | 34 | .idea 35 | .idea/* 36 | 37 | Thumbs.db 38 | 39 | *.log 40 | *.out 41 | -------------------------------------------------------------------------------- /order-api-server/src/main/java/com/cl/order/api/impl/OrderBaseApiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.api.impl; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.cl.order.api.IOrderBaseApiService; 7 | import com.cl.order.mapper.base.DictionaryMapper; 8 | import com.cl.order.model.base.Dictionary; 9 | 10 | 11 | 12 | @Service 13 | public class OrderBaseApiServiceImpl implements IOrderBaseApiService { 14 | 15 | @Autowired 16 | private DictionaryMapper dictionaryMapper; 17 | 18 | @Override 19 | public Dictionary getDictionaryById(Integer id) { 20 | return dictionaryMapper.selectByPrimaryKey(id); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /order-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cl 7 | order 8 | 1.0.0-SNAPSHOT 9 | 10 | order-api 11 | order-api 12 | jar 13 | 14 | 15 | 16 | 17 | cl 18 | order-model 19 | 1.0.0-SNAPSHOT 20 | 21 | 22 | -------------------------------------------------------------------------------- /order-schedule/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cl 7 | order 8 | 1.0.0-SNAPSHOT 9 | 10 | order-schedule 11 | order-schedule 12 | jar 13 | 14 | 15 | 16 | 17 | cl 18 | order-model 19 | 1.0.0-SNAPSHOT 20 | 21 | 22 | -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/ftl/sidebar.ftl: -------------------------------------------------------------------------------- 1 | 2 |
3 | 24 |
25 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/utils/ConfigUtil.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ConfigUtil { 8 | 9 | private @Value("${cas.server.url}")String casServerUrl; 10 | private @Value("${cas.service.url}")String casServiceUrl; 11 | private @Value("${web.basepath}")String basePath; 12 | private @Value("${inc.basepath}")String incBasePath; 13 | 14 | public String getCasServerUrl() { 15 | return casServerUrl; 16 | } 17 | 18 | public String getCasServiceUrl() { 19 | return casServiceUrl; 20 | } 21 | 22 | public String getBasePath() { 23 | return basePath; 24 | } 25 | 26 | public String getIncBasePath() { 27 | return incBasePath; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/utils/SessionUtil.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import com.cl.privilege.model.User; 7 | 8 | 9 | public class SessionUtil { 10 | 11 | /** 12 | * 系统登录用户名 13 | */ 14 | public static final String SessionSystemLoginUserName = "SessionSystemLoginUserName"; 15 | 16 | /** 17 | * 清空session 18 | */ 19 | public static final void clearSession(HttpServletRequest request) 20 | { 21 | HttpSession session = request.getSession(); 22 | 23 | session.removeAttribute(SessionUtil.SessionSystemLoginUserName); 24 | 25 | session.invalidate();//非必须,单点登出接收到服务器消息时,会自动销毁session 26 | } 27 | 28 | /** 29 | * 返回session中的用户对象 30 | * @param request 31 | * @return 32 | */ 33 | public static final User getSessionUser(HttpServletRequest request) 34 | { 35 | return (User) request.getSession().getAttribute(SessionUtil.SessionSystemLoginUserName); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /order-data/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | cl 5 | order 6 | 1.0.0-SNAPSHOT 7 | 8 | order-data 9 | order-data 10 | jar 11 | 12 | 13 | 14 | 15 | cl 16 | order-model 17 | 1.0.0-SNAPSHOT 18 | 19 | 20 | 21 | org.mybatis 22 | mybatis 23 | 3.2.3 24 | 25 | 26 | org.mybatis 27 | mybatis-spring 28 | 1.2.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /order-api-server/src/test/java/com/cl/order/api/impl/test/OrderBaseApiServiceImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.api.impl.test; 2 | 3 | import org.junit.After; 4 | import org.junit.Before; 5 | import org.junit.BeforeClass; 6 | import org.junit.Test; 7 | import org.springframework.context.support.ClassPathXmlApplicationContext; 8 | 9 | import com.cl.order.api.impl.OrderBaseApiServiceImpl; 10 | import com.cl.order.model.base.Dictionary; 11 | 12 | public class OrderBaseApiServiceImplTest { 13 | 14 | private static OrderBaseApiServiceImpl service; 15 | 16 | @BeforeClass 17 | public static void setUpBeforeClass() throws Exception { 18 | ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext-test.xml"); 19 | service = (OrderBaseApiServiceImpl)ctx.getBean("orderBaseApiServiceImpl"); 20 | ctx.close(); 21 | } 22 | 23 | @Before 24 | public void setUp() throws Exception { 25 | } 26 | 27 | @After 28 | public void tearDown() throws Exception { 29 | } 30 | 31 | @Test 32 | public void getDictionaryById() { 33 | Dictionary dictionary = service.getDictionaryById(1); 34 | if(dictionary == null) 35 | { 36 | System.out.println("dictionary is null"); 37 | } else { 38 | System.out.println(dictionary.getName()); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /order-server/src/main/resources/cas-order.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /order-server/src/main/resources/applicationContext-dubbo.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Dubbo provider配置 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/utils/SpringContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | 7 | public class SpringContextHolder implements ApplicationContextAware { 8 | 9 | private static ApplicationContext applicationContext; 10 | 11 | public void setApplicationContext(ApplicationContext ac) 12 | { 13 | applicationContext = ac; 14 | } 15 | 16 | public static ApplicationContext getApplicationContext() 17 | { 18 | checkApplicationContext(); 19 | return applicationContext; 20 | } 21 | 22 | @SuppressWarnings("unchecked") 23 | public static T getBean(String name) 24 | { 25 | checkApplicationContext(); 26 | return (T) applicationContext.getBean(name); 27 | } 28 | 29 | public static T getBean(Class requiredType) 30 | { 31 | checkApplicationContext(); 32 | return applicationContext.getBean(requiredType); 33 | } 34 | 35 | public static void cleanApplicationContext() 36 | { 37 | applicationContext = null; 38 | } 39 | 40 | private static void checkApplicationContext() { 41 | if (applicationContext == null) 42 | throw new IllegalStateException("applicaitonContext未注入,请在applicationContext.xml中定义SpringContextHolder"); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /order-api-server/src/main/java/com/cl/order/utils/SpringContextHolder.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | 7 | public class SpringContextHolder implements ApplicationContextAware { 8 | 9 | private static ApplicationContext applicationContext; 10 | 11 | public void setApplicationContext(ApplicationContext ac) 12 | { 13 | applicationContext = ac; 14 | } 15 | 16 | public static ApplicationContext getApplicationContext() 17 | { 18 | checkApplicationContext(); 19 | return applicationContext; 20 | } 21 | 22 | @SuppressWarnings("unchecked") 23 | public static T getBean(String name) 24 | { 25 | checkApplicationContext(); 26 | return (T) applicationContext.getBean(name); 27 | } 28 | 29 | public static T getBean(Class requiredType) 30 | { 31 | checkApplicationContext(); 32 | return applicationContext.getBean(requiredType); 33 | } 34 | 35 | public static void cleanApplicationContext() 36 | { 37 | applicationContext = null; 38 | } 39 | 40 | private static void checkApplicationContext() { 41 | if (applicationContext == null) 42 | throw new IllegalStateException("applicaitonContext未注入,请在applicationContext.xml中定义SpringContextHolder"); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | cl 5 | order 6 | 1.0.0-SNAPSHOT 7 | pom 8 | order 9 | http://maven.apache.org 10 | 11 | 12 | order-model 13 | order-api 14 | order-data 15 | order-api-server 16 | order-server 17 | order-schedule 18 | 19 | 20 | 21 | 22 | junit 23 | junit 24 | 4.11 25 | test 26 | 27 | 28 | 29 | 30 | 31 | releases 32 | Cl Releases 33 | http://192.168.1.11:8081/nexus/content/repositories/releases 34 | 35 | 36 | snapshots 37 | Cl Snapshots 38 | http://192.168.1.11:8081/nexus/content/repositories/snapshots 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /order-server/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /order-api-server/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cl-order 2 | ================== 3 | 4 | 订单管理系统 5 | 6 | 7 | 一、前置项目依赖 8 | 9 | https://github.com/pumadong/cl-privilege 10 | 11 | 二、项目说明 12 | 13 | 订单中心,为网站下单提供接口,并基于多种维度提供订单查询,报表、导出功能。关于订单的售后,放在“客服中心”系统中。 14 | 15 | 订单中心,负责处理订单流程,及与订单流程紧密相关的各种行为的支持。 16 | 17 | 所有市场、销售行为,最终目标都是带来订单。 18 | 19 | 市场行为中的各大网站广告,网站联盟,线下发卡行为 的效果,以及网站中点击各个位置下得单,都会记录在订单表的来源中,并在BI之类系统中进行统计,进行效果分析。 20 | 21 | 订单的下单方式,记录在订单类型字段中,用来标记是通过网站、手机等渠道下单的。 22 | 23 | 当前的订单来源,绝大多数都是来源于互联网,这也是互联网极大迅速发展的结果;电子商务之初不是这样的,开始的时候呼叫中心是最大的订单来源。 24 | 25 | 三、项目功能 26 | 27 | 计划实现的订单中心功能单元如下: 28 | 29 | order-api-server:订单接口,对接其他系统 30 | 31 | order-schedule:订单自动化处理任务,比如:转有效、转无效等 32 | 33 | order-server:订单管理界面 34 | 35 | 订单中心相关IT功能的特点是:准确、实时性要求高,涉及的实时款项处理较多,涉及的业务逻辑较多,相对技术含量更少,这是个业务性更强的系统,当然,相对来说,后台相关的系统都是业务性强于技术性。 36 | 37 | 四、业务逻辑 38 | 39 | 分单:一般是按照库房+发货点/供应商进行分单,如果不分单,就要有库房之间的调拨,如何在客户体验和配送成本之间达到最佳平衡,是分单需要重点考虑的问题。 40 | 41 | 促销:各种各样的促销的伴随于订单流转中,下单就分摊到产品折扣中,利于后续的所有流程,因为促销是成本,会有各种核算,SVIP/VIP的折扣也归到这里来维护。 42 | 43 | 礼品卡/优惠劵:其实也是一种促销方式,其实际业务使用形式,各公司界定不相同。 44 | 45 | 抹零:方便配送上门收款,同时应尽量避免公司损失。 46 | 47 | 中间件:订单的自动化处理流程,例如各种根据库存的自动化处理,各种拦截及反拦截,流转过程中对用户友好而亲切的提醒。 48 | 49 | 中间件之对于于提高效率、减少成本非常关键,所谓“技术驱动”的公司,基本也反映在系统中各处中间件的强大程度吧。 50 | 51 | 五、mybatis-generator 52 | 53 | ORM框架采用MyBatis,为了提高开发效率,先根据数据库表单结构自动生成Model和MyBatis相关类,生成命令如下: 54 | 55 | java -jar mybatis-generator-core-1.3.1.jar -configfile config_order.xml -overwrite 56 | 57 | 生成时需要把mybatis-generator-core-1.3.1.jar、mysql-connector-java-5.1.24-bin.jar、config_order.xml放到一个目录下,生成的相关类和XML会放置到CreateResult文件夹下面。 58 | 59 | jar下载地址:http://pan.baidu.com/s/1qW98L0C -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/base/Dictionary.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.base; 2 | 3 | import java.util.Date; 4 | 5 | public class Dictionary { 6 | private Integer id; 7 | 8 | private String group; 9 | 10 | private Byte code; 11 | 12 | private String name; 13 | 14 | private Byte sortNo; 15 | 16 | private String createPerson; 17 | 18 | private Date createDate; 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 26 | } 27 | 28 | public String getGroup() { 29 | return group; 30 | } 31 | 32 | public void setGroup(String group) { 33 | this.group = group; 34 | } 35 | 36 | public Byte getCode() { 37 | return code; 38 | } 39 | 40 | public void setCode(Byte code) { 41 | this.code = code; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public Byte getSortNo() { 53 | return sortNo; 54 | } 55 | 56 | public void setSortNo(Byte sortNo) { 57 | this.sortNo = sortNo; 58 | } 59 | 60 | public String getCreatePerson() { 61 | return createPerson; 62 | } 63 | 64 | public void setCreatePerson(String createPerson) { 65 | this.createPerson = createPerson; 66 | } 67 | 68 | public Date getCreateDate() { 69 | return createDate; 70 | } 71 | 72 | public void setCreateDate(Date createDate) { 73 | this.createDate = createDate; 74 | } 75 | } -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/book/OrderLog.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.book; 2 | 3 | import java.util.Date; 4 | 5 | public class OrderLog { 6 | private Integer id; 7 | 8 | private String formCode; 9 | 10 | private Byte logTypeId; 11 | 12 | private String logContent; 13 | 14 | private String createPerson; 15 | 16 | private Date createDate; 17 | 18 | private String createIp; 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 26 | } 27 | 28 | public String getFormCode() { 29 | return formCode; 30 | } 31 | 32 | public void setFormCode(String formCode) { 33 | this.formCode = formCode; 34 | } 35 | 36 | public Byte getLogTypeId() { 37 | return logTypeId; 38 | } 39 | 40 | public void setLogTypeId(Byte logTypeId) { 41 | this.logTypeId = logTypeId; 42 | } 43 | 44 | public String getLogContent() { 45 | return logContent; 46 | } 47 | 48 | public void setLogContent(String logContent) { 49 | this.logContent = logContent; 50 | } 51 | 52 | public String getCreatePerson() { 53 | return createPerson; 54 | } 55 | 56 | public void setCreatePerson(String createPerson) { 57 | this.createPerson = createPerson; 58 | } 59 | 60 | public Date getCreateDate() { 61 | return createDate; 62 | } 63 | 64 | public void setCreateDate(Date createDate) { 65 | this.createDate = createDate; 66 | } 67 | 68 | public String getCreateIp() { 69 | return createIp; 70 | } 71 | 72 | public void setCreateIp(String createIp) { 73 | this.createIp = createIp; 74 | } 75 | } -------------------------------------------------------------------------------- /order-api-server/src/main/resources/applicationContext-dubbo.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Dubbo provider配置 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 32 | -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/aftersales/AcceptLog.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.aftersales; 2 | 3 | import java.util.Date; 4 | 5 | public class AcceptLog { 6 | private Integer id; 7 | 8 | private String acceptCode; 9 | 10 | private Byte logTypeId; 11 | 12 | private String logContent; 13 | 14 | private String createPerson; 15 | 16 | private Date createDate; 17 | 18 | private String createIp; 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 26 | } 27 | 28 | public String getAcceptCode() { 29 | return acceptCode; 30 | } 31 | 32 | public void setAcceptCode(String acceptCode) { 33 | this.acceptCode = acceptCode; 34 | } 35 | 36 | public Byte getLogTypeId() { 37 | return logTypeId; 38 | } 39 | 40 | public void setLogTypeId(Byte logTypeId) { 41 | this.logTypeId = logTypeId; 42 | } 43 | 44 | public String getLogContent() { 45 | return logContent; 46 | } 47 | 48 | public void setLogContent(String logContent) { 49 | this.logContent = logContent; 50 | } 51 | 52 | public String getCreatePerson() { 53 | return createPerson; 54 | } 55 | 56 | public void setCreatePerson(String createPerson) { 57 | this.createPerson = createPerson; 58 | } 59 | 60 | public Date getCreateDate() { 61 | return createDate; 62 | } 63 | 64 | public void setCreateDate(Date createDate) { 65 | this.createDate = createDate; 66 | } 67 | 68 | public String getCreateIp() { 69 | return createIp; 70 | } 71 | 72 | public void setCreateIp(String createIp) { 73 | this.createIp = createIp; 74 | } 75 | } -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/aftersales/RefundLog.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.aftersales; 2 | 3 | import java.util.Date; 4 | 5 | public class RefundLog { 6 | private Integer id; 7 | 8 | private String refundCode; 9 | 10 | private Byte logTypeId; 11 | 12 | private String logContent; 13 | 14 | private String createPerson; 15 | 16 | private Date createDate; 17 | 18 | private String createIp; 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 26 | } 27 | 28 | public String getRefundCode() { 29 | return refundCode; 30 | } 31 | 32 | public void setRefundCode(String refundCode) { 33 | this.refundCode = refundCode; 34 | } 35 | 36 | public Byte getLogTypeId() { 37 | return logTypeId; 38 | } 39 | 40 | public void setLogTypeId(Byte logTypeId) { 41 | this.logTypeId = logTypeId; 42 | } 43 | 44 | public String getLogContent() { 45 | return logContent; 46 | } 47 | 48 | public void setLogContent(String logContent) { 49 | this.logContent = logContent; 50 | } 51 | 52 | public String getCreatePerson() { 53 | return createPerson; 54 | } 55 | 56 | public void setCreatePerson(String createPerson) { 57 | this.createPerson = createPerson; 58 | } 59 | 60 | public Date getCreateDate() { 61 | return createDate; 62 | } 63 | 64 | public void setCreateDate(Date createDate) { 65 | this.createDate = createDate; 66 | } 67 | 68 | public String getCreateIp() { 69 | return createIp; 70 | } 71 | 72 | public void setCreateIp(String createIp) { 73 | this.createIp = createIp; 74 | } 75 | } -------------------------------------------------------------------------------- /init_order.sql: -------------------------------------------------------------------------------- 1 | #数据初始化-订单字典表 2 | truncate table o_dictionary; 3 | 4 | insert into `o_dictionary`(`group`,`code`,`name`,sort_no,create_person,create_date) 5 | values 6 | ('order_type',1,'销售',1,'system',now()), 7 | ('order_type',2,'换货',2,'system',now()), 8 | 9 | ('order_status',1,'已创建',1,'system',now()), 10 | ('order_status',2,'已审核',2,'system',now()), 11 | ('order_status',3,'已支付',3,'system',now()), 12 | ('order_status',4,'已打印',4,'system',now()), 13 | ('order_status',5,'已拣货',5,'system',now()), 14 | ('order_status',6,'已打包',6,'system',now()), 15 | ('order_status',7,'已出库',7,'system',now()), 16 | ('order_status',8,'已取消',8,'system',now()), 17 | 18 | 19 | ('payment_status',1,'未支付',1,'system',now()), 20 | ('payment_status',2,'部分支付',2,'system',now()), 21 | ('payment_status',3,'已支付',3,'system',now()), 22 | 23 | ('payment_type',1,'支付宝',1,'system',now()), 24 | ('payment_type',2,'财付通',2,'system',now()), 25 | 26 | ('deliver_type',1,'快递',1,'system',now()), 27 | ('deliver_type',2,'EMS',2,'system',now()), 28 | 29 | ('order_log_type',1,'支付',1,'system',now()), 30 | ('order_log_type',2,'取消',2,'system',now()), 31 | ('order_log_type',3,'订单自动转有效',3,'system',now()), 32 | ('order_log_type',4,'超时转缺库存',4,'system',now()), 33 | ('order_log_type',5,'缺库存手工转有效',5,'system',now()), 34 | 35 | ('return_type',1,'退货',1,'system',now()), 36 | ('return_type',2,'换货',2,'system',now()), 37 | 38 | ('accept_status',1,'刚录入',1,'system',now()), 39 | ('accept_status',2,'已完成',2,'system',now()), 40 | ('accept_status',3,'取消',3,'system',now()), 41 | 42 | ('accept_log_type',1,'创建',1,'system',now()), 43 | 44 | ('refund_type',1,'退款',1,'system',now()), 45 | ('refund_type',2,'运费报销',2,'system',now()), 46 | 47 | ('refund_status',1,'刚录入',1,'system',now()), 48 | ('refund_status',2,'财务已处理',2,'system',now()), 49 | ('refund_status',3,'取消',3,'system',now()), 50 | 51 | ('refund_log_type',1,'创建',1,'system',now()) 52 | ; -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/book/OrderPayment.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.book; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class OrderPayment { 7 | private Integer id; 8 | 9 | private String formCode; 10 | 11 | private Byte paymentTypeId; 12 | 13 | private String paymentTypeName; 14 | 15 | private BigDecimal paymentMoney; 16 | 17 | private String createPerson; 18 | 19 | private Date createDate; 20 | 21 | public Integer getId() { 22 | return id; 23 | } 24 | 25 | public void setId(Integer id) { 26 | this.id = id; 27 | } 28 | 29 | public String getFormCode() { 30 | return formCode; 31 | } 32 | 33 | public void setFormCode(String formCode) { 34 | this.formCode = formCode; 35 | } 36 | 37 | public Byte getPaymentTypeId() { 38 | return paymentTypeId; 39 | } 40 | 41 | public void setPaymentTypeId(Byte paymentTypeId) { 42 | this.paymentTypeId = paymentTypeId; 43 | } 44 | 45 | public String getPaymentTypeName() { 46 | return paymentTypeName; 47 | } 48 | 49 | public void setPaymentTypeName(String paymentTypeName) { 50 | this.paymentTypeName = paymentTypeName; 51 | } 52 | 53 | public BigDecimal getPaymentMoney() { 54 | return paymentMoney; 55 | } 56 | 57 | public void setPaymentMoney(BigDecimal paymentMoney) { 58 | this.paymentMoney = paymentMoney; 59 | } 60 | 61 | public String getCreatePerson() { 62 | return createPerson; 63 | } 64 | 65 | public void setCreatePerson(String createPerson) { 66 | this.createPerson = createPerson; 67 | } 68 | 69 | public Date getCreateDate() { 70 | return createDate; 71 | } 72 | 73 | public void setCreateDate(Date createDate) { 74 | this.createDate = createDate; 75 | } 76 | } -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/aftersales/ReturnPayment.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.aftersales; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class ReturnPayment { 7 | private Integer id; 8 | 9 | private String returnCode; 10 | 11 | private Byte paymentTypeId; 12 | 13 | private String paymentTypeName; 14 | 15 | private BigDecimal returnMoney; 16 | 17 | private String createPerson; 18 | 19 | private Date createDate; 20 | 21 | public Integer getId() { 22 | return id; 23 | } 24 | 25 | public void setId(Integer id) { 26 | this.id = id; 27 | } 28 | 29 | public String getReturnCode() { 30 | return returnCode; 31 | } 32 | 33 | public void setReturnCode(String returnCode) { 34 | this.returnCode = returnCode; 35 | } 36 | 37 | public Byte getPaymentTypeId() { 38 | return paymentTypeId; 39 | } 40 | 41 | public void setPaymentTypeId(Byte paymentTypeId) { 42 | this.paymentTypeId = paymentTypeId; 43 | } 44 | 45 | public String getPaymentTypeName() { 46 | return paymentTypeName; 47 | } 48 | 49 | public void setPaymentTypeName(String paymentTypeName) { 50 | this.paymentTypeName = paymentTypeName; 51 | } 52 | 53 | public BigDecimal getReturnMoney() { 54 | return returnMoney; 55 | } 56 | 57 | public void setReturnMoney(BigDecimal returnMoney) { 58 | this.returnMoney = returnMoney; 59 | } 60 | 61 | public String getCreatePerson() { 62 | return createPerson; 63 | } 64 | 65 | public void setCreatePerson(String createPerson) { 66 | this.createPerson = createPerson; 67 | } 68 | 69 | public Date getCreateDate() { 70 | return createDate; 71 | } 72 | 73 | public void setCreateDate(Date createDate) { 74 | this.createDate = createDate; 75 | } 76 | } -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/interceptor/OrderInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | import org.jasig.cas.client.util.AssertionHolder; 7 | import org.jasig.cas.client.validation.Assertion; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 10 | 11 | import com.cl.privilege.api.IPrivilegeBaseApiService; 12 | import com.cl.privilege.model.User; 13 | import com.cl.order.utils.ConfigUtil; 14 | import com.cl.order.utils.SessionUtil; 15 | 16 | 17 | 18 | /** 19 | * 拦截指定path,进行权限验证,及用户的本地session过期后,重新进行赋值 20 | */ 21 | public class OrderInterceptor extends HandlerInterceptorAdapter { 22 | 23 | @Autowired 24 | private ConfigUtil configUtil; 25 | @Autowired 26 | private IPrivilegeBaseApiService privilegeBaseApiService; 27 | 28 | @Override 29 | public boolean preHandle(HttpServletRequest request,HttpServletResponse response, Object handler) throws Exception { 30 | 31 | Assertion assertion=AssertionHolder.getAssertion(); 32 | 33 | //实际cas-client-core中org.jasig.cas.client.authentication.AuthenticationFilter已经进行了单点登录认证,这里主要是为了获得用户信息 34 | if(assertion==null 35 | || assertion.getPrincipal()==null 36 | || assertion.getPrincipal().getName()==null) 37 | { 38 | //没有登录,跳转到没有登录页面 39 | response.sendRedirect(configUtil.getCasServerUrl()); 40 | return false; 41 | } 42 | 43 | User user = SessionUtil.getSessionUser(request); 44 | 45 | if(user == null) 46 | { 47 | //存储Session:用户登录名 48 | user = privilegeBaseApiService.getUserByUsername(assertion.getPrincipal().getName()); 49 | request.getSession().setAttribute(SessionUtil.SessionSystemLoginUserName,user); 50 | } 51 | 52 | //判断权限,没有权限,进入没有权限页面 53 | 54 | return true; 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/ftl/header.ftl: -------------------------------------------------------------------------------- 1 | 2 | 50 | -------------------------------------------------------------------------------- /init_order_privilege.sql: -------------------------------------------------------------------------------- 1 | delete from `p_module` where name='订单中心'; 2 | INSERT INTO `p_module`(id,name,flag,url,sort_no,create_person,create_date,update_person,update_date) 3 | VALUES 4 | (5,'订单中心','o','http://127.0.0.1:10010/order-server',50,'system',NOW(),'system',NOW()) 5 | ; 6 | 7 | 8 | delete from `p_resource` where module_flag='o'; 9 | INSERT INTO `p_resource`(id,name,url,remark,parent_id,structure,sort_no,module_flag,create_person,create_date,update_person,update_date) 10 | VALUES 11 | (200,'订单管理','','',0,'s-1',1,'o','system',NOW(),'system',NOW()), 12 | (201,'促销管理','','',0,'s-2',2,'o','system',NOW(),'system',NOW()), 13 | (202,'礼品卡管理','','',0,'s-3',3,'o','system',NOW(),'system',NOW()), 14 | (203,'受理单管理','','',0,'s-4',4,'o','system',NOW(),'system',NOW()), 15 | (204,'退款单管理','','',0,'s-5',5,'o','system',NOW(),'system',NOW()), 16 | (205,'请款单管理','','',0,'s-6',6,'o','system',NOW(),'system',NOW()), 17 | 18 | (211,'订单查询','/controller/order/list.do','',200,'s-1-1',1,'o','system',NOW(),'system',NOW()), 19 | (212,'订单报表','/controller/order/report.do','',200,'s-1-2',2,'o','system',NOW(),'system',NOW()), 20 | 21 | (221,'促销查询','/controller/promotion/list.do','',201,'s-2-1',1,'o','system',NOW(),'system',NOW()), 22 | 23 | (231,'创建','/controller/giftcard/create.do','',202,'s-3-1',1,'o','system',NOW(),'system',NOW()), 24 | (232,'查询','/controller/giftcard/list.do','',202,'s-3-2',2,'o','system',NOW(),'system',NOW()), 25 | 26 | (241,'创建','/controller/acceptform/create.do','',203,'s-4-1',1,'o','system',NOW(),'system',NOW()), 27 | (242,'管理','/controller/acceptform/list.do','',203,'s-4-2',2,'o','system',NOW(),'system',NOW()), 28 | 29 | (251,'创建','/controller/refund/create.do','',204,'s-5-1',1,'o','system',NOW(),'system',NOW()), 30 | (252,'查询','/controller/refund/list.do','',204,'s-5-2',2,'o','system',NOW(),'system',NOW()), 31 | 32 | (261,'创建','/controller/apply/create.do','',205,'s-6-1',1,'o','system',NOW(),'system',NOW()), 33 | (262,'查询','/controller/apply/list.do','',205,'s-6-2',2,'o','system',NOW(),'system',NOW()) 34 | ; -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/ftl/modifypasswordform.ftl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 49 | 50 | 54 | 55 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/utils/JsonUtil.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | import java.lang.reflect.Field; 4 | import java.util.Collection; 5 | 6 | 7 | public class JsonUtil { 8 | 9 | public static StringBuffer convertObj2json(Collection cs) { 10 | 11 | StringBuffer sbf = new StringBuffer(); 12 | 13 | if (null == cs || 0 == cs.toArray().length){ 14 | 15 | return sbf.append("[").append("]"); 16 | } 17 | 18 | Object[] ls = cs.toArray(); 19 | int size = ls.length; 20 | 21 | sbf.append("["); 22 | if (0 == size) 23 | return new StringBuffer("[]"); 24 | for (int k = 0; k < size; k++) { 25 | Object o = ls[k]; 26 | 27 | sbf.append(convertObj2json(o)); 28 | 29 | if (k < size - 1) 30 | sbf.append(", "); 31 | } 32 | 33 | return sbf.append("]"); 34 | 35 | } 36 | 37 | public static StringBuffer convertObj2json(Object o) { 38 | 39 | StringBuffer sbf = new StringBuffer(); 40 | if (null == o) 41 | return sbf; 42 | 43 | sbf.append("{"); 44 | Class classType = o.getClass(); 45 | Field[] fields = classType.getDeclaredFields(); 46 | 47 | int length = fields.length; 48 | 49 | for (int i = 0; i < length; i++) { 50 | 51 | String fieldName = fields[i].getName(); 52 | Class clazzType = fields[i].getType(); 53 | Package package1 = clazzType.getPackage(); 54 | Object fo = ReflectionUtil.getFieldValue(o, fieldName); 55 | 56 | if (!(fo instanceof Collection) 57 | && (clazzType.isPrimitive() || null == package1 58 | || package1.getName().equals("java.lang") || package1 59 | .getName().equals("java.util"))) { 60 | sbf.append("\"").append(fieldName).append("\":\"").append(fo) 61 | .append("\""); 62 | } else if (!(fo instanceof Collection)) { 63 | sbf.append("\"").append(fieldName).append("\":").append( 64 | convertObj2json(fo)); 65 | } 66 | 67 | if (fo instanceof Collection) { 68 | 69 | sbf.append("\"").append(fieldName).append("\":").append( 70 | convertObj2json((Collection) fo)); 71 | 72 | } 73 | 74 | if (i < length - 1) 75 | sbf.append(", "); 76 | 77 | } 78 | 79 | return sbf.append("}"); 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/springmvc-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | text/plain;charset=UTF-8 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.controller; 2 | 3 | import java.util.Calendar; 4 | import java.util.Date; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.ModelMap; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.cl.order.utils.ConfigUtil; 15 | import com.cl.order.utils.ConstantUtil; 16 | import com.cl.order.utils.SessionUtil; 17 | import com.cl.order.utils.StringUtil; 18 | import com.cl.privilege.api.IPrivilegeBaseApiService; 19 | import com.cl.privilege.model.User; 20 | 21 | 22 | 23 | /** 24 | *主界面及登录验证相关的控制器 25 | */ 26 | 27 | @Controller 28 | @RequestMapping("/controller") 29 | public class IndexController { 30 | 31 | @Autowired 32 | private IPrivilegeBaseApiService privilegeBaseApiService; 33 | @Autowired 34 | private ConfigUtil configUtil; 35 | 36 | @RequestMapping("/main") 37 | public String main(String visitedModule,HttpServletRequest request,ModelMap map) { 38 | 39 | visitedModule = "o"; 40 | 41 | //初始化用户、菜单 42 | User user = SessionUtil.getSessionUser(request); 43 | String menus = privilegeBaseApiService.getModuleTree(user.getId(),visitedModule,""); 44 | map.put("user", user); 45 | map.put("menus", menus); 46 | 47 | int hours = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); 48 | map.put("hours", hours); 49 | 50 | return "main.ftl"; 51 | } 52 | 53 | @RequestMapping("/logout") 54 | public String logout(HttpServletRequest request) throws Exception 55 | { 56 | SessionUtil.clearSession(request); 57 | //被拦截器拦截处理 58 | return "redirect:" + configUtil.getCasServerUrl()+"/logout?service=" + configUtil.getCasServiceUrl(); 59 | } 60 | 61 | @RequestMapping("/modifypasswordform") 62 | public String modifypasswordform(HttpServletRequest request) throws Exception 63 | { 64 | return "modifypasswordform.ftl"; 65 | } 66 | 67 | @ResponseBody 68 | @RequestMapping("/modifypassword") 69 | public String modifypassword(String oldpassword,String password,HttpServletRequest request) throws Exception 70 | { 71 | if(StringUtil.isStrEmpty(oldpassword) || StringUtil.isStrEmpty(password)) return ConstantUtil.Fail; 72 | //初始化用户、菜单 73 | User user = SessionUtil.getSessionUser(request); 74 | if(!user.getPassword().equals(StringUtil.makeMD5(oldpassword))) return ConstantUtil.Fail; 75 | User newUser = new User(); 76 | newUser.setId(user.getId()); 77 | newUser.setPassword(StringUtil.makeMD5(password)); 78 | newUser.setUpdateDate(new Date()); 79 | newUser.setUpdatePerson(user.getUsername()); 80 | privilegeBaseApiService.updateUserById(newUser); 81 | 82 | //更新session 83 | user.setPassword(newUser.getPassword()); 84 | request.getSession().setAttribute(SessionUtil.SessionSystemLoginUserName,user); 85 | 86 | return ConstantUtil.Success; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/aftersales/RefundForm.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.aftersales; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class RefundForm { 7 | private String refundCode; 8 | 9 | private String formCode; 10 | 11 | private String returnCode; 12 | 13 | private Integer memberId; 14 | 15 | private Byte refundTypeId; 16 | 17 | private Byte paymentTypeId; 18 | 19 | private BigDecimal refundMoney; 20 | 21 | private Byte status; 22 | 23 | private String createPerson; 24 | 25 | private Date createDate; 26 | 27 | private String updatePerson; 28 | 29 | private Date updateDate; 30 | 31 | public String getRefundCode() { 32 | return refundCode; 33 | } 34 | 35 | public void setRefundCode(String refundCode) { 36 | this.refundCode = refundCode; 37 | } 38 | 39 | public String getFormCode() { 40 | return formCode; 41 | } 42 | 43 | public void setFormCode(String formCode) { 44 | this.formCode = formCode; 45 | } 46 | 47 | public String getReturnCode() { 48 | return returnCode; 49 | } 50 | 51 | public void setReturnCode(String returnCode) { 52 | this.returnCode = returnCode; 53 | } 54 | 55 | public Integer getMemberId() { 56 | return memberId; 57 | } 58 | 59 | public void setMemberId(Integer memberId) { 60 | this.memberId = memberId; 61 | } 62 | 63 | public Byte getRefundTypeId() { 64 | return refundTypeId; 65 | } 66 | 67 | public void setRefundTypeId(Byte refundTypeId) { 68 | this.refundTypeId = refundTypeId; 69 | } 70 | 71 | public Byte getPaymentTypeId() { 72 | return paymentTypeId; 73 | } 74 | 75 | public void setPaymentTypeId(Byte paymentTypeId) { 76 | this.paymentTypeId = paymentTypeId; 77 | } 78 | 79 | public BigDecimal getRefundMoney() { 80 | return refundMoney; 81 | } 82 | 83 | public void setRefundMoney(BigDecimal refundMoney) { 84 | this.refundMoney = refundMoney; 85 | } 86 | 87 | public Byte getStatus() { 88 | return status; 89 | } 90 | 91 | public void setStatus(Byte status) { 92 | this.status = status; 93 | } 94 | 95 | public String getCreatePerson() { 96 | return createPerson; 97 | } 98 | 99 | public void setCreatePerson(String createPerson) { 100 | this.createPerson = createPerson; 101 | } 102 | 103 | public Date getCreateDate() { 104 | return createDate; 105 | } 106 | 107 | public void setCreateDate(Date createDate) { 108 | this.createDate = createDate; 109 | } 110 | 111 | public String getUpdatePerson() { 112 | return updatePerson; 113 | } 114 | 115 | public void setUpdatePerson(String updatePerson) { 116 | this.updatePerson = updatePerson; 117 | } 118 | 119 | public Date getUpdateDate() { 120 | return updateDate; 121 | } 122 | 123 | public void setUpdateDate(Date updateDate) { 124 | this.updateDate = updateDate; 125 | } 126 | } -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/book/OrderDetail.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.book; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class OrderDetail { 7 | private Integer id; 8 | 9 | private String formCode; 10 | 11 | private String commodityNo; 12 | 13 | private String commodityName; 14 | 15 | private String productNo; 16 | 17 | private String size; 18 | 19 | private BigDecimal sellPrice; 20 | 21 | private BigDecimal discount; 22 | 23 | private Short quality; 24 | 25 | private Short returnQuality; 26 | 27 | private String createPerson; 28 | 29 | private Date createDate; 30 | 31 | private String updatePerson; 32 | 33 | private Date updateDate; 34 | 35 | public Integer getId() { 36 | return id; 37 | } 38 | 39 | public void setId(Integer id) { 40 | this.id = id; 41 | } 42 | 43 | public String getFormCode() { 44 | return formCode; 45 | } 46 | 47 | public void setFormCode(String formCode) { 48 | this.formCode = formCode; 49 | } 50 | 51 | public String getCommodityNo() { 52 | return commodityNo; 53 | } 54 | 55 | public void setCommodityNo(String commodityNo) { 56 | this.commodityNo = commodityNo; 57 | } 58 | 59 | public String getCommodityName() { 60 | return commodityName; 61 | } 62 | 63 | public void setCommodityName(String commodityName) { 64 | this.commodityName = commodityName; 65 | } 66 | 67 | public String getProductNo() { 68 | return productNo; 69 | } 70 | 71 | public void setProductNo(String productNo) { 72 | this.productNo = productNo; 73 | } 74 | 75 | public String getSize() { 76 | return size; 77 | } 78 | 79 | public void setSize(String size) { 80 | this.size = size; 81 | } 82 | 83 | public BigDecimal getSellPrice() { 84 | return sellPrice; 85 | } 86 | 87 | public void setSellPrice(BigDecimal sellPrice) { 88 | this.sellPrice = sellPrice; 89 | } 90 | 91 | public BigDecimal getDiscount() { 92 | return discount; 93 | } 94 | 95 | public void setDiscount(BigDecimal discount) { 96 | this.discount = discount; 97 | } 98 | 99 | public Short getQuality() { 100 | return quality; 101 | } 102 | 103 | public void setQuality(Short quality) { 104 | this.quality = quality; 105 | } 106 | 107 | public Short getReturnQuality() { 108 | return returnQuality; 109 | } 110 | 111 | public void setReturnQuality(Short returnQuality) { 112 | this.returnQuality = returnQuality; 113 | } 114 | 115 | public String getCreatePerson() { 116 | return createPerson; 117 | } 118 | 119 | public void setCreatePerson(String createPerson) { 120 | this.createPerson = createPerson; 121 | } 122 | 123 | public Date getCreateDate() { 124 | return createDate; 125 | } 126 | 127 | public void setCreateDate(Date createDate) { 128 | this.createDate = createDate; 129 | } 130 | 131 | public String getUpdatePerson() { 132 | return updatePerson; 133 | } 134 | 135 | public void setUpdatePerson(String updatePerson) { 136 | this.updatePerson = updatePerson; 137 | } 138 | 139 | public Date getUpdateDate() { 140 | return updateDate; 141 | } 142 | 143 | public void setUpdateDate(Date updateDate) { 144 | this.updateDate = updateDate; 145 | } 146 | } -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/book/OrderMainDetail.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.book; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class OrderMainDetail { 7 | private Integer id; 8 | 9 | private String formCode; 10 | 11 | private String commodityNo; 12 | 13 | private String commodityName; 14 | 15 | private String productNo; 16 | 17 | private String size; 18 | 19 | private BigDecimal sellPrice; 20 | 21 | private BigDecimal discount; 22 | 23 | private Short quality; 24 | 25 | private Short returnQuality; 26 | 27 | private String createPerson; 28 | 29 | private Date createDate; 30 | 31 | private String updatePerson; 32 | 33 | private Date updateDate; 34 | 35 | public Integer getId() { 36 | return id; 37 | } 38 | 39 | public void setId(Integer id) { 40 | this.id = id; 41 | } 42 | 43 | public String getFormCode() { 44 | return formCode; 45 | } 46 | 47 | public void setFormCode(String formCode) { 48 | this.formCode = formCode; 49 | } 50 | 51 | public String getCommodityNo() { 52 | return commodityNo; 53 | } 54 | 55 | public void setCommodityNo(String commodityNo) { 56 | this.commodityNo = commodityNo; 57 | } 58 | 59 | public String getCommodityName() { 60 | return commodityName; 61 | } 62 | 63 | public void setCommodityName(String commodityName) { 64 | this.commodityName = commodityName; 65 | } 66 | 67 | public String getProductNo() { 68 | return productNo; 69 | } 70 | 71 | public void setProductNo(String productNo) { 72 | this.productNo = productNo; 73 | } 74 | 75 | public String getSize() { 76 | return size; 77 | } 78 | 79 | public void setSize(String size) { 80 | this.size = size; 81 | } 82 | 83 | public BigDecimal getSellPrice() { 84 | return sellPrice; 85 | } 86 | 87 | public void setSellPrice(BigDecimal sellPrice) { 88 | this.sellPrice = sellPrice; 89 | } 90 | 91 | public BigDecimal getDiscount() { 92 | return discount; 93 | } 94 | 95 | public void setDiscount(BigDecimal discount) { 96 | this.discount = discount; 97 | } 98 | 99 | public Short getQuality() { 100 | return quality; 101 | } 102 | 103 | public void setQuality(Short quality) { 104 | this.quality = quality; 105 | } 106 | 107 | public Short getReturnQuality() { 108 | return returnQuality; 109 | } 110 | 111 | public void setReturnQuality(Short returnQuality) { 112 | this.returnQuality = returnQuality; 113 | } 114 | 115 | public String getCreatePerson() { 116 | return createPerson; 117 | } 118 | 119 | public void setCreatePerson(String createPerson) { 120 | this.createPerson = createPerson; 121 | } 122 | 123 | public Date getCreateDate() { 124 | return createDate; 125 | } 126 | 127 | public void setCreateDate(Date createDate) { 128 | this.createDate = createDate; 129 | } 130 | 131 | public String getUpdatePerson() { 132 | return updatePerson; 133 | } 134 | 135 | public void setUpdatePerson(String updatePerson) { 136 | this.updatePerson = updatePerson; 137 | } 138 | 139 | public Date getUpdateDate() { 140 | return updateDate; 141 | } 142 | 143 | public void setUpdateDate(Date updateDate) { 144 | this.updateDate = updateDate; 145 | } 146 | } -------------------------------------------------------------------------------- /order-api-server/src/test/resources/applicationContext-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | Spring公共配置 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | classpath*:/config.properties 48 | 49 | file:/d:/conf/cl/order-api-server/*.properties 50 | 51 | file:/etc/conf/cl/order-api-server/*.properties 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/aftersales/AcceptDetail.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.aftersales; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class AcceptDetail { 7 | private Integer id; 8 | 9 | private String acceptCode; 10 | 11 | private Integer direction; 12 | 13 | private Integer orderDetailId; 14 | 15 | private String commodityNo; 16 | 17 | private String commodityName; 18 | 19 | private String productNo; 20 | 21 | private String size; 22 | 23 | private BigDecimal sellPrice; 24 | 25 | private BigDecimal discount; 26 | 27 | private Short quality; 28 | 29 | private Integer refId; 30 | 31 | private String createPerson; 32 | 33 | private Date createDate; 34 | 35 | private String updatePerson; 36 | 37 | private Date updateDate; 38 | 39 | public Integer getId() { 40 | return id; 41 | } 42 | 43 | public void setId(Integer id) { 44 | this.id = id; 45 | } 46 | 47 | public String getAcceptCode() { 48 | return acceptCode; 49 | } 50 | 51 | public void setAcceptCode(String acceptCode) { 52 | this.acceptCode = acceptCode; 53 | } 54 | 55 | public Integer getDirection() { 56 | return direction; 57 | } 58 | 59 | public void setDirection(Integer direction) { 60 | this.direction = direction; 61 | } 62 | 63 | public Integer getOrderDetailId() { 64 | return orderDetailId; 65 | } 66 | 67 | public void setOrderDetailId(Integer orderDetailId) { 68 | this.orderDetailId = orderDetailId; 69 | } 70 | 71 | public String getCommodityNo() { 72 | return commodityNo; 73 | } 74 | 75 | public void setCommodityNo(String commodityNo) { 76 | this.commodityNo = commodityNo; 77 | } 78 | 79 | public String getCommodityName() { 80 | return commodityName; 81 | } 82 | 83 | public void setCommodityName(String commodityName) { 84 | this.commodityName = commodityName; 85 | } 86 | 87 | public String getProductNo() { 88 | return productNo; 89 | } 90 | 91 | public void setProductNo(String productNo) { 92 | this.productNo = productNo; 93 | } 94 | 95 | public String getSize() { 96 | return size; 97 | } 98 | 99 | public void setSize(String size) { 100 | this.size = size; 101 | } 102 | 103 | public BigDecimal getSellPrice() { 104 | return sellPrice; 105 | } 106 | 107 | public void setSellPrice(BigDecimal sellPrice) { 108 | this.sellPrice = sellPrice; 109 | } 110 | 111 | public BigDecimal getDiscount() { 112 | return discount; 113 | } 114 | 115 | public void setDiscount(BigDecimal discount) { 116 | this.discount = discount; 117 | } 118 | 119 | public Short getQuality() { 120 | return quality; 121 | } 122 | 123 | public void setQuality(Short quality) { 124 | this.quality = quality; 125 | } 126 | 127 | public Integer getRefId() { 128 | return refId; 129 | } 130 | 131 | public void setRefId(Integer refId) { 132 | this.refId = refId; 133 | } 134 | 135 | public String getCreatePerson() { 136 | return createPerson; 137 | } 138 | 139 | public void setCreatePerson(String createPerson) { 140 | this.createPerson = createPerson; 141 | } 142 | 143 | public Date getCreateDate() { 144 | return createDate; 145 | } 146 | 147 | public void setCreateDate(Date createDate) { 148 | this.createDate = createDate; 149 | } 150 | 151 | public String getUpdatePerson() { 152 | return updatePerson; 153 | } 154 | 155 | public void setUpdatePerson(String updatePerson) { 156 | this.updatePerson = updatePerson; 157 | } 158 | 159 | public Date getUpdateDate() { 160 | return updateDate; 161 | } 162 | 163 | public void setUpdateDate(Date updateDate) { 164 | this.updateDate = updateDate; 165 | } 166 | } -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/aftersales/AcceptForm.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.aftersales; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class AcceptForm { 7 | private String acceptCode; 8 | 9 | private String formCode; 10 | 11 | private Byte returnTypeId; 12 | 13 | private Integer consigneeId; 14 | 15 | private BigDecimal returnMoney; 16 | 17 | private BigDecimal exchangeMoney; 18 | 19 | private Integer warehouseId; 20 | 21 | private String warehouseName; 22 | 23 | private String exchangeFormCode; 24 | 25 | private Byte reasonId; 26 | 27 | private String reasonName; 28 | 29 | private Byte status; 30 | 31 | private String createPerson; 32 | 33 | private Date createDate; 34 | 35 | private String updatePerson; 36 | 37 | private Date updateDate; 38 | 39 | public String getAcceptCode() { 40 | return acceptCode; 41 | } 42 | 43 | public void setAcceptCode(String acceptCode) { 44 | this.acceptCode = acceptCode; 45 | } 46 | 47 | public String getFormCode() { 48 | return formCode; 49 | } 50 | 51 | public void setFormCode(String formCode) { 52 | this.formCode = formCode; 53 | } 54 | 55 | public Byte getReturnTypeId() { 56 | return returnTypeId; 57 | } 58 | 59 | public void setReturnTypeId(Byte returnTypeId) { 60 | this.returnTypeId = returnTypeId; 61 | } 62 | 63 | public Integer getConsigneeId() { 64 | return consigneeId; 65 | } 66 | 67 | public void setConsigneeId(Integer consigneeId) { 68 | this.consigneeId = consigneeId; 69 | } 70 | 71 | public BigDecimal getReturnMoney() { 72 | return returnMoney; 73 | } 74 | 75 | public void setReturnMoney(BigDecimal returnMoney) { 76 | this.returnMoney = returnMoney; 77 | } 78 | 79 | public BigDecimal getExchangeMoney() { 80 | return exchangeMoney; 81 | } 82 | 83 | public void setExchangeMoney(BigDecimal exchangeMoney) { 84 | this.exchangeMoney = exchangeMoney; 85 | } 86 | 87 | public Integer getWarehouseId() { 88 | return warehouseId; 89 | } 90 | 91 | public void setWarehouseId(Integer warehouseId) { 92 | this.warehouseId = warehouseId; 93 | } 94 | 95 | public String getWarehouseName() { 96 | return warehouseName; 97 | } 98 | 99 | public void setWarehouseName(String warehouseName) { 100 | this.warehouseName = warehouseName; 101 | } 102 | 103 | public String getExchangeFormCode() { 104 | return exchangeFormCode; 105 | } 106 | 107 | public void setExchangeFormCode(String exchangeFormCode) { 108 | this.exchangeFormCode = exchangeFormCode; 109 | } 110 | 111 | public Byte getReasonId() { 112 | return reasonId; 113 | } 114 | 115 | public void setReasonId(Byte reasonId) { 116 | this.reasonId = reasonId; 117 | } 118 | 119 | public String getReasonName() { 120 | return reasonName; 121 | } 122 | 123 | public void setReasonName(String reasonName) { 124 | this.reasonName = reasonName; 125 | } 126 | 127 | public Byte getStatus() { 128 | return status; 129 | } 130 | 131 | public void setStatus(Byte status) { 132 | this.status = status; 133 | } 134 | 135 | public String getCreatePerson() { 136 | return createPerson; 137 | } 138 | 139 | public void setCreatePerson(String createPerson) { 140 | this.createPerson = createPerson; 141 | } 142 | 143 | public Date getCreateDate() { 144 | return createDate; 145 | } 146 | 147 | public void setCreateDate(Date createDate) { 148 | this.createDate = createDate; 149 | } 150 | 151 | public String getUpdatePerson() { 152 | return updatePerson; 153 | } 154 | 155 | public void setUpdatePerson(String updatePerson) { 156 | this.updatePerson = updatePerson; 157 | } 158 | 159 | public Date getUpdateDate() { 160 | return updateDate; 161 | } 162 | 163 | public void setUpdateDate(Date updateDate) { 164 | this.updateDate = updateDate; 165 | } 166 | } -------------------------------------------------------------------------------- /order-api-server/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | Spring公共配置 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | classpath*:/config.properties 48 | 49 | file:/d:/conf/cl/order-api-server/*.properties 50 | 51 | file:/etc/conf/cl/order-api-server/*.properties 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/book/OrderMainForm.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.book; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class OrderMainForm { 7 | private String formCode; 8 | 9 | private Integer orderTypeId; 10 | 11 | private Integer memberId; 12 | 13 | private Integer consigneeId; 14 | 15 | private BigDecimal totalPrice; 16 | 17 | private BigDecimal goodsPrice; 18 | 19 | private BigDecimal deliverPrice; 20 | 21 | private BigDecimal paidPrice; 22 | 23 | private Byte paymentTypeId; 24 | 25 | private String paymentTypeName; 26 | 27 | private Byte paymentStatus; 28 | 29 | private Byte sourceRefId; 30 | 31 | private Byte sourcePosId; 32 | 33 | private String createPerson; 34 | 35 | private Date createDate; 36 | 37 | private String updatePerson; 38 | 39 | private Date updateDate; 40 | 41 | public String getFormCode() { 42 | return formCode; 43 | } 44 | 45 | public void setFormCode(String formCode) { 46 | this.formCode = formCode; 47 | } 48 | 49 | public Integer getOrderTypeId() { 50 | return orderTypeId; 51 | } 52 | 53 | public void setOrderTypeId(Integer orderTypeId) { 54 | this.orderTypeId = orderTypeId; 55 | } 56 | 57 | public Integer getMemberId() { 58 | return memberId; 59 | } 60 | 61 | public void setMemberId(Integer memberId) { 62 | this.memberId = memberId; 63 | } 64 | 65 | public Integer getConsigneeId() { 66 | return consigneeId; 67 | } 68 | 69 | public void setConsigneeId(Integer consigneeId) { 70 | this.consigneeId = consigneeId; 71 | } 72 | 73 | public BigDecimal getTotalPrice() { 74 | return totalPrice; 75 | } 76 | 77 | public void setTotalPrice(BigDecimal totalPrice) { 78 | this.totalPrice = totalPrice; 79 | } 80 | 81 | public BigDecimal getGoodsPrice() { 82 | return goodsPrice; 83 | } 84 | 85 | public void setGoodsPrice(BigDecimal goodsPrice) { 86 | this.goodsPrice = goodsPrice; 87 | } 88 | 89 | public BigDecimal getDeliverPrice() { 90 | return deliverPrice; 91 | } 92 | 93 | public void setDeliverPrice(BigDecimal deliverPrice) { 94 | this.deliverPrice = deliverPrice; 95 | } 96 | 97 | public BigDecimal getPaidPrice() { 98 | return paidPrice; 99 | } 100 | 101 | public void setPaidPrice(BigDecimal paidPrice) { 102 | this.paidPrice = paidPrice; 103 | } 104 | 105 | public Byte getPaymentTypeId() { 106 | return paymentTypeId; 107 | } 108 | 109 | public void setPaymentTypeId(Byte paymentTypeId) { 110 | this.paymentTypeId = paymentTypeId; 111 | } 112 | 113 | public String getPaymentTypeName() { 114 | return paymentTypeName; 115 | } 116 | 117 | public void setPaymentTypeName(String paymentTypeName) { 118 | this.paymentTypeName = paymentTypeName; 119 | } 120 | 121 | public Byte getPaymentStatus() { 122 | return paymentStatus; 123 | } 124 | 125 | public void setPaymentStatus(Byte paymentStatus) { 126 | this.paymentStatus = paymentStatus; 127 | } 128 | 129 | public Byte getSourceRefId() { 130 | return sourceRefId; 131 | } 132 | 133 | public void setSourceRefId(Byte sourceRefId) { 134 | this.sourceRefId = sourceRefId; 135 | } 136 | 137 | public Byte getSourcePosId() { 138 | return sourcePosId; 139 | } 140 | 141 | public void setSourcePosId(Byte sourcePosId) { 142 | this.sourcePosId = sourcePosId; 143 | } 144 | 145 | public String getCreatePerson() { 146 | return createPerson; 147 | } 148 | 149 | public void setCreatePerson(String createPerson) { 150 | this.createPerson = createPerson; 151 | } 152 | 153 | public Date getCreateDate() { 154 | return createDate; 155 | } 156 | 157 | public void setCreateDate(Date createDate) { 158 | this.createDate = createDate; 159 | } 160 | 161 | public String getUpdatePerson() { 162 | return updatePerson; 163 | } 164 | 165 | public void setUpdatePerson(String updatePerson) { 166 | this.updatePerson = updatePerson; 167 | } 168 | 169 | public Date getUpdateDate() { 170 | return updateDate; 171 | } 172 | 173 | public void setUpdateDate(Date updateDate) { 174 | this.updateDate = updateDate; 175 | } 176 | } -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/base/DictionaryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, `group`, code, name, sort_no, create_person, create_date 15 | 16 | 22 | 23 | delete from o_dictionary 24 | where id = #{id,jdbcType=INTEGER} 25 | 26 | 27 | insert into o_dictionary (id, group, code, 28 | name, sort_no, create_person, 29 | create_date) 30 | values (#{id,jdbcType=INTEGER}, #{group,jdbcType=VARCHAR}, #{code,jdbcType=TINYINT}, 31 | #{name,jdbcType=VARCHAR}, #{sortNo,jdbcType=TINYINT}, #{createPerson,jdbcType=VARCHAR}, 32 | #{createDate,jdbcType=TIMESTAMP}) 33 | 34 | 35 | insert into o_dictionary 36 | 37 | 38 | id, 39 | 40 | 41 | group, 42 | 43 | 44 | code, 45 | 46 | 47 | name, 48 | 49 | 50 | sort_no, 51 | 52 | 53 | create_person, 54 | 55 | 56 | create_date, 57 | 58 | 59 | 60 | 61 | #{id,jdbcType=INTEGER}, 62 | 63 | 64 | #{group,jdbcType=VARCHAR}, 65 | 66 | 67 | #{code,jdbcType=TINYINT}, 68 | 69 | 70 | #{name,jdbcType=VARCHAR}, 71 | 72 | 73 | #{sortNo,jdbcType=TINYINT}, 74 | 75 | 76 | #{createPerson,jdbcType=VARCHAR}, 77 | 78 | 79 | #{createDate,jdbcType=TIMESTAMP}, 80 | 81 | 82 | 83 | 84 | update o_dictionary 85 | 86 | 87 | group = #{group,jdbcType=VARCHAR}, 88 | 89 | 90 | code = #{code,jdbcType=TINYINT}, 91 | 92 | 93 | name = #{name,jdbcType=VARCHAR}, 94 | 95 | 96 | sort_no = #{sortNo,jdbcType=TINYINT}, 97 | 98 | 99 | create_person = #{createPerson,jdbcType=VARCHAR}, 100 | 101 | 102 | create_date = #{createDate,jdbcType=TIMESTAMP}, 103 | 104 | 105 | where id = #{id,jdbcType=INTEGER} 106 | 107 | 108 | update o_dictionary 109 | set group = #{group,jdbcType=VARCHAR}, 110 | code = #{code,jdbcType=TINYINT}, 111 | name = #{name,jdbcType=VARCHAR}, 112 | sort_no = #{sortNo,jdbcType=TINYINT}, 113 | create_person = #{createPerson,jdbcType=VARCHAR}, 114 | create_date = #{createDate,jdbcType=TIMESTAMP} 115 | where id = #{id,jdbcType=INTEGER} 116 | 117 | -------------------------------------------------------------------------------- /order-api-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cl 7 | order 8 | 1.0.0-SNAPSHOT 9 | 10 | order-api-server 11 | order-api-server 12 | war 13 | 14 | 15 | UTF-8 16 | 4.0.6.RELEASE 17 | 18 | 19 | 20 | 21 | 22 | cl 23 | order-data 24 | 1.0.0-SNAPSHOT 25 | 26 | 27 | cl 28 | order-api 29 | 1.0.0-SNAPSHOT 30 | 31 | 32 | 33 | org.jasig.cas.client 34 | cas-client-core 35 | 3.2.1-SNAPSHOT 36 | 37 | 38 | 39 | log4j 40 | log4j 41 | 1.2.16 42 | 43 | 44 | org.slf4j 45 | slf4j-api 46 | 1.6.1 47 | 48 | 49 | org.slf4j 50 | slf4j-log4j12 51 | 1.6.1 52 | 53 | 54 | 55 | org.springframework 56 | spring-core 57 | ${spring.version} 58 | 59 | 60 | org.springframework 61 | spring-beans 62 | ${spring.version} 63 | 64 | 65 | org.springframework 66 | spring-context 67 | ${spring.version} 68 | 69 | 70 | org.springframework 71 | spring-context-support 72 | ${spring.version} 73 | 74 | 75 | org.springframework 76 | spring-web 77 | ${spring.version} 78 | 79 | 80 | org.springframework 81 | spring-webmvc 82 | ${spring.version} 83 | 84 | 85 | org.springframework 86 | spring-aspects 87 | ${spring.version} 88 | 89 | 90 | org.springframework 91 | spring-jdbc 92 | ${spring.version} 93 | 94 | 95 | org.springframework.data 96 | spring-data-redis 97 | 1.3.1.RELEASE 98 | 99 | 100 | 101 | com.alibaba 102 | dubbo 103 | 2.5.3 104 | 105 | 106 | org.springframework 107 | spring 108 | 109 | 110 | netty 111 | org.jboss.netty 112 | 113 | 114 | 115 | 116 | com.github.sgroschupf 117 | zkclient 118 | 0.1 119 | 120 | 121 | 122 | com.caucho 123 | hessian 124 | 4.0.7 125 | 126 | 127 | 128 | mysql 129 | mysql-connector-java 130 | test 131 | 5.1.14 132 | 133 | 134 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/book/OrderLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, form_code, log_type_id, log_content, create_person, create_date, create_ip 15 | 16 | 22 | 23 | delete from o_order_log 24 | where id = #{id,jdbcType=INTEGER} 25 | 26 | 27 | insert into o_order_log (id, form_code, log_type_id, 28 | log_content, create_person, create_date, 29 | create_ip) 30 | values (#{id,jdbcType=INTEGER}, #{formCode,jdbcType=VARCHAR}, #{logTypeId,jdbcType=TINYINT}, 31 | #{logContent,jdbcType=VARCHAR}, #{createPerson,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 32 | #{createIp,jdbcType=VARCHAR}) 33 | 34 | 35 | insert into o_order_log 36 | 37 | 38 | id, 39 | 40 | 41 | form_code, 42 | 43 | 44 | log_type_id, 45 | 46 | 47 | log_content, 48 | 49 | 50 | create_person, 51 | 52 | 53 | create_date, 54 | 55 | 56 | create_ip, 57 | 58 | 59 | 60 | 61 | #{id,jdbcType=INTEGER}, 62 | 63 | 64 | #{formCode,jdbcType=VARCHAR}, 65 | 66 | 67 | #{logTypeId,jdbcType=TINYINT}, 68 | 69 | 70 | #{logContent,jdbcType=VARCHAR}, 71 | 72 | 73 | #{createPerson,jdbcType=VARCHAR}, 74 | 75 | 76 | #{createDate,jdbcType=TIMESTAMP}, 77 | 78 | 79 | #{createIp,jdbcType=VARCHAR}, 80 | 81 | 82 | 83 | 84 | update o_order_log 85 | 86 | 87 | form_code = #{formCode,jdbcType=VARCHAR}, 88 | 89 | 90 | log_type_id = #{logTypeId,jdbcType=TINYINT}, 91 | 92 | 93 | log_content = #{logContent,jdbcType=VARCHAR}, 94 | 95 | 96 | create_person = #{createPerson,jdbcType=VARCHAR}, 97 | 98 | 99 | create_date = #{createDate,jdbcType=TIMESTAMP}, 100 | 101 | 102 | create_ip = #{createIp,jdbcType=VARCHAR}, 103 | 104 | 105 | where id = #{id,jdbcType=INTEGER} 106 | 107 | 108 | update o_order_log 109 | set form_code = #{formCode,jdbcType=VARCHAR}, 110 | log_type_id = #{logTypeId,jdbcType=TINYINT}, 111 | log_content = #{logContent,jdbcType=VARCHAR}, 112 | create_person = #{createPerson,jdbcType=VARCHAR}, 113 | create_date = #{createDate,jdbcType=TIMESTAMP}, 114 | create_ip = #{createIp,jdbcType=VARCHAR} 115 | where id = #{id,jdbcType=INTEGER} 116 | 117 | -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | Cl Purchase Manage Server 7 | 8 | webAppRootKey 9 | order-server.root 10 | 11 | 12 | contextConfigLocation 13 | 14 | classpath*:/applicationContext*.xml 15 | classpath*:/cas-order.xml 16 | 17 | 18 | 19 | log4jConfigLocation 20 | /WEB-INF/classes/log4j.xml 21 | 22 | 23 | spring.profiles.default 24 | dev 25 | 26 | 27 | 28 | 29 | encodingFilter 30 | org.springframework.web.filter.CharacterEncodingFilter 31 | 32 | encoding 33 | UTF-8 34 | 35 | 36 | forceEncoding 37 | true 38 | 39 | 40 | 41 | encodingFilter 42 | *.do 43 | 44 | 45 | 46 | 47 | org.jasig.cas.client.session.SingleSignOutHttpSessionListener 48 | 49 | 50 | CAS Single Sign Out Filter 51 | org.jasig.cas.client.session.SingleSignOutFilter 52 | 53 | 54 | CAS Single Sign Out Filter 55 | /controller/* 56 | 57 | 58 | 59 | 60 | 61 | CAS Authentication Filter 62 | org.springframework.web.filter.DelegatingFilterProxy 63 | 64 | targetBeanName 65 | casAuthenticationFilter 66 | 67 | 68 | 69 | CAS Authentication Filter 70 | /controller/* 71 | 72 | 73 | CAS Validation Filter 74 | org.springframework.web.filter.DelegatingFilterProxy 75 | 76 | targetBeanName 77 | casTicketValidationFilter 78 | 79 | 80 | 81 | CAS Validation Filter 82 | /controller/* 83 | 84 | 85 | 86 | 87 | CAS Assertion Thread Local Filter 88 | org.jasig.cas.client.util.AssertionThreadLocalFilter 89 | 90 | 91 | CAS Assertion Thread Local Filter 92 | /controller/* 93 | 94 | 95 | 96 | 97 | 98 | org.springframework.web.context.ContextLoaderListener 99 | 100 | 101 | 102 | 103 | springmvc 104 | org.springframework.web.servlet.DispatcherServlet 105 | 1 106 | 107 | 108 | springmvc 109 | *.do 110 | 111 | 112 | 113 | csv 114 | application/octet-stream 115 | 116 | 117 | 118 | index.html 119 | index.jsp 120 | 121 | 122 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/aftersales/AcceptLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, accept_code, log_type_id, log_content, create_person, create_date, create_ip 15 | 16 | 22 | 23 | delete from o_accept_log 24 | where id = #{id,jdbcType=INTEGER} 25 | 26 | 27 | insert into o_accept_log (id, accept_code, log_type_id, 28 | log_content, create_person, create_date, 29 | create_ip) 30 | values (#{id,jdbcType=INTEGER}, #{acceptCode,jdbcType=VARCHAR}, #{logTypeId,jdbcType=TINYINT}, 31 | #{logContent,jdbcType=VARCHAR}, #{createPerson,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 32 | #{createIp,jdbcType=VARCHAR}) 33 | 34 | 35 | insert into o_accept_log 36 | 37 | 38 | id, 39 | 40 | 41 | accept_code, 42 | 43 | 44 | log_type_id, 45 | 46 | 47 | log_content, 48 | 49 | 50 | create_person, 51 | 52 | 53 | create_date, 54 | 55 | 56 | create_ip, 57 | 58 | 59 | 60 | 61 | #{id,jdbcType=INTEGER}, 62 | 63 | 64 | #{acceptCode,jdbcType=VARCHAR}, 65 | 66 | 67 | #{logTypeId,jdbcType=TINYINT}, 68 | 69 | 70 | #{logContent,jdbcType=VARCHAR}, 71 | 72 | 73 | #{createPerson,jdbcType=VARCHAR}, 74 | 75 | 76 | #{createDate,jdbcType=TIMESTAMP}, 77 | 78 | 79 | #{createIp,jdbcType=VARCHAR}, 80 | 81 | 82 | 83 | 84 | update o_accept_log 85 | 86 | 87 | accept_code = #{acceptCode,jdbcType=VARCHAR}, 88 | 89 | 90 | log_type_id = #{logTypeId,jdbcType=TINYINT}, 91 | 92 | 93 | log_content = #{logContent,jdbcType=VARCHAR}, 94 | 95 | 96 | create_person = #{createPerson,jdbcType=VARCHAR}, 97 | 98 | 99 | create_date = #{createDate,jdbcType=TIMESTAMP}, 100 | 101 | 102 | create_ip = #{createIp,jdbcType=VARCHAR}, 103 | 104 | 105 | where id = #{id,jdbcType=INTEGER} 106 | 107 | 108 | update o_accept_log 109 | set accept_code = #{acceptCode,jdbcType=VARCHAR}, 110 | log_type_id = #{logTypeId,jdbcType=TINYINT}, 111 | log_content = #{logContent,jdbcType=VARCHAR}, 112 | create_person = #{createPerson,jdbcType=VARCHAR}, 113 | create_date = #{createDate,jdbcType=TIMESTAMP}, 114 | create_ip = #{createIp,jdbcType=VARCHAR} 115 | where id = #{id,jdbcType=INTEGER} 116 | 117 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/aftersales/RefundLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, refund_code, log_type_id, log_content, create_person, create_date, create_ip 15 | 16 | 22 | 23 | delete from o_refund_log 24 | where id = #{id,jdbcType=INTEGER} 25 | 26 | 27 | insert into o_refund_log (id, refund_code, log_type_id, 28 | log_content, create_person, create_date, 29 | create_ip) 30 | values (#{id,jdbcType=INTEGER}, #{refundCode,jdbcType=VARCHAR}, #{logTypeId,jdbcType=TINYINT}, 31 | #{logContent,jdbcType=VARCHAR}, #{createPerson,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 32 | #{createIp,jdbcType=VARCHAR}) 33 | 34 | 35 | insert into o_refund_log 36 | 37 | 38 | id, 39 | 40 | 41 | refund_code, 42 | 43 | 44 | log_type_id, 45 | 46 | 47 | log_content, 48 | 49 | 50 | create_person, 51 | 52 | 53 | create_date, 54 | 55 | 56 | create_ip, 57 | 58 | 59 | 60 | 61 | #{id,jdbcType=INTEGER}, 62 | 63 | 64 | #{refundCode,jdbcType=VARCHAR}, 65 | 66 | 67 | #{logTypeId,jdbcType=TINYINT}, 68 | 69 | 70 | #{logContent,jdbcType=VARCHAR}, 71 | 72 | 73 | #{createPerson,jdbcType=VARCHAR}, 74 | 75 | 76 | #{createDate,jdbcType=TIMESTAMP}, 77 | 78 | 79 | #{createIp,jdbcType=VARCHAR}, 80 | 81 | 82 | 83 | 84 | update o_refund_log 85 | 86 | 87 | refund_code = #{refundCode,jdbcType=VARCHAR}, 88 | 89 | 90 | log_type_id = #{logTypeId,jdbcType=TINYINT}, 91 | 92 | 93 | log_content = #{logContent,jdbcType=VARCHAR}, 94 | 95 | 96 | create_person = #{createPerson,jdbcType=VARCHAR}, 97 | 98 | 99 | create_date = #{createDate,jdbcType=TIMESTAMP}, 100 | 101 | 102 | create_ip = #{createIp,jdbcType=VARCHAR}, 103 | 104 | 105 | where id = #{id,jdbcType=INTEGER} 106 | 107 | 108 | update o_refund_log 109 | set refund_code = #{refundCode,jdbcType=VARCHAR}, 110 | log_type_id = #{logTypeId,jdbcType=TINYINT}, 111 | log_content = #{logContent,jdbcType=VARCHAR}, 112 | create_person = #{createPerson,jdbcType=VARCHAR}, 113 | create_date = #{createDate,jdbcType=TIMESTAMP}, 114 | create_ip = #{createIp,jdbcType=VARCHAR} 115 | where id = #{id,jdbcType=INTEGER} 116 | 117 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/book/OrderPaymentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, form_code, payment_type_id, payment_type_name, payment_money, create_person, 15 | create_date 16 | 17 | 23 | 24 | delete from o_order_payment 25 | where id = #{id,jdbcType=INTEGER} 26 | 27 | 28 | insert into o_order_payment (id, form_code, payment_type_id, 29 | payment_type_name, payment_money, create_person, 30 | create_date) 31 | values (#{id,jdbcType=INTEGER}, #{formCode,jdbcType=VARCHAR}, #{paymentTypeId,jdbcType=TINYINT}, 32 | #{paymentTypeName,jdbcType=VARCHAR}, #{paymentMoney,jdbcType=DECIMAL}, #{createPerson,jdbcType=VARCHAR}, 33 | #{createDate,jdbcType=TIMESTAMP}) 34 | 35 | 36 | insert into o_order_payment 37 | 38 | 39 | id, 40 | 41 | 42 | form_code, 43 | 44 | 45 | payment_type_id, 46 | 47 | 48 | payment_type_name, 49 | 50 | 51 | payment_money, 52 | 53 | 54 | create_person, 55 | 56 | 57 | create_date, 58 | 59 | 60 | 61 | 62 | #{id,jdbcType=INTEGER}, 63 | 64 | 65 | #{formCode,jdbcType=VARCHAR}, 66 | 67 | 68 | #{paymentTypeId,jdbcType=TINYINT}, 69 | 70 | 71 | #{paymentTypeName,jdbcType=VARCHAR}, 72 | 73 | 74 | #{paymentMoney,jdbcType=DECIMAL}, 75 | 76 | 77 | #{createPerson,jdbcType=VARCHAR}, 78 | 79 | 80 | #{createDate,jdbcType=TIMESTAMP}, 81 | 82 | 83 | 84 | 85 | update o_order_payment 86 | 87 | 88 | form_code = #{formCode,jdbcType=VARCHAR}, 89 | 90 | 91 | payment_type_id = #{paymentTypeId,jdbcType=TINYINT}, 92 | 93 | 94 | payment_type_name = #{paymentTypeName,jdbcType=VARCHAR}, 95 | 96 | 97 | payment_money = #{paymentMoney,jdbcType=DECIMAL}, 98 | 99 | 100 | create_person = #{createPerson,jdbcType=VARCHAR}, 101 | 102 | 103 | create_date = #{createDate,jdbcType=TIMESTAMP}, 104 | 105 | 106 | where id = #{id,jdbcType=INTEGER} 107 | 108 | 109 | update o_order_payment 110 | set form_code = #{formCode,jdbcType=VARCHAR}, 111 | payment_type_id = #{paymentTypeId,jdbcType=TINYINT}, 112 | payment_type_name = #{paymentTypeName,jdbcType=VARCHAR}, 113 | payment_money = #{paymentMoney,jdbcType=DECIMAL}, 114 | create_person = #{createPerson,jdbcType=VARCHAR}, 115 | create_date = #{createDate,jdbcType=TIMESTAMP} 116 | where id = #{id,jdbcType=INTEGER} 117 | 118 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/aftersales/ReturnPaymentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, return_code, payment_type_id, payment_type_name, return_money, create_person, 15 | create_date 16 | 17 | 23 | 24 | delete from o_return_payment 25 | where id = #{id,jdbcType=INTEGER} 26 | 27 | 28 | insert into o_return_payment (id, return_code, payment_type_id, 29 | payment_type_name, return_money, create_person, 30 | create_date) 31 | values (#{id,jdbcType=INTEGER}, #{returnCode,jdbcType=VARCHAR}, #{paymentTypeId,jdbcType=TINYINT}, 32 | #{paymentTypeName,jdbcType=VARCHAR}, #{returnMoney,jdbcType=DECIMAL}, #{createPerson,jdbcType=VARCHAR}, 33 | #{createDate,jdbcType=TIMESTAMP}) 34 | 35 | 36 | insert into o_return_payment 37 | 38 | 39 | id, 40 | 41 | 42 | return_code, 43 | 44 | 45 | payment_type_id, 46 | 47 | 48 | payment_type_name, 49 | 50 | 51 | return_money, 52 | 53 | 54 | create_person, 55 | 56 | 57 | create_date, 58 | 59 | 60 | 61 | 62 | #{id,jdbcType=INTEGER}, 63 | 64 | 65 | #{returnCode,jdbcType=VARCHAR}, 66 | 67 | 68 | #{paymentTypeId,jdbcType=TINYINT}, 69 | 70 | 71 | #{paymentTypeName,jdbcType=VARCHAR}, 72 | 73 | 74 | #{returnMoney,jdbcType=DECIMAL}, 75 | 76 | 77 | #{createPerson,jdbcType=VARCHAR}, 78 | 79 | 80 | #{createDate,jdbcType=TIMESTAMP}, 81 | 82 | 83 | 84 | 85 | update o_return_payment 86 | 87 | 88 | return_code = #{returnCode,jdbcType=VARCHAR}, 89 | 90 | 91 | payment_type_id = #{paymentTypeId,jdbcType=TINYINT}, 92 | 93 | 94 | payment_type_name = #{paymentTypeName,jdbcType=VARCHAR}, 95 | 96 | 97 | return_money = #{returnMoney,jdbcType=DECIMAL}, 98 | 99 | 100 | create_person = #{createPerson,jdbcType=VARCHAR}, 101 | 102 | 103 | create_date = #{createDate,jdbcType=TIMESTAMP}, 104 | 105 | 106 | where id = #{id,jdbcType=INTEGER} 107 | 108 | 109 | update o_return_payment 110 | set return_code = #{returnCode,jdbcType=VARCHAR}, 111 | payment_type_id = #{paymentTypeId,jdbcType=TINYINT}, 112 | payment_type_name = #{paymentTypeName,jdbcType=VARCHAR}, 113 | return_money = #{returnMoney,jdbcType=DECIMAL}, 114 | create_person = #{createPerson,jdbcType=VARCHAR}, 115 | create_date = #{createDate,jdbcType=TIMESTAMP} 116 | where id = #{id,jdbcType=INTEGER} 117 | 118 | -------------------------------------------------------------------------------- /config_order.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /order-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cl 7 | order 8 | 1.0.0-SNAPSHOT 9 | 10 | order-server 11 | order-server 12 | war 13 | 14 | 15 | UTF-8 16 | 4.0.6.RELEASE 17 | 18 | 19 | 20 | 21 | 22 | cl 23 | privilege-api 24 | 1.0.0-SNAPSHOT 25 | 26 | 27 | cl 28 | order-data 29 | 1.0.0-SNAPSHOT 30 | 31 | 32 | cl 33 | order-api 34 | 1.0.0-SNAPSHOT 35 | 36 | 37 | 38 | org.jasig.cas.client 39 | cas-client-core 40 | 3.2.1-SNAPSHOT 41 | 42 | 43 | 44 | log4j 45 | log4j 46 | 1.2.16 47 | 48 | 49 | org.slf4j 50 | slf4j-api 51 | 1.6.1 52 | 53 | 54 | org.slf4j 55 | slf4j-log4j12 56 | 1.6.1 57 | 58 | 59 | 60 | org.springframework 61 | spring-core 62 | ${spring.version} 63 | 64 | 65 | org.springframework 66 | spring-beans 67 | ${spring.version} 68 | 69 | 70 | org.springframework 71 | spring-context 72 | ${spring.version} 73 | 74 | 75 | org.springframework 76 | spring-context-support 77 | ${spring.version} 78 | 79 | 80 | org.springframework 81 | spring-web 82 | ${spring.version} 83 | 84 | 85 | org.springframework 86 | spring-webmvc 87 | ${spring.version} 88 | 89 | 90 | org.springframework 91 | spring-aspects 92 | ${spring.version} 93 | 94 | 95 | org.springframework 96 | spring-jdbc 97 | ${spring.version} 98 | 99 | 100 | org.springframework.data 101 | spring-data-redis 102 | 1.3.1.RELEASE 103 | 104 | 105 | 106 | com.alibaba 107 | dubbo 108 | 2.5.3 109 | 110 | 111 | org.springframework 112 | spring 113 | 114 | 115 | netty 116 | org.jboss.netty 117 | 118 | 119 | 120 | 121 | com.github.sgroschupf 122 | zkclient 123 | 0.1 124 | 125 | 126 | 127 | com.caucho 128 | hessian 129 | 4.0.7 130 | 131 | 132 | 133 | org.freemarker 134 | freemarker 135 | 2.3.16 136 | 137 | 138 | 139 | javax.servlet 140 | servlet-api 141 | 2.5 142 | provided 143 | 144 | 145 | jstl 146 | jstl 147 | 1.1.2 148 | 149 | 150 | 151 | commons-beanutils 152 | commons-beanutils 153 | 1.8.3 154 | 155 | 156 | commons-lang 157 | commons-lang 158 | 2.5 159 | 160 | 161 | -------------------------------------------------------------------------------- /order-model/src/main/java/com/cl/order/model/book/OrderForm.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.model.book; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | public class OrderForm { 7 | private String formCode; 8 | 9 | private String mainFormCode; 10 | 11 | private Integer memberId; 12 | 13 | private Integer consigneeId; 14 | 15 | private BigDecimal totalPrice; 16 | 17 | private BigDecimal goodsPrice; 18 | 19 | private BigDecimal deliverPrice; 20 | 21 | private BigDecimal paidPrice; 22 | 23 | private Integer warehouseId; 24 | 25 | private String warehouseName; 26 | 27 | private Byte deliverTypeId; 28 | 29 | private String deliverTypeName; 30 | 31 | private Integer expressId; 32 | 33 | private String expressName; 34 | 35 | private Byte paymentTypeId; 36 | 37 | private String paymentTypeName; 38 | 39 | private Short quality; 40 | 41 | private Double weight; 42 | 43 | private Byte status; 44 | 45 | private Byte paymentStatus; 46 | 47 | private String createPerson; 48 | 49 | private Date createDate; 50 | 51 | private String updatePerson; 52 | 53 | private Date updateDate; 54 | 55 | public String getFormCode() { 56 | return formCode; 57 | } 58 | 59 | public void setFormCode(String formCode) { 60 | this.formCode = formCode; 61 | } 62 | 63 | public String getMainFormCode() { 64 | return mainFormCode; 65 | } 66 | 67 | public void setMainFormCode(String mainFormCode) { 68 | this.mainFormCode = mainFormCode; 69 | } 70 | 71 | public Integer getMemberId() { 72 | return memberId; 73 | } 74 | 75 | public void setMemberId(Integer memberId) { 76 | this.memberId = memberId; 77 | } 78 | 79 | public Integer getConsigneeId() { 80 | return consigneeId; 81 | } 82 | 83 | public void setConsigneeId(Integer consigneeId) { 84 | this.consigneeId = consigneeId; 85 | } 86 | 87 | public BigDecimal getTotalPrice() { 88 | return totalPrice; 89 | } 90 | 91 | public void setTotalPrice(BigDecimal totalPrice) { 92 | this.totalPrice = totalPrice; 93 | } 94 | 95 | public BigDecimal getGoodsPrice() { 96 | return goodsPrice; 97 | } 98 | 99 | public void setGoodsPrice(BigDecimal goodsPrice) { 100 | this.goodsPrice = goodsPrice; 101 | } 102 | 103 | public BigDecimal getDeliverPrice() { 104 | return deliverPrice; 105 | } 106 | 107 | public void setDeliverPrice(BigDecimal deliverPrice) { 108 | this.deliverPrice = deliverPrice; 109 | } 110 | 111 | public BigDecimal getPaidPrice() { 112 | return paidPrice; 113 | } 114 | 115 | public void setPaidPrice(BigDecimal paidPrice) { 116 | this.paidPrice = paidPrice; 117 | } 118 | 119 | public Integer getWarehouseId() { 120 | return warehouseId; 121 | } 122 | 123 | public void setWarehouseId(Integer warehouseId) { 124 | this.warehouseId = warehouseId; 125 | } 126 | 127 | public String getWarehouseName() { 128 | return warehouseName; 129 | } 130 | 131 | public void setWarehouseName(String warehouseName) { 132 | this.warehouseName = warehouseName; 133 | } 134 | 135 | public Byte getDeliverTypeId() { 136 | return deliverTypeId; 137 | } 138 | 139 | public void setDeliverTypeId(Byte deliverTypeId) { 140 | this.deliverTypeId = deliverTypeId; 141 | } 142 | 143 | public String getDeliverTypeName() { 144 | return deliverTypeName; 145 | } 146 | 147 | public void setDeliverTypeName(String deliverTypeName) { 148 | this.deliverTypeName = deliverTypeName; 149 | } 150 | 151 | public Integer getExpressId() { 152 | return expressId; 153 | } 154 | 155 | public void setExpressId(Integer expressId) { 156 | this.expressId = expressId; 157 | } 158 | 159 | public String getExpressName() { 160 | return expressName; 161 | } 162 | 163 | public void setExpressName(String expressName) { 164 | this.expressName = expressName; 165 | } 166 | 167 | public Byte getPaymentTypeId() { 168 | return paymentTypeId; 169 | } 170 | 171 | public void setPaymentTypeId(Byte paymentTypeId) { 172 | this.paymentTypeId = paymentTypeId; 173 | } 174 | 175 | public String getPaymentTypeName() { 176 | return paymentTypeName; 177 | } 178 | 179 | public void setPaymentTypeName(String paymentTypeName) { 180 | this.paymentTypeName = paymentTypeName; 181 | } 182 | 183 | public Short getQuality() { 184 | return quality; 185 | } 186 | 187 | public void setQuality(Short quality) { 188 | this.quality = quality; 189 | } 190 | 191 | public Double getWeight() { 192 | return weight; 193 | } 194 | 195 | public void setWeight(Double weight) { 196 | this.weight = weight; 197 | } 198 | 199 | public Byte getStatus() { 200 | return status; 201 | } 202 | 203 | public void setStatus(Byte status) { 204 | this.status = status; 205 | } 206 | 207 | public Byte getPaymentStatus() { 208 | return paymentStatus; 209 | } 210 | 211 | public void setPaymentStatus(Byte paymentStatus) { 212 | this.paymentStatus = paymentStatus; 213 | } 214 | 215 | public String getCreatePerson() { 216 | return createPerson; 217 | } 218 | 219 | public void setCreatePerson(String createPerson) { 220 | this.createPerson = createPerson; 221 | } 222 | 223 | public Date getCreateDate() { 224 | return createDate; 225 | } 226 | 227 | public void setCreateDate(Date createDate) { 228 | this.createDate = createDate; 229 | } 230 | 231 | public String getUpdatePerson() { 232 | return updatePerson; 233 | } 234 | 235 | public void setUpdatePerson(String updatePerson) { 236 | this.updatePerson = updatePerson; 237 | } 238 | 239 | public Date getUpdateDate() { 240 | return updateDate; 241 | } 242 | 243 | public void setUpdateDate(Date updateDate) { 244 | this.updateDate = updateDate; 245 | } 246 | } -------------------------------------------------------------------------------- /order-server/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | Spring公共配置 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | classpath*:/config.properties 48 | 49 | file:/d:/conf/cl/order-server/*.properties 50 | 51 | file:/etc/conf/cl/order-server/*.properties 52 | 53 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 64 | 0 65 | zh_CN 66 | UTF-8 67 | UTF-8 68 | rethrow 69 | #.## 70 | yyyy-MM-dd 71 | HH:mm:ss 72 | yyyy-MM-dd HH:mm:ss 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /order-server/src/main/webapp/scripts/custom/cl.js: -------------------------------------------------------------------------------- 1 | var Cl = function() { 2 | return { 3 | action: "", 4 | selected: {}, 5 | tableName: "datatable_cl", 6 | modalName: "modal_cl", 7 | formName: "form_cl", 8 | treeName: "tree_cl", 9 | ajaxRequest: function (url,reqParam,callback) { 10 | $.ajax({ 11 | type: 'POST', 12 | url: url, 13 | data: reqParam, 14 | cache: false, 15 | success: callback 16 | }); 17 | }, 18 | refreshDataTable: function(name) { 19 | var oTable = $('#'+name).dataTable(); 20 | oTable.fnDraw(); 21 | }, 22 | updateDataRow: function(tableName,id,idindex,url) { 23 | var data={ 24 | "id":id 25 | }; 26 | Cl.ajaxRequest(url,data,function(result){ 27 | if(!result) return ; 28 | //result = result.replace(/(^\s*)|(\s*$)/g,''); 29 | var oTable = $('#'+tableName).dataTable(); 30 | var nNodes = oTable.fnGetNodes(); 31 | for(var i=0;i' + 61 | '
' + 62 | '
' + 63 | '
' + 64 | ''; 65 | $.fn.modalmanager.defaults.resize = true; 66 | $("
").appendTo($('body')); 67 | }, 68 | showModalWindow: function(modalName,url) { 69 | var $modal = $('#'+modalName); 70 | $('body').modalmanager('loading'); 71 | setTimeout(function(){ 72 | $modal.load(url, '', function(){ 73 | $modal.modal(); 74 | }); 75 | }, 1000); 76 | }, 77 | hideModalWindow: function(modalDiv) { 78 | var $modal = $('#'+modalDiv); 79 | $modal.modal("hide") 80 | }, 81 | initModifyPassword: function(url) 82 | { 83 | var handleValidation = function() { 84 | // for more info visit the official plugin documentation: 85 | // http://docs.jquery.com/Plugins/Validation 86 | var form1 = $('#form_cl_mp'); 87 | var error1 = $('.alert-danger', form1); 88 | var success1 = $('.alert-success', form1); 89 | form1.validate({ 90 | errorElement: 'span', //default input error message container 91 | errorClass: 'help-block', // default input error message class 92 | focusInvalid: false, // do not focus the last invalid input 93 | ignore: "", 94 | rules: { 95 | oldpassword: { 96 | minlength: 2, 97 | required: true 98 | }, 99 | password: { 100 | minlength: 2, 101 | required: true 102 | }, 103 | confirmpassword: { 104 | minlength: 2, 105 | required: true, 106 | equalTo: "#password" 107 | } 108 | }, 109 | invalidHandler: function (event, validator) { //display error alert on form submit 110 | success1.hide(); 111 | error1.show(); 112 | App.scrollTo(error1, -200); 113 | }, 114 | highlight: function (element) { // hightlight error inputs 115 | $(element) 116 | .closest('.form-group').addClass('has-error'); // set error class to the control group 117 | }, 118 | unhighlight: function (element) { // revert the change done by hightlight 119 | $(element) 120 | .closest('.form-group').removeClass('has-error'); // set error class to the control group 121 | }, 122 | success: function (label) { 123 | label 124 | .closest('.form-group').removeClass('has-error'); // set success class to the control group 125 | }, 126 | submitHandler: function (form) { 127 | modify(); 128 | } 129 | }); 130 | } 131 | var handleWysihtml5 = function() { 132 | if (!jQuery().wysihtml5) { 133 | return; 134 | } 135 | if ($('.wysihtml5').size() > 0) { 136 | $('.wysihtml5').wysihtml5({ 137 | "stylesheets": ["http://127.0.0.1/privilege_inc/assets/plugins/bootstrap-wysihtml5/wysiwyg-color.css"] 138 | }); 139 | } 140 | } 141 | var modify = function() { 142 | var data={ 143 | "oldpassword":$("#oldpassword").val(), 144 | "password": $("#password").val() 145 | }; 146 | Cl.ajaxRequest(url,data,function(result){ 147 | if(!result) return ; 148 | result = result.replace(/(^\s*)|(\s*$)/g,''); 149 | if(result == "success"){ 150 | alert("修改成功"); 151 | Cl.hideModalWindow(Cl.modalName); 152 | } else { 153 | alert("旧密码输入错误"); 154 | return ; 155 | } 156 | }); 157 | } 158 | 159 | handleWysihtml5(); 160 | handleValidation(); 161 | } 162 | }; 163 | }(); -------------------------------------------------------------------------------- /order-server/src/main/webapp/WEB-INF/ftl/main.ftl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 创力 | 订单中心 - 主页 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | <#include "header.ftl" > 48 | 49 |
50 |
51 | 52 | 53 |
54 | 55 | <#include "sidebar.ftl" > 56 | 57 | 58 |
59 |
60 | 61 |
62 |
63 | 64 |

65 | 订单中心 66 |

67 | 81 | 82 |
83 |
84 | 85 | 86 |
87 |
88 |
89 |
90 |
91 | 订单中心 92 |
93 |
94 |
95 | <#if hours?? && (hours < 12 && hours >= 5 ) > 96 | 上午好! 97 | <#elseif hours?? && (hours >= 12 && hours < 18 )> 98 | 下午好! 99 | <#else> 100 | 晚上好! 101 | 102 | ${user.fullname?default("")} 103 |
104 |
105 |
106 |
107 | 108 |
109 |
110 | 111 |
112 | 113 | 114 | <#include "footer.ftl" > 115 | 116 | 117 | 118 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/aftersales/RefundFormMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | refund_code, form_code, return_code, member_id, refund_type_id, payment_type_id, 20 | refund_money, status, create_person, create_date, update_person, update_date 21 | 22 | 28 | 29 | delete from o_refund_form 30 | where refund_code = #{refundCode,jdbcType=VARCHAR} 31 | 32 | 33 | insert into o_refund_form (refund_code, form_code, return_code, 34 | member_id, refund_type_id, payment_type_id, 35 | refund_money, status, create_person, 36 | create_date, update_person, update_date 37 | ) 38 | values (#{refundCode,jdbcType=VARCHAR}, #{formCode,jdbcType=VARCHAR}, #{returnCode,jdbcType=VARCHAR}, 39 | #{memberId,jdbcType=INTEGER}, #{refundTypeId,jdbcType=TINYINT}, #{paymentTypeId,jdbcType=TINYINT}, 40 | #{refundMoney,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT}, #{createPerson,jdbcType=VARCHAR}, 41 | #{createDate,jdbcType=TIMESTAMP}, #{updatePerson,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP} 42 | ) 43 | 44 | 45 | insert into o_refund_form 46 | 47 | 48 | refund_code, 49 | 50 | 51 | form_code, 52 | 53 | 54 | return_code, 55 | 56 | 57 | member_id, 58 | 59 | 60 | refund_type_id, 61 | 62 | 63 | payment_type_id, 64 | 65 | 66 | refund_money, 67 | 68 | 69 | status, 70 | 71 | 72 | create_person, 73 | 74 | 75 | create_date, 76 | 77 | 78 | update_person, 79 | 80 | 81 | update_date, 82 | 83 | 84 | 85 | 86 | #{refundCode,jdbcType=VARCHAR}, 87 | 88 | 89 | #{formCode,jdbcType=VARCHAR}, 90 | 91 | 92 | #{returnCode,jdbcType=VARCHAR}, 93 | 94 | 95 | #{memberId,jdbcType=INTEGER}, 96 | 97 | 98 | #{refundTypeId,jdbcType=TINYINT}, 99 | 100 | 101 | #{paymentTypeId,jdbcType=TINYINT}, 102 | 103 | 104 | #{refundMoney,jdbcType=DECIMAL}, 105 | 106 | 107 | #{status,jdbcType=TINYINT}, 108 | 109 | 110 | #{createPerson,jdbcType=VARCHAR}, 111 | 112 | 113 | #{createDate,jdbcType=TIMESTAMP}, 114 | 115 | 116 | #{updatePerson,jdbcType=VARCHAR}, 117 | 118 | 119 | #{updateDate,jdbcType=TIMESTAMP}, 120 | 121 | 122 | 123 | 124 | update o_refund_form 125 | 126 | 127 | form_code = #{formCode,jdbcType=VARCHAR}, 128 | 129 | 130 | return_code = #{returnCode,jdbcType=VARCHAR}, 131 | 132 | 133 | member_id = #{memberId,jdbcType=INTEGER}, 134 | 135 | 136 | refund_type_id = #{refundTypeId,jdbcType=TINYINT}, 137 | 138 | 139 | payment_type_id = #{paymentTypeId,jdbcType=TINYINT}, 140 | 141 | 142 | refund_money = #{refundMoney,jdbcType=DECIMAL}, 143 | 144 | 145 | status = #{status,jdbcType=TINYINT}, 146 | 147 | 148 | create_person = #{createPerson,jdbcType=VARCHAR}, 149 | 150 | 151 | create_date = #{createDate,jdbcType=TIMESTAMP}, 152 | 153 | 154 | update_person = #{updatePerson,jdbcType=VARCHAR}, 155 | 156 | 157 | update_date = #{updateDate,jdbcType=TIMESTAMP}, 158 | 159 | 160 | where refund_code = #{refundCode,jdbcType=VARCHAR} 161 | 162 | 163 | update o_refund_form 164 | set form_code = #{formCode,jdbcType=VARCHAR}, 165 | return_code = #{returnCode,jdbcType=VARCHAR}, 166 | member_id = #{memberId,jdbcType=INTEGER}, 167 | refund_type_id = #{refundTypeId,jdbcType=TINYINT}, 168 | payment_type_id = #{paymentTypeId,jdbcType=TINYINT}, 169 | refund_money = #{refundMoney,jdbcType=DECIMAL}, 170 | status = #{status,jdbcType=TINYINT}, 171 | create_person = #{createPerson,jdbcType=VARCHAR}, 172 | create_date = #{createDate,jdbcType=TIMESTAMP}, 173 | update_person = #{updatePerson,jdbcType=VARCHAR}, 174 | update_date = #{updateDate,jdbcType=TIMESTAMP} 175 | where refund_code = #{refundCode,jdbcType=VARCHAR} 176 | 177 | -------------------------------------------------------------------------------- /order-server/src/main/resources/log4j.dtd: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | 69 | 70 | 71 | 74 | 78 | 79 | 80 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 96 | 97 | 98 | 99 | 100 | 103 | 104 | 105 | 109 | 110 | 111 | 112 | 113 | 117 | 118 | 119 | 120 | 124 | 125 | 126 | 127 | 128 | 129 | 134 | 135 | 136 | 137 | 138 | 143 | 144 | 145 | 146 | 148 | 149 | 150 | 152 | 153 | 154 | 157 | 158 | 159 | 160 | 164 | 165 | 166 | 169 | 170 | 171 | 174 | 175 | 176 | 180 | 181 | 182 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 203 | 204 | 205 | 206 | 208 | 209 | 210 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 230 | 231 | 232 | 233 | 234 | 238 | -------------------------------------------------------------------------------- /order-api-server/src/main/resources/log4j.dtd: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | 69 | 70 | 71 | 74 | 78 | 79 | 80 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 96 | 97 | 98 | 99 | 100 | 103 | 104 | 105 | 109 | 110 | 111 | 112 | 113 | 117 | 118 | 119 | 120 | 124 | 125 | 126 | 127 | 128 | 129 | 134 | 135 | 136 | 137 | 138 | 143 | 144 | 145 | 146 | 148 | 149 | 150 | 152 | 153 | 154 | 157 | 158 | 159 | 160 | 164 | 165 | 166 | 169 | 170 | 171 | 174 | 175 | 176 | 180 | 181 | 182 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 203 | 204 | 205 | 206 | 208 | 209 | 210 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 230 | 231 | 232 | 233 | 234 | 238 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/book/OrderDetailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | id, form_code, commodity_no, commodity_name, product_no, size, sell_price, discount, 22 | quality, return_quality, create_person, create_date, update_person, update_date 23 | 24 | 30 | 31 | delete from o_order_detail 32 | where id = #{id,jdbcType=INTEGER} 33 | 34 | 35 | insert into o_order_detail (id, form_code, commodity_no, 36 | commodity_name, product_no, size, 37 | sell_price, discount, quality, 38 | return_quality, create_person, create_date, 39 | update_person, update_date) 40 | values (#{id,jdbcType=INTEGER}, #{formCode,jdbcType=VARCHAR}, #{commodityNo,jdbcType=VARCHAR}, 41 | #{commodityName,jdbcType=VARCHAR}, #{productNo,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR}, 42 | #{sellPrice,jdbcType=DECIMAL}, #{discount,jdbcType=DECIMAL}, #{quality,jdbcType=SMALLINT}, 43 | #{returnQuality,jdbcType=SMALLINT}, #{createPerson,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 44 | #{updatePerson,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP}) 45 | 46 | 47 | insert into o_order_detail 48 | 49 | 50 | id, 51 | 52 | 53 | form_code, 54 | 55 | 56 | commodity_no, 57 | 58 | 59 | commodity_name, 60 | 61 | 62 | product_no, 63 | 64 | 65 | size, 66 | 67 | 68 | sell_price, 69 | 70 | 71 | discount, 72 | 73 | 74 | quality, 75 | 76 | 77 | return_quality, 78 | 79 | 80 | create_person, 81 | 82 | 83 | create_date, 84 | 85 | 86 | update_person, 87 | 88 | 89 | update_date, 90 | 91 | 92 | 93 | 94 | #{id,jdbcType=INTEGER}, 95 | 96 | 97 | #{formCode,jdbcType=VARCHAR}, 98 | 99 | 100 | #{commodityNo,jdbcType=VARCHAR}, 101 | 102 | 103 | #{commodityName,jdbcType=VARCHAR}, 104 | 105 | 106 | #{productNo,jdbcType=VARCHAR}, 107 | 108 | 109 | #{size,jdbcType=VARCHAR}, 110 | 111 | 112 | #{sellPrice,jdbcType=DECIMAL}, 113 | 114 | 115 | #{discount,jdbcType=DECIMAL}, 116 | 117 | 118 | #{quality,jdbcType=SMALLINT}, 119 | 120 | 121 | #{returnQuality,jdbcType=SMALLINT}, 122 | 123 | 124 | #{createPerson,jdbcType=VARCHAR}, 125 | 126 | 127 | #{createDate,jdbcType=TIMESTAMP}, 128 | 129 | 130 | #{updatePerson,jdbcType=VARCHAR}, 131 | 132 | 133 | #{updateDate,jdbcType=TIMESTAMP}, 134 | 135 | 136 | 137 | 138 | update o_order_detail 139 | 140 | 141 | form_code = #{formCode,jdbcType=VARCHAR}, 142 | 143 | 144 | commodity_no = #{commodityNo,jdbcType=VARCHAR}, 145 | 146 | 147 | commodity_name = #{commodityName,jdbcType=VARCHAR}, 148 | 149 | 150 | product_no = #{productNo,jdbcType=VARCHAR}, 151 | 152 | 153 | size = #{size,jdbcType=VARCHAR}, 154 | 155 | 156 | sell_price = #{sellPrice,jdbcType=DECIMAL}, 157 | 158 | 159 | discount = #{discount,jdbcType=DECIMAL}, 160 | 161 | 162 | quality = #{quality,jdbcType=SMALLINT}, 163 | 164 | 165 | return_quality = #{returnQuality,jdbcType=SMALLINT}, 166 | 167 | 168 | create_person = #{createPerson,jdbcType=VARCHAR}, 169 | 170 | 171 | create_date = #{createDate,jdbcType=TIMESTAMP}, 172 | 173 | 174 | update_person = #{updatePerson,jdbcType=VARCHAR}, 175 | 176 | 177 | update_date = #{updateDate,jdbcType=TIMESTAMP}, 178 | 179 | 180 | where id = #{id,jdbcType=INTEGER} 181 | 182 | 183 | update o_order_detail 184 | set form_code = #{formCode,jdbcType=VARCHAR}, 185 | commodity_no = #{commodityNo,jdbcType=VARCHAR}, 186 | commodity_name = #{commodityName,jdbcType=VARCHAR}, 187 | product_no = #{productNo,jdbcType=VARCHAR}, 188 | size = #{size,jdbcType=VARCHAR}, 189 | sell_price = #{sellPrice,jdbcType=DECIMAL}, 190 | discount = #{discount,jdbcType=DECIMAL}, 191 | quality = #{quality,jdbcType=SMALLINT}, 192 | return_quality = #{returnQuality,jdbcType=SMALLINT}, 193 | create_person = #{createPerson,jdbcType=VARCHAR}, 194 | create_date = #{createDate,jdbcType=TIMESTAMP}, 195 | update_person = #{updatePerson,jdbcType=VARCHAR}, 196 | update_date = #{updateDate,jdbcType=TIMESTAMP} 197 | where id = #{id,jdbcType=INTEGER} 198 | 199 | -------------------------------------------------------------------------------- /order-data/src/main/resources/com/cl/order/mapper/book/OrderMainDetailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | id, form_code, commodity_no, commodity_name, product_no, size, sell_price, discount, 22 | quality, return_quality, create_person, create_date, update_person, update_date 23 | 24 | 30 | 31 | delete from o_order_main_detail 32 | where id = #{id,jdbcType=INTEGER} 33 | 34 | 35 | insert into o_order_main_detail (id, form_code, commodity_no, 36 | commodity_name, product_no, size, 37 | sell_price, discount, quality, 38 | return_quality, create_person, create_date, 39 | update_person, update_date) 40 | values (#{id,jdbcType=INTEGER}, #{formCode,jdbcType=VARCHAR}, #{commodityNo,jdbcType=VARCHAR}, 41 | #{commodityName,jdbcType=VARCHAR}, #{productNo,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR}, 42 | #{sellPrice,jdbcType=DECIMAL}, #{discount,jdbcType=DECIMAL}, #{quality,jdbcType=SMALLINT}, 43 | #{returnQuality,jdbcType=SMALLINT}, #{createPerson,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 44 | #{updatePerson,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP}) 45 | 46 | 47 | insert into o_order_main_detail 48 | 49 | 50 | id, 51 | 52 | 53 | form_code, 54 | 55 | 56 | commodity_no, 57 | 58 | 59 | commodity_name, 60 | 61 | 62 | product_no, 63 | 64 | 65 | size, 66 | 67 | 68 | sell_price, 69 | 70 | 71 | discount, 72 | 73 | 74 | quality, 75 | 76 | 77 | return_quality, 78 | 79 | 80 | create_person, 81 | 82 | 83 | create_date, 84 | 85 | 86 | update_person, 87 | 88 | 89 | update_date, 90 | 91 | 92 | 93 | 94 | #{id,jdbcType=INTEGER}, 95 | 96 | 97 | #{formCode,jdbcType=VARCHAR}, 98 | 99 | 100 | #{commodityNo,jdbcType=VARCHAR}, 101 | 102 | 103 | #{commodityName,jdbcType=VARCHAR}, 104 | 105 | 106 | #{productNo,jdbcType=VARCHAR}, 107 | 108 | 109 | #{size,jdbcType=VARCHAR}, 110 | 111 | 112 | #{sellPrice,jdbcType=DECIMAL}, 113 | 114 | 115 | #{discount,jdbcType=DECIMAL}, 116 | 117 | 118 | #{quality,jdbcType=SMALLINT}, 119 | 120 | 121 | #{returnQuality,jdbcType=SMALLINT}, 122 | 123 | 124 | #{createPerson,jdbcType=VARCHAR}, 125 | 126 | 127 | #{createDate,jdbcType=TIMESTAMP}, 128 | 129 | 130 | #{updatePerson,jdbcType=VARCHAR}, 131 | 132 | 133 | #{updateDate,jdbcType=TIMESTAMP}, 134 | 135 | 136 | 137 | 138 | update o_order_main_detail 139 | 140 | 141 | form_code = #{formCode,jdbcType=VARCHAR}, 142 | 143 | 144 | commodity_no = #{commodityNo,jdbcType=VARCHAR}, 145 | 146 | 147 | commodity_name = #{commodityName,jdbcType=VARCHAR}, 148 | 149 | 150 | product_no = #{productNo,jdbcType=VARCHAR}, 151 | 152 | 153 | size = #{size,jdbcType=VARCHAR}, 154 | 155 | 156 | sell_price = #{sellPrice,jdbcType=DECIMAL}, 157 | 158 | 159 | discount = #{discount,jdbcType=DECIMAL}, 160 | 161 | 162 | quality = #{quality,jdbcType=SMALLINT}, 163 | 164 | 165 | return_quality = #{returnQuality,jdbcType=SMALLINT}, 166 | 167 | 168 | create_person = #{createPerson,jdbcType=VARCHAR}, 169 | 170 | 171 | create_date = #{createDate,jdbcType=TIMESTAMP}, 172 | 173 | 174 | update_person = #{updatePerson,jdbcType=VARCHAR}, 175 | 176 | 177 | update_date = #{updateDate,jdbcType=TIMESTAMP}, 178 | 179 | 180 | where id = #{id,jdbcType=INTEGER} 181 | 182 | 183 | update o_order_main_detail 184 | set form_code = #{formCode,jdbcType=VARCHAR}, 185 | commodity_no = #{commodityNo,jdbcType=VARCHAR}, 186 | commodity_name = #{commodityName,jdbcType=VARCHAR}, 187 | product_no = #{productNo,jdbcType=VARCHAR}, 188 | size = #{size,jdbcType=VARCHAR}, 189 | sell_price = #{sellPrice,jdbcType=DECIMAL}, 190 | discount = #{discount,jdbcType=DECIMAL}, 191 | quality = #{quality,jdbcType=SMALLINT}, 192 | return_quality = #{returnQuality,jdbcType=SMALLINT}, 193 | create_person = #{createPerson,jdbcType=VARCHAR}, 194 | create_date = #{createDate,jdbcType=TIMESTAMP}, 195 | update_person = #{updatePerson,jdbcType=VARCHAR}, 196 | update_date = #{updateDate,jdbcType=TIMESTAMP} 197 | where id = #{id,jdbcType=INTEGER} 198 | 199 | -------------------------------------------------------------------------------- /order-server/src/main/java/com/cl/order/utils/ReflectionUtil.java: -------------------------------------------------------------------------------- 1 | package com.cl.order.utils; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.InvocationTargetException; 5 | import java.lang.reflect.Method; 6 | import java.lang.reflect.Modifier; 7 | import java.lang.reflect.ParameterizedType; 8 | import java.lang.reflect.Type; 9 | import java.util.ArrayList; 10 | import java.util.Collection; 11 | import java.util.Date; 12 | import java.util.Iterator; 13 | import java.util.List; 14 | 15 | import org.apache.commons.beanutils.ConvertUtils; 16 | import org.apache.commons.beanutils.PropertyUtils; 17 | import org.apache.commons.beanutils.converters.DateConverter; 18 | import org.apache.commons.lang.StringUtils; 19 | import org.apache.log4j.Logger; 20 | import org.springframework.util.Assert; 21 | 22 | @SuppressWarnings("rawtypes") 23 | public class ReflectionUtil 24 | { 25 | private static Logger logger = Logger.getLogger(ReflectionUtil.class); 26 | 27 | public static Object invokeGetterMethod(Object target, String propertyName) 28 | { 29 | String getterMethodName = "get" + StringUtils.capitalize(propertyName); 30 | return invokeMethod(target, getterMethodName, new Class[0], new Object[0]); 31 | } 32 | 33 | public static void invokeSetterMethod(Object target, String propertyName, Object value) 34 | { 35 | invokeSetterMethod(target, propertyName, value, null); 36 | } 37 | 38 | public static void invokeSetterMethod(Object target, String propertyName, Object value, Class propertyType) 39 | { 40 | 41 | Class type = (propertyType != null) ? propertyType : value.getClass(); 42 | String setterMethodName = "set" + StringUtils.capitalize(propertyName); 43 | invokeMethod(target, setterMethodName, new Class[] { type }, new Object[] { value }); 44 | } 45 | 46 | public static Object getFieldValue(Object object, String fieldName) 47 | { 48 | Field field = getDeclaredField(object, fieldName); 49 | 50 | if (field == null) { 51 | throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + object + "]"); 52 | } 53 | 54 | makeAccessible(field); 55 | 56 | Object result = null; 57 | try { 58 | result = field.get(object); 59 | } catch (IllegalAccessException e) { 60 | logger.error("不可能抛出的异常{}", e); 61 | } 62 | return result; 63 | } 64 | 65 | public static void setFieldValue(Object object, String fieldName, Object value) 66 | { 67 | Field field = getDeclaredField(object, fieldName); 68 | 69 | if (field == null) { 70 | throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + object + "]"); 71 | } 72 | 73 | makeAccessible(field); 74 | try 75 | { 76 | field.set(object, value); 77 | } catch (IllegalAccessException e) { 78 | logger.error("不可能抛出的异常:{}"); 79 | } 80 | } 81 | 82 | public static void setFieldValueByFieldType(Object object, String fieldName, Object value) 83 | { 84 | Field field = getDeclaredField(object, fieldName); 85 | 86 | if (field == null) { 87 | throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + object + "]"); 88 | } 89 | setFieldValue(object, fieldName, convertStringToObject((String)value, field.getType())); 90 | } 91 | 92 | public static Object invokeMethod(Object object, String methodName, Class[] parameterTypes, Object[] parameters) 93 | { 94 | Method method = getDeclaredMethod(object, methodName, parameterTypes); 95 | if (method == null) { 96 | throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + object + "]"); 97 | } 98 | 99 | method.setAccessible(true); 100 | try 101 | { 102 | return method.invoke(object, parameters); 103 | } catch (Exception e) { 104 | throw convertReflectionExceptionToUnchecked(e); 105 | } 106 | } 107 | 108 | public static Field getDeclaredField(Object object, String fieldName) 109 | { 110 | Assert.notNull(object, "object不能为空"); 111 | Assert.hasText(fieldName, "fieldName"); 112 | for (Class superClass = object.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) 113 | try 114 | { 115 | return superClass.getDeclaredField(fieldName); 116 | } 117 | catch (NoSuchFieldException e) 118 | { 119 | } 120 | return null; 121 | } 122 | 123 | protected static void makeAccessible(Field field) 124 | { 125 | if ((!(Modifier.isPublic(field.getModifiers()))) || (!(Modifier.isPublic(field.getDeclaringClass().getModifiers())))) 126 | field.setAccessible(true); 127 | } 128 | 129 | @SuppressWarnings("unchecked") 130 | protected static Method getDeclaredMethod(Object object, String methodName, Class[] parameterTypes) 131 | { 132 | Assert.notNull(object, "object不能为空"); 133 | 134 | for (Class superClass = object.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) 135 | try 136 | { 137 | return superClass.getDeclaredMethod(methodName, parameterTypes); 138 | } 139 | catch (NoSuchMethodException e) 140 | { 141 | } 142 | return null; 143 | } 144 | 145 | @SuppressWarnings("unchecked") 146 | public static Class getSuperClassGenricType(Class clazz) 147 | { 148 | return getSuperClassGenricType(clazz, 0); 149 | } 150 | 151 | public static Class getSuperClassGenricType(Class clazz, int index) 152 | { 153 | Type genType = clazz.getGenericSuperclass(); 154 | 155 | if (!(genType instanceof ParameterizedType)) { 156 | logger.warn(clazz.getSimpleName() + "'s superclass not ParameterizedType"); 157 | return Object.class; 158 | } 159 | 160 | Type[] params = ((ParameterizedType)genType).getActualTypeArguments(); 161 | 162 | if ((index >= params.length) || (index < 0)) { 163 | logger.warn("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + params.length); 164 | 165 | return Object.class; 166 | } 167 | if (!(params[index] instanceof Class)) { 168 | logger.warn(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); 169 | return Object.class; 170 | } 171 | 172 | return ((Class)params[index]); 173 | } 174 | 175 | public static List convertElementPropertyToList(Collection collection, String propertyName) 176 | { 177 | List list = new ArrayList(); 178 | Iterator i$; 179 | try { 180 | for (i$ = collection.iterator(); i$.hasNext(); ) { Object obj = i$.next(); 181 | list.add(PropertyUtils.getProperty(obj, propertyName)); 182 | } 183 | } catch (Exception e) { 184 | throw convertReflectionExceptionToUnchecked(e); 185 | } 186 | 187 | return list; 188 | } 189 | 190 | public static String convertElementPropertyToString(Collection collection, String propertyName, String separator) 191 | { 192 | List list = convertElementPropertyToList(collection, propertyName); 193 | return StringUtils.join(list, separator); 194 | } 195 | 196 | public static Object convertStringToObject(String value, Class toType) 197 | { 198 | try 199 | { 200 | DateConverter dc = new DateConverter(); 201 | dc.setUseLocaleFormat(true); 202 | dc.setPatterns(new String[] { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss" }); 203 | ConvertUtils.register(dc, Date.class); 204 | return ConvertUtils.convert(value, toType); 205 | } catch (Exception e) { 206 | throw convertReflectionExceptionToUnchecked(e); 207 | } 208 | } 209 | 210 | public static RuntimeException convertReflectionExceptionToUnchecked(Exception e) 211 | { 212 | if ((e instanceof IllegalAccessException) || (e instanceof IllegalArgumentException) || (e instanceof NoSuchMethodException)) 213 | { 214 | return new IllegalArgumentException("Reflection Exception.", e); } 215 | if (e instanceof InvocationTargetException) 216 | return new RuntimeException("Reflection Exception.", ((InvocationTargetException)e).getTargetException()); 217 | if (e instanceof RuntimeException) { 218 | return ((RuntimeException)e); 219 | } 220 | return new RuntimeException("Unexpected Checked Exception.", e); 221 | } 222 | 223 | static 224 | { 225 | DateConverter dc = new DateConverter(); 226 | dc.setUseLocaleFormat(true); 227 | dc.setPatterns(new String[] { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss" }); 228 | ConvertUtils.register(dc, Date.class); 229 | } 230 | } --------------------------------------------------------------------------------