Commit 78b60d9860ab691d10d45f44e8affd11a89bcab2
1 parent
30049c8123
Exists in
master
and in
6 other branches
添加优惠券类型 并吧原始数据全部设置为产检券 增加jetty插件运行项目
Showing 5 changed files with 83 additions and 9 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/CouponEnums.java
- platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java
- platform-operate-api/pom.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-common/src/main/java/com/lyms/platform/common/enums/CouponEnums.java
View file @
78b60d9
1 | +package com.lyms.platform.common.enums; | |
2 | + | |
3 | +/** | |
4 | + * @Author: litao | |
5 | + * @Date: 2017/4/19 | |
6 | + * @Version: V1.0 | |
7 | + */ | |
8 | +public enum CouponEnums { | |
9 | + | |
10 | + PRENATAL(1, "产检券"), | |
11 | + ANTENATAL(2, "产前券"), | |
12 | + POSTPARTUM(3, "产后券"), | |
13 | + REVIEW(4, "复查券"), | |
14 | + CHILD_HEALTH(5, "儿保券"); | |
15 | + | |
16 | + private Integer code; | |
17 | + private String name; | |
18 | + | |
19 | + CouponEnums(Integer code, String name) { | |
20 | + this.code = code; | |
21 | + this.name = name; | |
22 | + } | |
23 | + | |
24 | + public static CouponEnums get(Integer code) { | |
25 | + CouponEnums[] values = CouponEnums.values(); | |
26 | + for (CouponEnums value : values) { | |
27 | + if (value.getCode() == code) { | |
28 | + return value; | |
29 | + } | |
30 | + } | |
31 | + return null; | |
32 | + } | |
33 | + | |
34 | + public Integer getCode() { | |
35 | + return code; | |
36 | + } | |
37 | + | |
38 | + public String getName() { | |
39 | + return name; | |
40 | + } | |
41 | +} |
platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java
View file @
78b60d9
1 | 1 | package com.lyms.platform.pojo; |
2 | 2 | |
3 | 3 | import com.lyms.platform.beans.SerialIdEnum; |
4 | +import com.lyms.platform.common.enums.CouponEnums; | |
4 | 5 | import com.lyms.platform.common.result.BaseModel; |
5 | 6 | import org.springframework.data.mongodb.core.mapping.Document; |
6 | 7 | |
... | ... | @@ -22,6 +23,7 @@ |
22 | 23 | private Integer status; // 1:创建未使用, 2:产检使用,3:分娩销毁 4:建档删除 删除 |
23 | 24 | private Date created; |
24 | 25 | private Date consumeDate; |
26 | + private CouponEnums coupon; // 优惠券类型 | |
25 | 27 | |
26 | 28 | public String getPid() { |
27 | 29 | return pid; |
... | ... | @@ -85,6 +87,14 @@ |
85 | 87 | |
86 | 88 | public void setConsumeDate(Date consumeDate) { |
87 | 89 | this.consumeDate = consumeDate; |
90 | + } | |
91 | + | |
92 | + public CouponEnums getCoupon() { | |
93 | + return coupon; | |
94 | + } | |
95 | + | |
96 | + public void setCoupon(CouponEnums coupon) { | |
97 | + this.coupon = coupon; | |
88 | 98 | } |
89 | 99 | } |
platform-operate-api/pom.xml
View file @
78b60d9
... | ... | @@ -119,6 +119,19 @@ |
119 | 119 | <!-- 指定编码格式,否则在DOS下运行mvn命令时当发生文件资源copy时将使用系统默认使用GBK编码 --> |
120 | 120 | </configuration> |
121 | 121 | </plugin> |
122 | + | |
123 | + <!-- jetty插件 --> | |
124 | + <plugin> | |
125 | + <groupId>org.eclipse.jetty</groupId> | |
126 | + <artifactId>jetty-maven-plugin</artifactId> | |
127 | + <version>9.3.8.v20160314</version> | |
128 | + <configuration> | |
129 | + <webAppConfig> | |
130 | + <contextPath>/</contextPath> | |
131 | + </webAppConfig> | |
132 | + | |
133 | + </configuration> | |
134 | + </plugin> | |
122 | 135 | </plugins> |
123 | 136 | <finalName>platform-operate-api</finalName> |
124 | 137 | </build> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
78b60d9
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
5 | 5 | import com.lyms.platform.biz.JdbcUtil; |
6 | 6 | import com.lyms.platform.biz.service.*; |
7 | +import com.lyms.platform.common.enums.CouponEnums; | |
7 | 8 | import com.lyms.platform.common.enums.YnEnums; |
8 | 9 | import com.lyms.platform.common.utils.CompressEncodeingUtil; |
9 | 10 | import com.lyms.platform.common.utils.DateUtil; |
... | ... | @@ -16,10 +17,6 @@ |
16 | 17 | import com.lyms.platform.permission.service.OrganizationService; |
17 | 18 | import com.lyms.platform.pojo.*; |
18 | 19 | import com.lyms.platform.query.*; |
19 | -import com.lyms.platform.query.AntExChuQuery; | |
20 | -import com.lyms.platform.query.AntExQuery; | |
21 | -import com.lyms.platform.query.MatDeliverQuery; | |
22 | -import com.lyms.platform.query.PatientsQuery; | |
23 | 20 | import org.apache.commons.collections.CollectionUtils; |
24 | 21 | import org.apache.commons.io.FileUtils; |
25 | 22 | import org.apache.commons.lang.StringUtils; |
... | ... | @@ -1034,6 +1031,21 @@ |
1034 | 1031 | @ResponseBody |
1035 | 1032 | public String poll() { |
1036 | 1033 | return genIdService.poll("1234"); |
1034 | + } | |
1035 | + | |
1036 | + /** | |
1037 | + * 初始化优惠券的类型 全部设置位产检券 | |
1038 | + * @return | |
1039 | + */ | |
1040 | + @RequestMapping("/init/ticket") | |
1041 | + @ResponseBody | |
1042 | + public String initTicket() { | |
1043 | + List<PatientCheckTicket> tickets = mongoTemplate.findAll(PatientCheckTicket.class); | |
1044 | + for (PatientCheckTicket ticket : tickets) { | |
1045 | + ticket.setCoupon(CouponEnums.PRENATAL); | |
1046 | + mongoTemplate.save(ticket); | |
1047 | + } | |
1048 | + return "1"; | |
1037 | 1049 | } |
1038 | 1050 | |
1039 | 1051 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
78b60d9
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | +import com.lyms.hospitalapi.dzfy.DzfyHisService; | |
3 | 4 | import com.lyms.hospitalapi.fnfy.FnfyHisService; |
4 | 5 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
5 | -import com.lyms.hospitalapi.dzfy.DzfyHisService; | |
6 | 6 | import com.lyms.hospitalapi.qinglongxian.QingLongXianHisService; |
7 | 7 | import com.lyms.hospitalapi.v2.HisService; |
8 | 8 | import com.lyms.platform.biz.service.*; |
9 | 9 | |
... | ... | @@ -13,10 +13,8 @@ |
13 | 13 | import com.lyms.platform.common.result.BaseObjectResponse; |
14 | 14 | import com.lyms.platform.common.result.BaseResponse; |
15 | 15 | import com.lyms.platform.common.utils.*; |
16 | -import com.lyms.platform.common.utils.StringUtils; | |
17 | 16 | import com.lyms.platform.operate.web.request.*; |
18 | 17 | import com.lyms.platform.operate.web.result.*; |
19 | -import com.lyms.platform.operate.web.utils.CommonsHelper; | |
20 | 18 | import com.lyms.platform.operate.web.utils.JdbcUtil; |
21 | 19 | import com.lyms.platform.operate.web.utils.MessageCenterService; |
22 | 20 | import com.lyms.platform.permission.model.Organization; |
... | ... | @@ -27,7 +25,6 @@ |
27 | 25 | import com.lyms.platform.pojo.*; |
28 | 26 | import com.lyms.platform.query.*; |
29 | 27 | import org.apache.commons.collections.CollectionUtils; |
30 | -import org.apache.commons.lang.*; | |
31 | 28 | import org.slf4j.Logger; |
32 | 29 | import org.slf4j.LoggerFactory; |
33 | 30 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -472,7 +469,7 @@ |
472 | 469 | } |
473 | 470 | if (null != areaCode&&StringUtils.isNotEmpty(areaCode.getAreaCode())) { |
474 | 471 | // 建档成功后,给孕妇造五个条形码 |
475 | - String ticketPid = autoIncermentService.nextPatientTicketId(areaCode.getAreaCode()); | |
472 | +// String ticketPid = autoIncermentService.nextPatientTicketId(areaCode.getAreaCode()); | |
476 | 473 | |
477 | 474 | int start = TicketTypeEnums.TICKTE_ALL.getType().equals(groupsItems.getTicketType()) ?1:PatientCheckTicketFacade.complyCurrentDay(p.getLastMenses()); |
478 | 475 | for (Integer i =start; i <= 5; i++) { |
... | ... | @@ -484,6 +481,7 @@ |
484 | 481 | // ticket.setId(areaCode.getAreaCode() + ticketPid + i); |
485 | 482 | ticket.setId(genSequenceIdService.poll(areaCode.getAreaCode())); |
486 | 483 | ticket.setPid(p.getPid()); |
484 | + ticket.setCoupon(CouponEnums.PRENATAL); | |
487 | 485 | patientCheckTicketService.addTicket(ticket); |
488 | 486 | } |
489 | 487 | } |