Commit 65bd00542653d2950c153dc99ac88b13ffb0a129
1 parent
346e6f7146
Exists in
master
and in
7 other branches
add bar code process
Showing 13 changed files with 457 additions and 1 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/PatientCheckTicketDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/PatientTicketIdDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientCheckTicketDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientTicketIdDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AutoIncermentService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientCheckTicketService.java
- platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
- platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java
- platform-dal/src/main/java/com/lyms/platform/pojo/PatientTicketId.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientCheckTicketQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
65bd005
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | import java.util.*; |
7 | 7 | import java.util.Date; |
8 | 8 | |
9 | +import com.lyms.platform.biz.dal.PatientTicketIdDao; | |
9 | 10 | import com.lyms.platform.biz.dal.impl.YunBookbuildingDaoImpl; |
10 | 11 | import com.lyms.platform.biz.param.AssayConfigQuery; |
11 | 12 | import com.lyms.platform.biz.service.*; |
... | ... | @@ -45,7 +46,19 @@ |
45 | 46 | // queryRisk(applicationContext); |
46 | 47 | // changeLong2Time(applicationContext); |
47 | 48 | |
48 | - buildOrgGroup(applicationContext); | |
49 | + findandmodify(applicationContext); | |
50 | + } | |
51 | + | |
52 | + public static void findandmodify(ApplicationContext applicationContext) { | |
53 | + MongoTemplate mongoTemplate | |
54 | + =(MongoTemplate)applicationContext.getBean("mongoTemplate"); | |
55 | + mongoTemplate.getDb().slaveOk(); | |
56 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
57 | + PatientTicketIdDao patientTicketIdDao = (PatientTicketIdDao)applicationContext.getBean("patientTicketIdDao"); | |
58 | + System.out.println(patientTicketIdDao.nextId(BasicConfigServiceTest.class.getSimpleName())); | |
59 | + System.out.println(patientTicketIdDao.nextId(BasicConfigServiceTest.class.getSimpleName())); | |
60 | + System.out.println(patientTicketIdDao.nextId(BasicConfigServiceTest.class.getSimpleName())); | |
61 | + System.out.println(patientTicketIdDao.nextId(BasicConfigServiceTest.class.getSimpleName())); | |
49 | 62 | } |
50 | 63 | |
51 | 64 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/PatientCheckTicketDao.java
View file @
65bd005
1 | +package com.lyms.platform.biz.dal; | |
2 | + | |
3 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
4 | +import com.lyms.platform.pojo.PatientCheckTicket; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * Created by riecard on 2016/12/28. | |
10 | + */ | |
11 | +public interface PatientCheckTicketDao { | |
12 | + | |
13 | + public PatientCheckTicket addTicket(PatientCheckTicket obj); | |
14 | + | |
15 | + public void updateTicket(PatientCheckTicket obj); | |
16 | + | |
17 | + public PatientCheckTicket getTicket(String id); | |
18 | + | |
19 | + public int queryTicketCount(MongoQuery query); | |
20 | + | |
21 | + public List<PatientCheckTicket> queryTicket(MongoQuery query); | |
22 | + | |
23 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/PatientTicketIdDao.java
View file @
65bd005
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientCheckTicketDaoImpl.java
View file @
65bd005
1 | +package com.lyms.platform.biz.dal.impl; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.PatientCheckTicketDao; | |
4 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import com.lyms.platform.pojo.PatientCheckTicket; | |
9 | +import org.springframework.stereotype.Repository; | |
10 | + | |
11 | +import java.util.List; | |
12 | + | |
13 | +/** | |
14 | + * Created by riecard on 2016/12/28. | |
15 | + */ | |
16 | +@Repository("patientCheckTicketDao") | |
17 | +public class PatientCheckTicketDaoImpl extends BaseMongoDAOImpl<PatientCheckTicket> implements PatientCheckTicketDao { | |
18 | + @Override | |
19 | + public PatientCheckTicket addTicket(PatientCheckTicket obj) { | |
20 | + return save(obj); | |
21 | + } | |
22 | + | |
23 | + @Override | |
24 | + public void updateTicket(PatientCheckTicket obj) { | |
25 | + update(new MongoQuery(new MongoCondition("id", obj.getId(), MongoOper.IS)).convertToMongoQuery(), obj);; | |
26 | + } | |
27 | + | |
28 | + @Override | |
29 | + public PatientCheckTicket getTicket(String id) { | |
30 | + return findById(id); | |
31 | + } | |
32 | + | |
33 | + @Override | |
34 | + public int queryTicketCount(MongoQuery query) { | |
35 | + return (int)count(query.convertToMongoQuery()); | |
36 | + } | |
37 | + | |
38 | + @Override | |
39 | + public List<PatientCheckTicket> queryTicket(MongoQuery query) { | |
40 | + return find(query.convertToMongoQuery()); | |
41 | + } | |
42 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientTicketIdDaoImpl.java
View file @
65bd005
1 | +package com.lyms.platform.biz.dal.impl; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.PatientTicketIdDao; | |
4 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
5 | +import com.lyms.platform.pojo.PatientTicketId; | |
6 | +import org.springframework.data.mongodb.core.query.Criteria; | |
7 | +import org.springframework.data.mongodb.core.query.Query; | |
8 | +import org.springframework.stereotype.Repository; | |
9 | + | |
10 | +/** | |
11 | + * Created by riecard on 2016/12/28. | |
12 | + */ | |
13 | +@Repository("patientTicketIdDao") | |
14 | +public class PatientTicketIdDaoImpl extends BaseMongoDAOImpl<PatientTicketId> implements PatientTicketIdDao { | |
15 | + | |
16 | + @Override | |
17 | + public Integer nextId(String tableName) { | |
18 | + Integer id = 0; | |
19 | + PatientTicketId ticketId = findById(tableName); | |
20 | + if (ticketId == null) { | |
21 | + ticketId = new PatientTicketId(); | |
22 | + ticketId.setId(tableName); | |
23 | + ticketId.setTicketId(1); | |
24 | + save(ticketId); | |
25 | + id = 1; | |
26 | + } else { | |
27 | + id = ticketId.getTicketId() + 1; | |
28 | + ticketId.setTicketId(id); | |
29 | + update(new Query(Criteria.where("id").is(tableName)),ticketId); | |
30 | + } | |
31 | + return id; | |
32 | + } | |
33 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AutoIncermentService.java
View file @
65bd005
1 | +package com.lyms.platform.biz.service; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.PatientTicketIdDao; | |
4 | +import com.lyms.platform.common.result.BaseModel; | |
5 | +import com.lyms.platform.pojo.Patients; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +/** | |
10 | + * Created by riecard on 2016/12/28. | |
11 | + */ | |
12 | +@Service("autoIncermentService") | |
13 | +public class AutoIncermentService { | |
14 | + | |
15 | + @Autowired | |
16 | + private PatientTicketIdDao patientTicketIdDao; | |
17 | + | |
18 | + public Integer nextId(Class cls) { | |
19 | + return patientTicketIdDao.nextId(cls.getSimpleName()); | |
20 | + } | |
21 | + | |
22 | + public String nextPatientTicketId() { | |
23 | + Integer id = patientTicketIdDao.nextId(Patients.class.getSimpleName()); | |
24 | + return String.format("%08d", id); | |
25 | + } | |
26 | + | |
27 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientCheckTicketService.java
View file @
65bd005
1 | +package com.lyms.platform.biz.service; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.PatientCheckTicketDao; | |
4 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
5 | +import com.lyms.platform.pojo.PatientCheckTicket; | |
6 | +import com.lyms.platform.query.PatientCheckTicketQuery; | |
7 | +import org.apache.commons.lang.StringUtils; | |
8 | +import org.springframework.beans.factory.annotation.Autowired; | |
9 | +import org.springframework.data.domain.Sort; | |
10 | +import org.springframework.stereotype.Service; | |
11 | + | |
12 | +import java.util.Date; | |
13 | +import java.util.List; | |
14 | + | |
15 | +/** | |
16 | + * Created by riecard on 2016/12/28. | |
17 | + */ | |
18 | +@Service | |
19 | +public class PatientCheckTicketService { | |
20 | + | |
21 | + @Autowired | |
22 | + private PatientCheckTicketDao patientCheckTicketDao; | |
23 | + | |
24 | + public PatientCheckTicket addTicket(PatientCheckTicket obj) { | |
25 | + return patientCheckTicketDao.addTicket(obj); | |
26 | + } | |
27 | + | |
28 | + public void updateTicket(PatientCheckTicket obj) { | |
29 | + patientCheckTicketDao.updateTicket(obj);; | |
30 | + } | |
31 | + | |
32 | + public String updateTicket(String id, Integer status, String cousumeHospitalId) { | |
33 | + PatientCheckTicket ticket = getTicket(id); | |
34 | + if (ticket == null) { | |
35 | + return "免费产检券不存在"; | |
36 | + } else if (ticket.getStatus() != 1) { | |
37 | + return "免费产检券已被使用了"; | |
38 | + } | |
39 | + ticket.setStatus(status); | |
40 | + ticket.setConsumeHospitalId(cousumeHospitalId); | |
41 | + ticket.setConsumeDate(new Date()); | |
42 | + updateTicket(ticket); | |
43 | + return null; | |
44 | + } | |
45 | + | |
46 | + public PatientCheckTicket getTicket(String id) { | |
47 | + return patientCheckTicketDao.getTicket(id); | |
48 | + } | |
49 | + | |
50 | + public int queryTicketCount(PatientCheckTicketQuery query) { | |
51 | + return patientCheckTicketDao.queryTicketCount(query.convertToQuery()); | |
52 | + } | |
53 | + | |
54 | + public List<PatientCheckTicket> queryTicket(PatientCheckTicketQuery ticketQuery) { | |
55 | + MongoQuery query = ticketQuery.convertToQuery(); | |
56 | + if (StringUtils.isNotEmpty(ticketQuery.getNeed())) { | |
57 | + ticketQuery.mysqlBuild(patientCheckTicketDao.queryTicketCount(query)); | |
58 | + query.start(ticketQuery.getOffset()).end(ticketQuery.getLimit()); | |
59 | + } | |
60 | + if(!StringUtils.isEmpty(ticketQuery.getSort())){ | |
61 | + return patientCheckTicketDao.queryTicket(query.addOrder(Sort.Direction.ASC, ticketQuery.getSort())); | |
62 | + } | |
63 | + return patientCheckTicketDao.queryTicket(query.addOrder(Sort.Direction.DESC, "id")); | |
64 | + } | |
65 | + | |
66 | + public List<PatientCheckTicket> queryTicket(String patientId, String hospitalId,String consumeHospitalId,Integer status) { | |
67 | + PatientCheckTicketQuery query = new PatientCheckTicketQuery(); | |
68 | + query.setNeed(null); | |
69 | + query.setPatientId(patientId); | |
70 | + query.setHospitalId(hospitalId); | |
71 | + query.setConsumeHospitalId(consumeHospitalId); | |
72 | + query.setStatus(status); | |
73 | + return patientCheckTicketDao.queryTicket(query.convertToQuery().addOrder(Sort.Direction.DESC, "id")); | |
74 | + } | |
75 | + | |
76 | +} |
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
View file @
65bd005
... | ... | @@ -46,6 +46,8 @@ |
46 | 46 | SmsTemplateModel("SmsTemplateModel", 97531000410L), |
47 | 47 | StopPregModel("StopPregModel", 97531000420L), |
48 | 48 | VisitModel("VisitModel", 97531000430L), |
49 | + PatientTicketId("PatientTicketId", 97531000440L), | |
50 | + PatientCheckTicket("PatientCheckTicket", 97531000450L), | |
49 | 51 | last("last", 97531009990L); |
50 | 52 | private String cname; |
51 | 53 | private Long cid; |
platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java
View file @
65bd005
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.lyms.platform.beans.SerialIdEnum; | |
4 | +import com.lyms.platform.common.result.BaseModel; | |
5 | +import org.springframework.data.mongodb.core.mapping.Document; | |
6 | + | |
7 | +import java.util.Date; | |
8 | + | |
9 | +/** | |
10 | + * Created by riecard on 2016/12/28. | |
11 | + */ | |
12 | +@Document(collection="lyms_patient_check_ticket") | |
13 | +public class PatientCheckTicket extends BaseModel { | |
14 | + | |
15 | + private static final long serialVersionUID = SerialIdEnum.PatientCheckTicket.getCid(); | |
16 | + | |
17 | + private String id; | |
18 | + private String patientId; | |
19 | + private String hospitalId; | |
20 | + private String consumeHospitalId; | |
21 | + private Integer status; // 1:创建未使用, 2:产检使用,3:分娩销毁 | |
22 | + private Date created; | |
23 | + private Date consumeDate; | |
24 | + | |
25 | + public String getId() { | |
26 | + return id; | |
27 | + } | |
28 | + | |
29 | + public void setId(String id) { | |
30 | + this.id = id; | |
31 | + } | |
32 | + | |
33 | + public String getPatientId() { | |
34 | + return patientId; | |
35 | + } | |
36 | + | |
37 | + public void setPatientId(String patientId) { | |
38 | + this.patientId = patientId; | |
39 | + } | |
40 | + | |
41 | + public String getHospitalId() { | |
42 | + return hospitalId; | |
43 | + } | |
44 | + | |
45 | + public void setHospitalId(String hospitalId) { | |
46 | + this.hospitalId = hospitalId; | |
47 | + } | |
48 | + | |
49 | + public String getConsumeHospitalId() { | |
50 | + return consumeHospitalId; | |
51 | + } | |
52 | + | |
53 | + public void setConsumeHospitalId(String consumeHospitalId) { | |
54 | + this.consumeHospitalId = consumeHospitalId; | |
55 | + } | |
56 | + | |
57 | + public Integer getStatus() { | |
58 | + return status; | |
59 | + } | |
60 | + | |
61 | + public void setStatus(Integer status) { | |
62 | + this.status = status; | |
63 | + } | |
64 | + | |
65 | + public Date getCreated() { | |
66 | + return created; | |
67 | + } | |
68 | + | |
69 | + public void setCreated(Date created) { | |
70 | + this.created = created; | |
71 | + } | |
72 | + | |
73 | + public Date getConsumeDate() { | |
74 | + return consumeDate; | |
75 | + } | |
76 | + | |
77 | + public void setConsumeDate(Date consumeDate) { | |
78 | + this.consumeDate = consumeDate; | |
79 | + } | |
80 | +} |
platform-dal/src/main/java/com/lyms/platform/pojo/PatientTicketId.java
View file @
65bd005
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.lyms.platform.beans.SerialIdEnum; | |
4 | +import com.lyms.platform.common.result.BaseModel; | |
5 | +import org.springframework.data.mongodb.core.mapping.Document; | |
6 | + | |
7 | +/** | |
8 | + * Created by riecard on 2016/12/28. | |
9 | + */ | |
10 | +@Document(collection="lyms_patient_ticket_id") | |
11 | +public class PatientTicketId extends BaseModel { | |
12 | + | |
13 | + private static final long serialVersionUID = SerialIdEnum.PatientTicketId.getCid(); | |
14 | + | |
15 | + private String id; | |
16 | + private Integer ticketId; | |
17 | + | |
18 | + public String getId() { | |
19 | + return id; | |
20 | + } | |
21 | + | |
22 | + public void setId(String id) { | |
23 | + this.id = id; | |
24 | + } | |
25 | + | |
26 | + public Integer getTicketId() { | |
27 | + return ticketId; | |
28 | + } | |
29 | + | |
30 | + public void setTicketId(Integer ticketId) { | |
31 | + this.ticketId = ticketId; | |
32 | + } | |
33 | +} |
platform-dal/src/main/java/com/lyms/platform/query/PatientCheckTicketQuery.java
View file @
65bd005
1 | +package com.lyms.platform.query; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
4 | +import com.lyms.platform.common.dao.BaseQuery; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import com.lyms.platform.common.utils.StringUtils; | |
9 | +import org.springframework.data.mongodb.core.query.Criteria; | |
10 | + | |
11 | +/** | |
12 | + * Created by riecard on 2016/12/28. | |
13 | + */ | |
14 | +public class PatientCheckTicketQuery extends BaseQuery implements IConvertToNativeQuery { | |
15 | + | |
16 | + private String id; | |
17 | + private String patientId; | |
18 | + private String hospitalId; | |
19 | + private String consumeHospitalId; | |
20 | + private Integer status; // 1:创建未使用, 2:产检使用,3:分娩销毁 | |
21 | + | |
22 | + @Override | |
23 | + public MongoQuery convertToQuery() { | |
24 | + MongoCondition condition = MongoCondition.newInstance(); | |
25 | + if (status != null) { | |
26 | + condition = condition.and("status", status, MongoOper.IS); | |
27 | + } | |
28 | + if (!StringUtils.isEmpty(id)) { | |
29 | + condition = condition.and("id", id, MongoOper.IS); | |
30 | + } | |
31 | + if (!StringUtils.isEmpty(patientId)) { | |
32 | + condition = condition.and("patientId", patientId, MongoOper.IS); | |
33 | + } | |
34 | + if (!StringUtils.isEmpty(hospitalId)) { | |
35 | + condition = condition.and("hospitalId", hospitalId, MongoOper.IS); | |
36 | + } | |
37 | + if (!StringUtils.isEmpty(consumeHospitalId)) { | |
38 | + condition = condition.and("consumeHospitalId", consumeHospitalId, MongoOper.IS); | |
39 | + } | |
40 | + return condition.toMongoQuery(); | |
41 | + } | |
42 | + | |
43 | + public String getId() { | |
44 | + return id; | |
45 | + } | |
46 | + | |
47 | + public void setId(String id) { | |
48 | + this.id = id; | |
49 | + } | |
50 | + | |
51 | + public String getPatientId() { | |
52 | + return patientId; | |
53 | + } | |
54 | + | |
55 | + public void setPatientId(String patientId) { | |
56 | + this.patientId = patientId; | |
57 | + } | |
58 | + | |
59 | + public String getHospitalId() { | |
60 | + return hospitalId; | |
61 | + } | |
62 | + | |
63 | + public void setHospitalId(String hospitalId) { | |
64 | + this.hospitalId = hospitalId; | |
65 | + } | |
66 | + | |
67 | + public String getConsumeHospitalId() { | |
68 | + return consumeHospitalId; | |
69 | + } | |
70 | + | |
71 | + public void setConsumeHospitalId(String consumeHospitalId) { | |
72 | + this.consumeHospitalId = consumeHospitalId; | |
73 | + } | |
74 | + | |
75 | + public Integer getStatus() { | |
76 | + return status; | |
77 | + } | |
78 | + | |
79 | + public void setStatus(Integer status) { | |
80 | + this.status = status; | |
81 | + } | |
82 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
65bd005
... | ... | @@ -64,6 +64,9 @@ |
64 | 64 | @Autowired |
65 | 65 | private OrganizationGroupsFacade groupsFacade; |
66 | 66 | |
67 | + @Autowired | |
68 | + private PatientCheckTicketService patientCheckTicketService; | |
69 | + | |
67 | 70 | /** |
68 | 71 | * 处理区域隐藏建档 |
69 | 72 | * |
... | ... | @@ -234,6 +237,13 @@ |
234 | 237 | patientsService.updatePatient(patients); |
235 | 238 | patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); |
236 | 239 | antenatalExaminationService.addOneBabyAnt(model); |
240 | + // 修改关联券的使用状态,如果已使用,则返回错误码 | |
241 | + if (StringUtils.isNotBlank(model.getBarCode())) { | |
242 | + String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); | |
243 | + if (code != null) { | |
244 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
245 | + } | |
246 | + } | |
237 | 247 | |
238 | 248 | //修改最后一次检查时间 |
239 | 249 | setLashCTimes(antExAddRequest.getParentId()); |
... | ... | @@ -382,6 +392,13 @@ |
382 | 392 | antExChuModel.setYn(YnEnums.YES.getId()); |
383 | 393 | antExChuModel.setHospitalId(autoMatchFacade.getHospitalId(userId)); |
384 | 394 | antenatalExaminationService.addOneAntEx(antExChuModel); |
395 | + // 修改关联券的使用状态,如果已使用,则返回错误码 | |
396 | + if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { | |
397 | + String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); | |
398 | + if (code != null) { | |
399 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); | |
400 | + } | |
401 | + } | |
385 | 402 | //修改患者风险等级 |
386 | 403 | |
387 | 404 | patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
65bd005
... | ... | @@ -103,7 +103,13 @@ |
103 | 103 | @Autowired |
104 | 104 | private OrganizationGroupsFacade groupsFacade; |
105 | 105 | |
106 | + @Autowired | |
107 | + private AutoIncermentService autoIncermentService; | |
106 | 108 | |
109 | + @Autowired | |
110 | + private PatientCheckTicketService patientCheckTicketService; | |
111 | + | |
112 | + | |
107 | 113 | /** |
108 | 114 | * 添加孕妇建档 |
109 | 115 | * |
... | ... | @@ -235,6 +241,18 @@ |
235 | 241 | if (type == ServiceObjEnums.YUNOBJ.getId()) { |
236 | 242 | //生成建档短信 |
237 | 243 | createBuildSms(p); |
244 | + } | |
245 | + | |
246 | + // 建档成功后,给孕妇造五个条形码 | |
247 | + String ticketPid = autoIncermentService.nextPatientTicketId(); | |
248 | + for (Integer i=1;i<=5;i++) { | |
249 | + PatientCheckTicket ticket = new PatientCheckTicket(); | |
250 | + ticket.setStatus(1); | |
251 | + ticket.setHospitalId(p.getHospitalId()); | |
252 | + ticket.setPatientId(p.getId()); | |
253 | + ticket.setCreated(new Date()); | |
254 | + ticket.setId("0335" + ticketPid + String.format("%02d", i)); | |
255 | + patientCheckTicketService.addTicket(ticket); | |
238 | 256 | } |
239 | 257 | |
240 | 258 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |