8ffc3d11 by Quilan

删除部分

1 parent de191d42
Showing 549 changed files with 0 additions and 24319 deletions
1 package com.phxl.modules.goods.entity.supplierstock;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 /**
7 * 供应商库存信息
8 */
9
10 public class SupplierStock{
11
12 private String suppliercode; //供应商代码
13 private String suppliername; //供应商名称
14 private String goodsCode; //商品编码
15 private String goodsName; //商品名称
16 private String goodsSpec; //商品规格
17 private String manufacturer; //生产厂商
18 private String lot; //批号
19 private Date productionDate; //生产日期
20 private Date expireDate; //有效期至
21 private BigDecimal stockQty; //库存数量
22 private Date createTime; //创建时间
23 private Date updateTime; //更新时间
24
25 private String id;
26
27 public String getId() {
28 return id;
29 }
30 public void setId(String id) {
31 this.id = id;
32 }
33
34 public String getSuppliercode() {
35 return suppliercode;
36 }
37 public void setSuppliercode(String suppliercode) {
38 this.suppliercode = suppliercode;
39 }
40 public String getSuppliername() {
41 return suppliername;
42 }
43 public void setSuppliername(String suppliername) {
44 this.suppliername = suppliername;
45 }
46 public String getGoodsCode() {
47 return goodsCode;
48 }
49 public void setGoodsCode(String goodsCode) {
50 this.goodsCode = goodsCode;
51 }
52 public String getGoodsName() {
53 return goodsName;
54 }
55 public void setGoodsName(String goodsName) {
56 this.goodsName = goodsName;
57 }
58 public String getGoodsSpec() {
59 return goodsSpec;
60 }
61 public void setGoodsSpec(String goodsSpec) {
62 this.goodsSpec = goodsSpec;
63 }
64 public String getManufacturer() {
65 return manufacturer;
66 }
67 public void setManufacturer(String manufacturer) {
68 this.manufacturer = manufacturer;
69 }
70 public String getLot() {
71 return lot;
72 }
73 public void setLot(String lot) {
74 this.lot = lot;
75 }
76 public Date getProductionDate() {
77 return productionDate;
78 }
79 public void setProductionDate(Date productionDate) {
80 this.productionDate = productionDate;
81 }
82 public Date getExpireDate() {
83 return expireDate;
84 }
85 public void setExpireDate(Date expireDate) {
86 this.expireDate = expireDate;
87 }
88 public BigDecimal getStockQty() {
89 return stockQty;
90 }
91 public void setStockQty(BigDecimal stockQty) {
92 this.stockQty = stockQty;
93 }
94 public Date getCreateTime() {
95 return createTime;
96 }
97 public void setCreateTime(Date createTime) {
98 this.createTime = createTime;
99 }
100 public Date getUpdateTime() {
101 return updateTime;
102 }
103 public void setUpdateTime(Date updateTime) {
104 this.updateTime = updateTime;
105 }
106
107 }
1 package com.phxl.common.response;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4
5 public class PlatFormResponse{
6
7 public String getFlag() {
8 return flag;
9 }
10
11 public void setFlag(String flag) {
12 this.flag = flag;
13 }
14
15 public String getMsg() {
16 return msg;
17 }
18
19 public void setMsg(String msg) {
20 this.msg = msg;
21 }
22
23 /**
24 * 平台接口返回状态码
25 */
26 @JSONField(name="FLAG")
27 private String flag;
28
29 /**
30 * 平台接口返回信息
31 */
32 @JSONField(name="MSG")
33 private String msg;
34
35
36 }
1 package com.phxl.modules.goods.service.interfaceLog;
2
3 import java.util.Date;
4
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service;
7
8 import com.phxl.common.response.PlatFormResponse;
9 import com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao;
10 import com.phxl.modules.goods.entity.interfaceLog.InterfaceLog;
11
12 @Service
13 public class InterfaceLogService {
14
15 @Autowired
16 private InterfaceLogDao interfaceLogDao;
17
18 public void saveLog(String method, String params, String id){
19 InterfaceLog interfaceLog = new InterfaceLog();
20 interfaceLog.setId(id);
21 interfaceLog.setRequestMethod(method);
22 interfaceLog.setRequestTime(new Date());
23 interfaceLog.setRequestParam(params);
24 interfaceLogDao.insert(interfaceLog);
25 }
26
27 public void setResultLog(PlatFormResponse hisResponse, String id, String exception){
28 InterfaceLog interfaceLog = new InterfaceLog();
29 interfaceLog.setId(id);
30 interfaceLog.setResultCode(hisResponse.getFlag());
31 interfaceLog.setResultContent(hisResponse.getMsg());
32 if(exception != null){
33 interfaceLog.setException(exception);
34 }
35 interfaceLogDao.update(interfaceLog);
36 }
37
38 }
1 package com.phxl.modules.goods.web.spd;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.servlet.http.HttpServletRequest;
8
9 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
10
11 import org.apache.http.HttpEntity;
12 import org.apache.http.HttpResponse;
13 import org.apache.http.client.HttpClient;
14 import org.apache.http.client.methods.HttpPost;
15 import org.apache.http.entity.mime.MultipartEntityBuilder;
16 import org.apache.http.entity.mime.content.FileBody;
17 import org.apache.http.impl.client.HttpClients;
18 import org.apache.http.util.EntityUtils;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.stereotype.Controller;
23 import org.springframework.web.bind.annotation.RequestBody;
24 import org.springframework.web.bind.annotation.RequestMapping;
25 import org.springframework.web.bind.annotation.RequestMethod;
26 import org.springframework.web.bind.annotation.RequestParam;
27 import org.springframework.web.bind.annotation.ResponseBody;
28 import org.springframework.web.multipart.MultipartFile;
29
30 import com.alibaba.fastjson.JSON;
31 import com.alibaba.fastjson.JSONObject;
32 import com.alibaba.fastjson.serializer.SerializerFeature;
33 import com.fasterxml.jackson.annotation.JsonFormat;
34 import com.phxl.common.constants.PlatformConstant;
35 import com.phxl.common.response.PlatFormResponse;
36 import com.phxl.common.response.PlatFormResponseConstant;
37 import com.phxl.common.util.HTTPClient;
38 import com.phxl.common.util.JsonMapper;
39 import com.phxl.common.utils.IdUtil;
40 import com.phxl.modules.goods.entity.billback.BillBack;
41 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
42 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
43 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
44 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
45 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
46 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
47 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
48 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
49 import com.phxl.modules.goods.entity.medplan.MedPlan;
50 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
51 import com.phxl.modules.goods.entity.medstock.MedStock;
52 import com.phxl.modules.goods.entity.medstock.MedStockList;
53 import com.phxl.modules.goods.entity.spills.HisSpills;
54 import com.phxl.modules.goods.entity.spills.HisSpillsList;
55 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
56 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
57 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
58 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
59 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
60 import com.phxl.modules.goods.service.billback.BillBackService;
61 import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
62 import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
63 import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
64 import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
65 import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
66 import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
67 import com.phxl.modules.goods.service.medinstore.MedInStoreService;
68 import com.phxl.modules.goods.service.medplan.MedPlanService;
69 import com.phxl.modules.goods.service.medstock.MedStockService;
70 import com.phxl.modules.goods.service.spills.HisSpillsService;
71 import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
72 import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
73 import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
74
75 @Controller
76 @RequestMapping(value = "/Api")
77 public class SpdControlller {
78
79 /**
80 * 日志对象
81 */
82 protected Logger logger = LoggerFactory.getLogger(getClass());
83
84 @Autowired
85 private HisCtMedicineMaterialService ctMedicineMaterialService;
86
87 @Autowired
88 private InterfaceLogService interfaceLogService;
89
90 @Autowired
91 private HisCtDeptService hisCtDeptService;
92
93 @Autowired
94 private CTCareProvService cTCareProvService;
95
96 @Autowired
97 private MedSupplyGoodsService supplyGoodsService;
98
99 @Autowired
100 private MedStockService stockService;
101
102 @Autowired
103 private MedPlanService medPlanService;
104
105 @Autowired
106 private MedInStoreService medInStoreService;
107
108 @Autowired
109 private BillBackService backService;
110
111 @Autowired
112 private BillSettlementService billSettlementService;
113
114 @Autowired
115 private SupplierStockService supplierStockService;
116
117 @Autowired
118 private SuOutStoreService suOutStoreService;
119
120 @Autowired
121 private HisSpillsService hisSpillsService;
122
123 @Autowired
124 private SuInvoiceBackService suInvoiceBackService;
125
126
127 @RequestMapping(value="/setMFMedGoods")
128 @ResponseBody
129 public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
130 logger.debug("药品目录接口请求参数:{}",medgoodsList);
131 String result = "";
132 String logId = IdUtil.uuid();
133 String exception = "";
134 interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
135 PlatFormResponse response = new PlatFormResponse();
136 List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
137 try {
138 materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
139 for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
140 ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
141 }
142 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
143 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
144 result = JSON.toJSONString(response);
145 //medgoodsList = ctMedicineMaterialService.createRequest();
146 //供应商服务请求:
147 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
148 } catch (Exception e) {
149 logger.error(e.getMessage());
150 exception = e.getMessage();
151 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
152 response.setMsg(e.getMessage());
153 result = JSON.toJSONString(response);
154 }
155 interfaceLogService.setResultLog(response, logId, exception);
156 return result;
157 }
158
159 @RequestMapping(value="/setHDept")
160 @ResponseBody
161 public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
162 logger.debug("医院科室资料接口请求参数:{}",params);
163 String result = "";
164 String logId = IdUtil.uuid();
165 String exception = "";
166 interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
167 PlatFormResponse response = new PlatFormResponse();
168 List<HisCtDept> depts = new ArrayList<HisCtDept>();
169 try {
170 depts = JSONObject.parseArray(params, HisCtDept.class);
171 int end = hisCtDeptService.batchSaveOrUpdate(depts);
172 if(end==1){
173 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
174 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
175 }else{
176 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
177 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
178 }
179 result = JSON.toJSONString(response);
180 //供应商服务请求:
181 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
182 } catch (Exception e) {
183 logger.error(e.getMessage());
184 exception = e.getMessage();
185 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
186 response.setMsg(e.getMessage());
187 result = JSON.toJSONString(response);
188 }
189 interfaceLogService.setResultLog(response, logId, exception);
190 return result;
191 }
192
193 /**
194 * 医院人员资料接口
195 * @param request
196 * @param params
197 * @return
198 */
199 @RequestMapping("/setMedStaff")
200 @ResponseBody
201 public String setMedStaff(HttpServletRequest request, @RequestBody String params){
202 logger.debug("医院人员资料接口请求参数:{}",params);
203 String result = "";
204 String logId = IdUtil.uuid();
205 String exception = "";
206 interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
207 PlatFormResponse response = new PlatFormResponse();
208 List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
209 boolean end = false;
210 try {
211 careProvs = JSONObject.parseArray(params, CTCareProv.class);
212 end = cTCareProvService.batchSaveOrUpdate(careProvs);
213 if(end){
214 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
215 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
216 }else{
217 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
218 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
219 }
220 result = JSON.toJSONString(response);
221 //供应商服务请求:
222 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
223 } catch (Exception e) {
224 logger.error(e.getMessage());
225 exception = e.getMessage();
226 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
227 response.setMsg(e.getMessage());
228 result = JSON.toJSONString(response);
229 }
230 interfaceLogService.setResultLog(response, logId, exception);
231 return result;
232 }
233
234
235 /**
236 * 医院采购目录接口
237 * @param request
238 * @param params
239 * @return
240 */
241 @RequestMapping("/setMFSupplyGoods")
242 @ResponseBody
243 public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
244 logger.debug("医院采购目录接口请求参数:{}",params);
245 String result = "";
246 String logId = IdUtil.uuid();
247 String exception = "";
248 interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
249 PlatFormResponse response = new PlatFormResponse();
250 List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
251 boolean end = false;
252 try {
253 supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
254 end = supplyGoodsService.batchSave(supplyGoods);
255 if(end){
256 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
257 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
258 }else{
259 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
260 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
261 }
262 result = JSON.toJSONString(response);
263 //供应商服务请求:
264 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
265 } catch (Exception e) {
266 logger.error(e.getMessage());
267 exception = e.getMessage();
268 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
269 response.setMsg(e.getMessage());
270 result = JSON.toJSONString(response);
271 }
272 interfaceLogService.setResultLog(response, logId, exception);
273 return result;
274 }
275
276
277 /**
278 * 医院库存接口
279 * @param request
280 * @param params
281 * @return
282 */
283 @ResponseBody
284 @RequestMapping(value="/setMedStock",method = RequestMethod.POST)
285 public String setMedStock(HttpServletRequest request, @RequestBody String params){
286 logger.debug("HLI同步医院库存数据请求参数:{}",params);
287 String result = "";
288 String logId = IdUtil.uuid();
289 String exception = "";
290 interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
291 PlatFormResponse response = new PlatFormResponse();
292 List<MedStockList> stocks = new ArrayList<MedStockList>();
293 boolean end = false;
294 try {
295 stocks = JSONObject.parseArray(params, MedStockList.class);
296 end = stockService.batchSave(stocks);
297 if(end){
298 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
299 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
300 }else{
301 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
302 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
303 }
304 result = JSON.toJSONString(response);
305 //供应商服务请求:
306 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
307 } catch (Exception e) {
308 logger.error(e.getMessage());
309 exception = e.getMessage();
310 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
311 response.setMsg(e.getMessage());
312 result = JSON.toJSONString(response);
313 }
314 interfaceLogService.setResultLog(response, logId, exception);
315 return result;
316 }
317
318
319 /**
320 * 医院补货计划接口
321 * @param request
322 * @param params
323 * @return
324 */
325 @RequestMapping("/setMedPlan")
326 @ResponseBody
327 public String setMedPlan(HttpServletRequest request, @RequestBody String params){
328 logger.debug("补货计划接口请求参数:{}",params);
329 String result = "";
330 String logId = IdUtil.uuid();
331 String exception = "";
332 interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
333 PlatFormResponse response = new PlatFormResponse();
334 List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
335 boolean end = false;
336 try {
337 //改成批量的操作
338 medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
339 end = medPlanService.batchSave(medPlans);
340 if(end){
341 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
342 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
343 }else{
344 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
345 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
346 }
347 result = JSON.toJSONString(response);
348 //供应商服务请求:
349 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
350 } catch (Exception e) {
351 logger.error(e.getMessage());
352 exception = e.getMessage();
353 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
354 response.setMsg(e.getMessage());
355 result = JSON.toJSONString(response);
356 }
357 interfaceLogService.setResultLog(response, logId, exception);
358 return result;
359 }
360
361
362 /**
363 * 医院退货接口
364 * @param request
365 * @param params
366 * @return
367 */
368 @RequestMapping("/setTRMedRPI")
369 @ResponseBody
370 public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
371 logger.debug("医院退货计划接口请求参数:{}",params);
372 String result = "";
373 String logId = IdUtil.uuid();
374 String exception = "";
375 interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
376 PlatFormResponse response = new PlatFormResponse();
377 List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
378 boolean end = false;
379 try {
380 billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
381 end = backService.batchSave(billBacks);
382 if(end){
383 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
384 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
385 }else{
386 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
387 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
388 }
389 result = JSON.toJSONString(response);
390 //供应商服务请求:
391 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
392 } catch (Exception e) {
393 logger.error(e.getMessage());
394 exception = e.getMessage();
395 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
396 response.setMsg(e.getMessage());
397 result = JSON.toJSONString(response);
398 }
399 interfaceLogService.setResultLog(response, logId, exception);
400 return result;
401 }
402
403 /**
404 * 结算单接口
405 * @param request
406 * @param params
407 * @return
408 */
409 @RequestMapping("/setTRSettle")
410 @ResponseBody
411 public String setTRSettle(HttpServletRequest request, @RequestBody String params){
412 logger.debug("同步医院结算单请求参数:{}",params);
413 String result = "";
414 String logId = IdUtil.uuid();
415 String exception = "";
416 interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
417 PlatFormResponse response = new PlatFormResponse();
418 List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
419 boolean end = false;
420 try {
421 settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
422 end = billSettlementService.batchSave(settlementWithDetails);
423 if(end){
424 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
425 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
426 }else{
427 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
428 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
429 }
430 result = JSON.toJSONString(response);
431 //供应商服务请求:
432 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
433 } catch (Exception e) {
434 logger.error(e.getMessage());
435 exception = e.getMessage();
436 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
437 response.setMsg(e.getMessage());
438 result = JSON.toJSONString(response);
439 }
440 interfaceLogService.setResultLog(response, logId, exception);
441 return result;
442 }
443
444
445 /**
446 * 供应商库存接口
447 * @param request
448 * @param params
449 * @return
450 */
451 @RequestMapping("/setStock")
452 @ResponseBody
453 public String setStock(HttpServletRequest request, @RequestBody String params){
454 logger.debug("供应商同步库存数据请求参数:{}",params);
455 String result = "";
456 String logId = IdUtil.uuid();
457 String exception = "";
458 interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
459 PlatFormResponse response = new PlatFormResponse();
460 List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
461 boolean end = false;
462 try {
463 supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
464 end = supplierStockService.batchSave(supplierStocks);
465 if(end){
466 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
467 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
468 }else{
469 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
470 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
471 }
472 result = JSON.toJSONString(response);
473 try
474 {
475 //SPD服务请求:
476 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
477 response = JSONObject.parseObject(result,PlatFormResponse.class);
478 response.setMsg("SPD:"+response.getMsg());
479 }
480 catch(Exception ex){
481 logger.error("SPD:"+ex.getMessage());
482 exception = "SPD:"+ex.getMessage();
483 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
484 response.setMsg("SPD:"+ex.getMessage());
485 result = JSON.toJSONString(response);
486 }
487
488 } catch (Exception e) {
489 logger.error("前置机:"+e.getMessage());
490 exception = "前置机:"+e.getMessage();
491 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
492 response.setMsg("前置机:"+e.getMessage());
493 result = JSON.toJSONString(response);
494 }
495 interfaceLogService.setResultLog(response, logId, exception);
496 return result;
497 }
498
499
500 /**
501 * 供应商出库单接口
502 * @param request
503 * @param params
504 * @return
505 */
506 @RequestMapping("/setTrmedwv")
507 @ResponseBody
508 public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
509 logger.debug("同步供应商出库单请求参数:{}",params);
510 String result = "";
511 String logId = IdUtil.uuid();
512 String exception = "";
513 interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
514 PlatFormResponse response = new PlatFormResponse();
515 List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
516 boolean end = false;
517 try {
518 suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
519 end = suOutStoreService.batchSave(suOutStores);
520 if(end){
521 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
522 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
523 }else{
524 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
525 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
526 }
527 result = JSON.toJSONString(response);
528 try
529 {
530 //SPD服务请求:
531 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
532 response = JSONObject.parseObject(result,PlatFormResponse.class);
533 response.setMsg("SPD:"+response.getMsg());
534 }
535 catch(Exception ex){
536 logger.error("SPD:"+ex.getMessage());
537 exception = "SPD:"+ex.getMessage();
538 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
539 response.setMsg("SPD:"+ex.getMessage());
540 result = JSON.toJSONString(response);
541 }
542
543 } catch (Exception e) {
544 logger.error("前置机:"+e.getMessage());
545 exception = "前置机:"+e.getMessage();
546 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
547 response.setMsg("前置机:"+e.getMessage());
548 result = JSON.toJSONString(response);
549 }
550 interfaceLogService.setResultLog(response, logId, exception);
551 return result;
552 }
553
554 /**
555 * 医院盘点损溢接口
556 * @param request
557 * @param params
558 * @return
559 */
560 @RequestMapping(value="/setTrDiff")
561 @ResponseBody
562 public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
563 logger.debug("医院盘点损溢接口请求参数:{}",params);
564 String result = "";
565 String logId = IdUtil.uuid();
566 String exception = "";
567 interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
568 PlatFormResponse response = new PlatFormResponse();
569 List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
570 boolean end = false;
571 try {
572 spills = JSONObject.parseArray(params, HisSpillsList.class);
573 end = hisSpillsService.batchSave(spills);
574 if(end){
575 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
576 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
577 }else{
578 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
579 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
580 }
581 result = JSON.toJSONString(response);
582 //供应商服务请求:
583 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
584 } catch (Exception e) {
585 logger.error(e.getMessage());
586 exception = e.getMessage();
587 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
588 response.setMsg(e.getMessage());
589 result = JSON.toJSONString(response);
590 }
591 interfaceLogService.setResultLog(response, logId, exception);
592 return result;
593 }
594
595
596 /**
597 * 供应商发票回传接口
598 * @param request
599 * @param params
600 * @return
601 */
602 @RequestMapping("/setInvoice")
603 @ResponseBody
604 public String setInvoice(HttpServletRequest request, @RequestBody String params){
605 logger.debug("供应商发票回传接口请求参数:{}",params);
606 String result = "";
607 String logId = IdUtil.uuid();
608 String exception = "";
609 interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
610 PlatFormResponse response = new PlatFormResponse();
611 List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
612 boolean end = false;
613 try {
614 suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
615 end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
616 if(end){
617 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
618 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
619 }else{
620 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
621 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
622 }
623 result = JSON.toJSONString(response);
624 try
625 {
626 //SPD服务请求:
627 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
628 response = JSONObject.parseObject(result,PlatFormResponse.class);
629 response.setMsg("SPD:"+response.getMsg());
630 }
631 catch(Exception ex){
632 logger.error("SPD:"+ex.getMessage());
633 exception = "SPD:"+ex.getMessage();
634 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
635 response.setMsg("SPD:"+ex.getMessage());
636 result = JSON.toJSONString(response);
637 }
638
639 } catch (Exception e) {
640 logger.error("前置机:"+e.getMessage());
641 exception = "前置机:"+e.getMessage();
642 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
643 response.setMsg("前置机:"+e.getMessage());
644 result = JSON.toJSONString(response);
645 }
646 interfaceLogService.setResultLog(response, logId, exception);
647 return result;
648 }
649
650 /*
651 * 医院入库单回传接口
652 * @param request
653 * @param params
654 * @return
655 */
656 @RequestMapping("/setMedInStore")
657 @ResponseBody
658 public String setMedInStore(HttpServletRequest request, @RequestBody String params){
659 logger.debug("医院入库单回传接口请求参数:{}",params);
660 String result = "";
661 String logId = IdUtil.uuid();
662 String exception = "";
663 interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
664 PlatFormResponse response = new PlatFormResponse();
665 List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
666 boolean end = false;
667 try {
668 //改成批量的操作
669 medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
670 end = medInStoreService.batchSave(medInStores);
671 if(end){
672 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
673 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
674 }else{
675 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
676 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
677 }
678 result = JSON.toJSONString(response);
679 //供应商服务请求:
680 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
681 } catch (Exception e) {
682 logger.error(e.getMessage());
683 exception = e.getMessage();
684 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
685 response.setMsg(e.getMessage());
686 result = JSON.toJSONString(response);
687 }
688 interfaceLogService.setResultLog(response, logId, exception);
689 return result;
690 }
691
692 /***
693 * 推送对账数据到平台
694 * @param params
695 * @return
696 */
697 @RequestMapping("/pushBalance")
698 @ResponseBody
699 public String pushBalance(@RequestBody String params) {
700 logger.debug("推送对账数据:{}", params);
701 String result = "";
702 String logId = IdUtil.uuid();
703 String exception = "";
704 interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
705 PlatFormResponse response = new PlatFormResponse();
706 try {
707 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
708 JSONObject jsonObject = JSONObject.parseObject(result);
709 if(jsonObject.getIntValue("errorCode") != 0){
710 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
711 }else {
712 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
713 }
714 response.setMsg(jsonObject.getString("message"));
715 } catch (Exception e) {
716 logger.error(e.getMessage());
717 exception = e.getMessage();
718 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
719 response.setMsg("发送对账数据给平台错误:" + e.getMessage());
720 result = JSON.toJSONString(response);
721 }
722 interfaceLogService.setResultLog(response, logId, exception);
723 return result;
724
725 }
726
727
728 /**
729 * 推送发药数据到平台
730 * @param params
731 * @return
732 */
733 @RequestMapping("/pushDispensing")
734 @ResponseBody
735 public String pushDispensing(@RequestBody String params){
736 logger.debug("推送发药数据:{}", params);
737 String result = "";
738 String logId = IdUtil.uuid();
739 String exception = "";
740 interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
741 PlatFormResponse response = new PlatFormResponse();
742 try {
743 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
744 JSONObject jsonObject = JSONObject.parseObject(result);
745 if(jsonObject.getIntValue("errorCode") != 0){
746 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
747 }else {
748 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
749 }
750 response.setMsg(jsonObject.getString("message"));
751 } catch (Exception e) {
752 logger.error(e.getMessage());
753 exception = e.getMessage();
754 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
755 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
756 result = JSON.toJSONString(response);
757 }
758 interfaceLogService.setResultLog(response, logId, exception);
759 return result;
760 }
761
762
763 /**
764 * 推送库存数据到平台
765 * @param params
766 * @return
767 */
768 @RequestMapping("/pushStock")
769 @ResponseBody
770 public String pushStock(@RequestBody String params){
771 logger.debug("推送库存数据:{}", params);
772 String result = "";
773 String logId = IdUtil.uuid();
774 String exception = "";
775 interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
776 PlatFormResponse response = new PlatFormResponse();
777 try {
778 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
779 JSONObject jsonObject = JSONObject.parseObject(result);
780 if(jsonObject.getIntValue("errorCode") != 0){
781 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
782 }else {
783 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
784 }
785 response.setMsg(jsonObject.getString("message"));
786 } catch (Exception e) {
787 logger.error(e.getMessage());
788 exception = e.getMessage();
789 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
790 response.setMsg("发送库存数据给平台错误:" + e.getMessage());
791 result = JSON.toJSONString(response);
792 }
793 interfaceLogService.setResultLog(response, logId, exception);
794 return result;
795 }
796
797 /**
798 * 推送证照数据到平台
799 * @param params
800 * @return
801 */
802 @RequestMapping("/pushlicinfo")
803 @ResponseBody
804 public String pushlicinfo(@RequestBody String params){
805 logger.debug("证照数据:{}", params);
806 String result = "";
807 String logId = IdUtil.uuid();
808 String exception = "";
809 interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
810 PlatFormResponse response = new PlatFormResponse();
811 try {
812 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
813 JSONObject jsonObject = JSONObject.parseObject(result);
814 if(jsonObject.getIntValue("errorCode") != 0){
815 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
816 }else {
817 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
818 }
819 response.setMsg(jsonObject.getString("message"));
820 } catch (Exception e) {
821 logger.error(e.getMessage());
822 exception = e.getMessage();
823 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
824 response.setMsg("发送证照数据给平台错误:" + e.getMessage());
825 result = JSON.toJSONString(response);
826 }
827 interfaceLogService.setResultLog(response, logId, exception);
828 return result;
829 }
830
831
832 /**
833 * 推送证照图片数据到平台
834 * @param params
835 * @return
836 */
837 @RequestMapping("/pushlicpicinfo")
838 @ResponseBody
839 public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
840 String result = "";
841 String logId = IdUtil.uuid();
842 String exception = "";
843 PlatFormResponse response = new PlatFormResponse();
844 try {
845 if (file!=null) {
846 HttpClient client = HttpClients.createDefault();
847 HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
848 String fileName = file.getOriginalFilename();
849 String prefix = fileName.substring(fileName.lastIndexOf("."));
850 File newfile = File.createTempFile(System.currentTimeMillis() + "", prefix);
851 file.transferTo(newfile);
852 FileBody bin = new FileBody(newfile);
853 HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
854 post.setEntity(reqEntity);
855 HttpResponse htppresponse = client.execute(post);
856 HttpEntity resEntity = htppresponse.getEntity();
857 result = EntityUtils.toString(resEntity, "UTF-8");
858 JSONObject jsonObject = JSONObject.parseObject(result);
859 if(jsonObject.getIntValue("errorCode") != 0){
860 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
861 }else {
862 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
863 }
864 response.setMsg(jsonObject.getString("message"));
865 }else{
866 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
867 response.setMsg("发送发药数据给平台错误:参数为空");
868 }
869
870 } catch (Exception e) {
871 logger.error(e.getMessage());
872 exception = e.getMessage();
873 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
874 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
875 result = JSON.toJSONString(response);
876 }
877 interfaceLogService.setResultLog(response, logId, exception);
878 return result;
879 }
880 }
1 package com.phxl.common.utils;
2
3
4
5 public class BaseException extends RuntimeException {
6 /**
7 */
8 private static final long serialVersionUID = 1L;
9 private int code;
10 private String msg;
11 private Object[] param=null;
12
13 public Object[] getParam() {
14 return param;
15 }
16
17 public void setParam(Object[] param) {
18 this.param = param;
19 }
20
21 public BaseException(String msg) {
22 super(msg);
23 this.code = ReturnCode.ERROR;
24 this.msg = msg;
25 }
26
27 public BaseException(int code) {
28 this.code = code;
29 }
30
31 public BaseException(int code, String msg) {
32 super(msg);
33 this.code = code;
34 this.msg = msg;
35 }
36
37 public BaseException(int code, Object ...agrs) {
38 param = agrs;
39 this.code = code;
40 }
41
42 public int getCode() {
43 return code;
44 }
45
46 public void setCode(int code) {
47 this.code = code;
48 }
49
50 public String getMsg() {
51 return msg;
52 }
53
54 public void setMsg(String msg) {
55 this.msg = msg;
56 }
57
58
59 }
1 eclipse.preferences.version=1
2 encoding//conf/prod=UTF-8
3 encoding//conf/prod/config.properties=UTF-8
4 encoding//conf/stg/config.properties=UTF-8
5 encoding//conf/test=UTF-8
6 encoding//conf/test/config.properties=UTF-8
7 encoding//src/main/java=UTF-8
8 encoding//src/main/resources=UTF-8
9 encoding//src/test/java=UTF-8
10 encoding/<project>=UTF-8
1 package com.phxl.modules.goods.entity.supplierstock;
2
3 public class SupplierStockList {
4 public SupplierStock getData() {
5 return data;
6 }
7
8 public void setData(SupplierStock data) {
9 this.data = data;
10 }
11
12 private SupplierStock data;
13 }
1 package com.phxl.modules.goods.dao.spills;
2
3 import com.phxl.modules.goods.entity.spills.HisSpills;
4
5 public interface HisSpillsDao {
6
7 void insert(HisSpills hisSpills);
8
9 }
1 package com.phxl.modules.goods.dao.medinstore;
2
3 import com.phxl.modules.goods.entity.medinstore.MedInStore;
4
5 public interface MedInStoreDao {
6 void insert(MedInStore medInStore);
7
8 }
1 <?xml version="1.0" ?>
2
3 <!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
4 debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
5 <configuration scan="true" scanPeriod="600 seconds" debug="false">
6 <!-- 定义日志文件 输入位置 -->
7 <property name="log_dir" value="d://supplierlog"/>
8 <!-- 日志最大的历史-->
9 <property name="maxHistory" value="90"/>
10 <property name="normal-pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
11
12 <!-- ConsoleAppender 控制台输出日志 -->
13 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
14 <!-- 对日志进行格式化 -->
15 <encoder>
16 <pattern>${normal-pattern}</pattern>
17 </encoder>
18 </appender>
19
20 <!-- ERROR级别日志 -->
21 <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
22 <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
23 <!-- 过滤器,只记录WARN级别的日志 -->
24 <filter class="ch.qos.logback.classic.filter.LevelFilter">
25 <level>ERROR</level>
26 <onMatch>ACCEPT</onMatch>
27 <onMismatch>DENY</onMismatch>
28 </filter>
29 <file>${log_dir}/error.log</file>
30 <!-- 配置日志所生成的目录-->
31 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
32 <fileNamePattern>${log_dir}/error-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
33 <maxHistory>${maxHistory}</maxHistory>
34 </rollingPolicy>
35 <encoder>
36 <pattern>${normal-pattern}</pattern>
37 </encoder>
38 </appender>
39
40 <!-- INFO级别日志 appender -->
41 <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
42 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
43 <level>INFO</level>
44 </filter>
45 <file>${log_dir}/info.log</file>
46 <!-- 配置日志所生成的目录-->
47 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
48 <fileNamePattern>${log_dir}/info-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
49 <maxHistory>${maxHistory}</maxHistory>
50 </rollingPolicy>
51 <encoder>
52 <pattern>${normal-pattern}</pattern>
53 </encoder>
54 </appender>
55
56 <!-- DEBUG级别日志 appender -->
57 <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
58 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
59 <level>DEBUG</level>
60 </filter>
61 <file>${log_dir}/debug.log</file>
62 <!-- 配置日志所生成的目录-->
63 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
64 <fileNamePattern>${log_dir}/debug-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
65 <maxHistory>${maxHistory}</maxHistory>
66 </rollingPolicy>
67 <encoder>
68 <pattern>${normal-pattern}</pattern>
69 </encoder>
70 </appender>
71
72 <logger name="org.apache.zookeeper.ClientCnxn" level="ERROR" additivity="false"/>
73
74 <logger name="com.phxl.modules.goods.dao" level="debug" additivity="false">
75 <appender-ref ref="debug" />
76 </logger>
77
78 <!-- root级别 DEBUG -->
79 <root level="DEBUG">
80 <!-- 控制台输出 -->
81 <appender-ref ref="STDOUT" />
82 <!-- 文件输出 -->
83 <appender-ref ref="ERROR" />
84 <appender-ref ref="INFO" />
85 <appender-ref ref="DEBUG" />
86 </root>
87 </configuration>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>送货单打印(普通A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}设备送货单</h3></td>
13 <td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">供应商:${fOrgName}</td>
17 <td width="25%" height="30">送货单号:${sendNo}</td>
18 <!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
19 </tr>
20 <tr>
21 <td height="30">制单人:${sendUserName}</td>
22 <td height="30" colspan="2">制单时间:${sendDate}</td>
23 </tr>
24 <tr>
25 <td height="30" >收货科室:${tDeptName}</td>
26 <td height="30" colspan="2">收货地址:${tfAddress}</td>
27 </tr>
28 <tr>
29
30 </tr>
31 </table>
32 </div>
33 <div>
34 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
35 <tr style="height: 25px;">
36 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
42 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
43 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;" width="80">金额</td>
44 </tr>
45 ${tableContent}
46 </table>
47 </div>
48 <div>
49 ${afterTable
50 <table width="100%" border="0" cellspacing="0" cellpadding="0">
51 <tr height="35px;">
52 <td width="30%" align="left">验收人:</td>
53 <td width="30%" align="left">收货人:</td>
54 <td width="20%" align="left">总金额:${totalPrice}</td>
55 </tr>
56 </table>
57 }
58 </div>
59 </div>
60 </body>
61 </html>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.medinstore;
2
3
4 public class MedInStoreWithDetail {
5 public MedInStore getBill() {
6 return bill;
7 }
8
9 public void setBill(MedInStore bill) {
10 this.bill = bill;
11 }
12
13 private MedInStore bill;
14
15 }
1 /**
2 * Project Name:html2pdf File Name:PdfReportHeaderFooter.java Package Name:com.kirin.common.util.pdf Date:2015年11月18日下午4:36:17 Copyright (c) 2015, PHXL All Rights Reserved.
3 */
4
5 package com.phxl.common.util;
6
7 import java.io.IOException;
8
9 import com.itextpdf.text.Document;
10 import com.itextpdf.text.DocumentException;
11 import com.itextpdf.text.Element;
12 import com.itextpdf.text.Font;
13 import com.itextpdf.text.Image;
14 import com.itextpdf.text.PageSize;
15 import com.itextpdf.text.Phrase;
16 import com.itextpdf.text.Rectangle;
17 import com.itextpdf.text.pdf.BaseFont;
18 import com.itextpdf.text.pdf.ColumnText;
19 import com.itextpdf.text.pdf.PdfContentByte;
20 import com.itextpdf.text.pdf.PdfPageEventHelper;
21 import com.itextpdf.text.pdf.PdfTemplate;
22 import com.itextpdf.text.pdf.PdfWriter;
23
24 /**
25 * ClassName:PdfReportHeaderFooter <br/>
26 * Function: TODO ADD FUNCTION. <br/>
27 * Reason: TODO ADD REASON. <br/>
28 * Date: 2015年11月18日 下午4:36:17 <br/>
29 *
30 * @author
31 * @version
32 * @since JDK 1.6
33 * @see
34 */
35 public class PdfReportHeaderFooter extends PdfPageEventHelper {
36
37 public String header = "";
38 public int presentFontSize = 12;
39 public Rectangle pageSize = PageSize.A4;
40 public PdfTemplate total;
41 public BaseFont bf = null;
42 public Font fontDetail = null;
43
44 public String waterMarkImgSrc = "";
45
46 public PdfReportHeaderFooter() {
47 }
48
49 public PdfReportHeaderFooter(String header, int presentFontSize, Rectangle pageSize) {
50 this.header = header;
51 this.presentFontSize = presentFontSize;
52 this.pageSize = pageSize;
53 }
54
55 public PdfReportHeaderFooter(String waterMarkImgSrc) {
56 this.waterMarkImgSrc = waterMarkImgSrc;
57 }
58
59 public void setHeader(String header) {
60 this.header = header;
61 }
62
63 public void setPresentFontSize(int presentFontSize) {
64 this.presentFontSize = presentFontSize;
65 }
66
67
68 public String getWaterMarkImgSrc() {
69 return waterMarkImgSrc;
70 }
71
72
73 public void setWaterMarkImgSrc(String waterMarkImgSrc) {
74 this.waterMarkImgSrc = waterMarkImgSrc;
75 }
76
77 public void onOpenDocument(PdfWriter writer, Document document) {
78 total = writer.getDirectContent().createTemplate(50, 50);
79 }
80
81 public void onEndPage(PdfWriter writer, Document document) {
82 try {
83 if (bf == null) {
84 bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
85 }
86 if (fontDetail == null) {
87 fontDetail = new Font(bf, presentFontSize, Font.NORMAL);// 数据体字体
88 }
89 } catch (DocumentException e) {
90 e.printStackTrace();
91 } catch (IOException e) {
92 e.printStackTrace();
93 }
94 // 1.写入页眉
95 ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_LEFT, new Phrase(header, fontDetail),
96 document.left(), document.top() + 20, 0);
97 // 2.写入前半部分的 第 X页/共
98 int pageS = writer.getPageNumber();
99 String foot1 = "第 " + pageS + " 页 /共";
100 Phrase footer = new Phrase(foot1, fontDetail);
101 // 3.计算前半部分的foot1的长度,后面好定位最后一部分的'Y页'这俩字的x轴坐标,字体长度也要计算进去 = len
102 float len = bf.getWidthPoint(foot1, presentFontSize);
103 // 4.拿到当前的PdfContentByte
104 PdfContentByte cb = writer.getDirectContent();
105 // 5.写入页脚1,x轴就是(右margin+左margin + right() -left()- len)/2.0F
106 // 再给偏移20F适合人类视觉感受,否则肉眼看上去就太偏左了
107 // ,y轴就是底边界-20,否则就贴边重叠到数据体里了就不是页脚了;注意Y轴是从下往上累加的,最上方的Top值是大于Bottom好几百开外的。
108 ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, footer,
109 (document.rightMargin() + document.right() + document.leftMargin() - document.left() - len) / 2.0F
110 + 20F,
111 document.bottom() - 20, 0);
112 // 6.写入页脚2的模板(就是页脚的Y页这俩字)添加到文档中,计算模板的和Y轴,X=(右边界-左边界 - 前半部分的len值)/2.0F +
113 // len , y 轴和之前的保持一致,底边界-20
114 cb.addTemplate(total,
115 (document.rightMargin() + document.right() + document.leftMargin() - document.left()) / 2.0F + 20F,
116 document.bottom() - 20);
117
118 if(!waterMarkImgSrc.equals("")){
119 //增加水印图片
120 PdfContentByte canvas = writer.getDirectContentUnder();
121 Image image;
122 try {
123 image = Image.getInstance(waterMarkImgSrc);
124 image.scaleAbsolute(PageSize.A4.rotate());
125 image.setAbsolutePosition(0, 0);
126 canvas.addImage(image);
127 } catch (Exception e) {
128 e.printStackTrace();
129 }
130 }
131 }
132
133 public void onCloseDocument(PdfWriter writer, Document document) {
134 total.beginText();
135 total.setFontAndSize(bf, presentFontSize);// 生成的模版的字体、颜色
136 String foot2 = " " + (writer.getPageNumber() - 1) + " 页";
137 total.showText(foot2);// 模版显示的内容
138 total.endText();
139 total.closePath();
140 }
141 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao">
4
5 <!--BaseResultMap-->
6 <resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
7 <id column="id" property="id" jdbcType="BIGINT"/>
8 <result column="med_code" property="medCode" jdbcType="VARCHAR"/>
9 <result column="med_name" property="medName" jdbcType="VARCHAR"/>
10 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
11 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
13 <result column="s_name" property="sName" jdbcType="VARCHAR"/>
14 <result column="p_name" property="pName" jdbcType="VARCHAR"/>
15 <result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
16 <result column="producer" property="producer" jdbcType="VARCHAR"/>
17 <result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
18 <result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
19 <result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
20 <result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
21 <result column="price" property="price" jdbcType="DECIMAL"/>
22 <result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
23 <result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
24 <result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
25 <result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
26 <result column="length" property="length" jdbcType="DECIMAL"/>
27 <result column="width" property="width" jdbcType="DECIMAL"/>
28 <result column="height" property="height" jdbcType="DECIMAL"/>
29 <result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
30 <result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
31 <result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
32 <result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
33 <result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
34 <result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
35 <result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
36 <result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
37 <result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
38 <result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
39 <result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
40 <result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
41 <result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
42 <result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
43 <result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
44 <result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
45 <result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
46 <result column="brand" property="brand" jdbcType="VARCHAR"/>
47 <result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
48 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
49 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
50 <result column="memo" property="memo" jdbcType="VARCHAR"/>
51 </resultMap>
52
53 <!--Base_Column_List-->
54 <sql id="Base_Column_List">id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo</sql>
55
56 <!-- 新增HisCtMedicineMaterial-->
57 <insert id="insert" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
58 insert into med_hli_medicine_material (id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo)
59 values (
60 #{id,jdbcType=VARCHAR}
61 ,#{medCode,jdbcType=VARCHAR}
62 ,#{medName,jdbcType=VARCHAR}
63 ,#{goodsCode,jdbcType=VARCHAR}
64 ,#{goodsSpec,jdbcType=VARCHAR}
65 ,#{goodsName,jdbcType=VARCHAR}
66 ,#{sName,jdbcType=VARCHAR}
67 ,#{pName,jdbcType=VARCHAR}
68 ,#{helpCode,jdbcType=VARCHAR}
69 ,#{producer,jdbcType=VARCHAR}
70 ,#{agentName,jdbcType=VARCHAR}
71 ,#{medGoodsCateGUID,jdbcType=VARCHAR}
72 ,#{medGoodsCateName,jdbcType=VARCHAR}
73 ,#{registKey,jdbcType=VARCHAR}
74 ,#{price,jdbcType=DECIMAL}
75 ,#{salePrice,jdbcType=DECIMAL}
76 ,#{batSalePrice,jdbcType=DECIMAL}
77 ,#{productionAddress,jdbcType=VARCHAR}
78 ,#{dosageForm,jdbcType=VARCHAR}
79 ,#{length,jdbcType=DECIMAL}
80 ,#{width,jdbcType=DECIMAL}
81 ,#{height,jdbcType=DECIMAL}
82 ,#{grossWeight,jdbcType=DECIMAL}
83 ,#{netWeight,jdbcType=DECIMAL}
84 ,#{unitStyle,jdbcType=VARCHAR}
85 ,#{bigUnitStyle,jdbcType=VARCHAR}
86 ,#{bigUnitQty,jdbcType=DECIMAL}
87 ,#{bigBcd,jdbcType=VARCHAR}
88 ,#{minUnitStyle,jdbcType=VARCHAR}
89 ,#{minUnitQty,jdbcType=DECIMAL}
90 ,#{litBcd,jdbcType=VARCHAR}
91 ,#{isLotCtrlInput,jdbcType=VARCHAR}
92 ,#{bizState,jdbcType=VARCHAR}
93 ,#{importedFlag,jdbcType=VARCHAR}
94 ,#{reportFlag,jdbcType=VARCHAR}
95 ,#{noxiousFlag,jdbcType=VARCHAR}
96 ,#{drugNerveFlag,jdbcType=VARCHAR}
97 ,#{productStandardCode,jdbcType=VARCHAR}
98 ,#{specStandardCode,jdbcType=VARCHAR}
99 ,#{brand,jdbcType=VARCHAR}
100 ,#{coldFlag,jdbcType=VARCHAR}
101 ,#{supplierCode,jdbcType=VARCHAR}
102 ,#{supplierName,jdbcType=VARCHAR}
103 ,#{memo,jdbcType=VARCHAR}
104 )
105 </insert>
106
107 <!-- 按需修改HisCtMedicineMaterial-->
108 <update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
109 update med_hli_medicine_material
110 <set>
111 <if test="medName != null and medName != ''">
112 med_name = #{medName,jdbcType=VARCHAR},
113 </if>
114 <if test="goodsCode != null and goodsCode != ''">
115 goods_code = #{goodsCode,jdbcType=VARCHAR},
116 </if>
117 <if test="goodsSpec != null and goodsSpec != ''">
118 goods_spec = #{goodsSpec,jdbcType=VARCHAR},
119 </if>
120 <if test="goodsName != null and goodsName != ''">
121 goods_name = #{goodsName,jdbcType=VARCHAR},
122 </if>
123 <if test="sName != null and sName != ''">
124 s_name = #{sName,jdbcType=VARCHAR},
125 </if>
126 <if test="pName != null and pName != ''">
127 p_name = #{pName,jdbcType=VARCHAR},
128 </if>
129 <if test="helpCode != null and helpCode != ''">
130 help_code = #{helpCode,jdbcType=VARCHAR},
131 </if>
132 <if test="producer != null and producer != ''">
133 producer = #{producer,jdbcType=VARCHAR},
134 </if>
135 <if test="agentName != null and agentName != ''">
136 agent_name = #{agentName,jdbcType=VARCHAR},
137 </if>
138 <if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
139 med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
140 </if>
141 <if test="medGoodsCateName != null and medGoodsCateName != ''">
142 med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
143 </if>
144 <if test="registKey != null and registKey != ''">
145 regist_key = #{registKey,jdbcType=VARCHAR},
146 </if>
147 <if test="price != null and price != ''">
148 price = #{price,jdbcType=DECIMAL},
149 </if>
150 <if test="salePrice != null and salePrice != ''">
151 sale_price = #{salePrice,jdbcType=DECIMAL},
152 </if>
153 <if test="batSalePrice != null and batSalePrice != ''">
154 bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
155 </if>
156 <if test="productionAddress != null and productionAddress != ''">
157 production_address = #{productionAddress,jdbcType=VARCHAR},
158 </if>
159 <if test="dosageForm != null and dosageForm != ''">
160 dosage_form = #{dosageForm,jdbcType=VARCHAR},
161 </if>
162 <if test="length != null and length != ''">
163 length = #{length,jdbcType=DECIMAL},
164 </if>
165 <if test="width != null and width != ''">
166 width = #{width,jdbcType=DECIMAL},
167 </if>
168 <if test="height != null and height != ''">
169 height = #{height,jdbcType=DECIMAL},
170 </if>
171 <if test="grossWeight != null and grossWeight != ''">
172 gross_weight = #{grossWeight,jdbcType=DECIMAL},
173 </if>
174 <if test="netWeight != null and netWeight != ''">
175 net_weight = #{netWeight,jdbcType=DECIMAL},
176 </if>
177 <if test="unitStyle != null and unitStyle != ''">
178 unit_style = #{unitStyle,jdbcType=VARCHAR},
179 </if>
180 <if test="bigUnitStyle != null and bigUnitStyle != ''">
181 big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
182 </if>
183 <if test="bigUnitQty != null and bigUnitQty != ''">
184 big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
185 </if>
186 <if test="bigBcd != null and bigBcd != ''">
187 big_bcd = #{bigBcd,jdbcType=VARCHAR},
188 </if>
189 <if test="minUnitStyle != null and minUnitStyle != ''">
190 min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
191 </if>
192 <if test="minUnitQty != null and minUnitQty != ''">
193 min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
194 </if>
195 <if test="litBcd != null and litBcd != ''">
196 lit_bcd = #{litBcd,jdbcType=VARCHAR},
197 </if>
198 <if test="isLotCtrlInput != null and isLotCtrlInput != ''">
199 is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
200 </if>
201 <if test="bizState != null and bizState != ''">
202 biz_state = #{bizState,jdbcType=VARCHAR},
203 </if>
204 <if test="importedFlag != null and importedFlag != ''">
205 imported_flag = #{importedFlag,jdbcType=VARCHAR},
206 </if>
207 <if test="reportFlag != null and reportFlag != ''">
208 report_flag = #{reportFlag,jdbcType=VARCHAR},
209 </if>
210 <if test="noxiousFlag != null and noxiousFlag != ''">
211 noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
212 </if>
213 <if test="drugNerveFlag != null and drugNerveFlag != ''">
214 drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
215 </if>
216 <if test="productStandardCode != null and productStandardCode != ''">
217 product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
218 </if>
219 <if test="specStandardCode != null and specStandardCode != ''">
220 spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
221 </if>
222 <if test="brand != null and brand != ''">
223 brand = #{brand,jdbcType=VARCHAR},
224 </if>
225 <if test="coldFlag != null and coldFlag != ''">
226 cold_flag = #{coldFlag,jdbcType=VARCHAR},
227 </if>
228 <if test="supplierCode != null and supplierCode != ''">
229 supplier_code = #{supplierCode,jdbcType=VARCHAR},
230 </if>
231 <if test="supplierName != null and supplierName != ''">
232 supplier_name=#{supplierName,jdbcType=VARCHAR},
233 </if>
234 <if test="memo != null and memo != ''">
235 memo=#{memo,jdbcType=VARCHAR}
236 </if>
237 </set>
238 where med_code = #{medCode,jdbcType=BIGINT}
239 </update>
240
241
242 <!-- 查询HisCtMedicineMaterial详情 -->
243 <select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
244 select
245 <include refid="Base_Column_List"/>
246 from med_hli_medicine_material material
247 <where>
248 <if test="goodsCode!=null and goodsCode!=''">
249 And goods_code = #{goodsCode,jdbcType=VARCHAR}
250 </if>
251 </where>
252 </select>
253
254 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.billsettlement;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 /**
7 * 医院结算单明细信息
8 */
9
10 public class BillSettlementDetail{
11 private String id;
12 private String settleBillNo; //结算单号
13 private int rowNo; //行号
14 private String goodsCode; //采购方_商品编码
15 private String goodsName; //采购方_商品名称
16 private String goodsSpec;
17 private String producerName;
18 private String goodsCate;
19 private BigDecimal settleQty; //采购方_结算数量
20 private String unit; //采购方_包装单位
21 private BigDecimal settlePrice; //结算价格
22 private BigDecimal settleAmount; //结算金额
23 private String registKey; //批准文号
24 private String lot;
25 private Date productionDate;
26 private Date expireDate;
27 private Date create_time;
28 private Date update_time;
29
30 public String getId() {
31 return id;
32 }
33 public void setId(String id) {
34 this.id = id;
35 }
36 public String getSettleBillNo() {
37 return settleBillNo;
38 }
39 public void setSettleBillNo(String settleBillNo) {
40 this.settleBillNo = settleBillNo;
41 }
42 public int getRowNo() {
43 return rowNo;
44 }
45 public void setRowNo(int rowNo) {
46 this.rowNo = rowNo;
47 }
48 public String getGoodsCode() {
49 return goodsCode;
50 }
51 public void setGoodsCode(String goodsCode) {
52 this.goodsCode = goodsCode;
53 }
54 public String getGoodsName() {
55 return goodsName;
56 }
57 public void setGoodsName(String goodsName) {
58 this.goodsName = goodsName;
59 }
60 public String getGoodsSpec() {
61 return goodsSpec;
62 }
63 public void setGoodsSpec(String goodsSpec) {
64 this.goodsSpec = goodsSpec;
65 }
66 public String getProducerName() {
67 return producerName;
68 }
69 public void setProducerName(String producerName) {
70 this.producerName = producerName;
71 }
72 public String getGoodsCate() {
73 return goodsCate;
74 }
75 public void setGoodsCate(String goodsCate) {
76 this.goodsCate = goodsCate;
77 }
78 public BigDecimal getSettleQty() {
79 return settleQty;
80 }
81 public void setSettleQty(BigDecimal settleQty) {
82 this.settleQty = settleQty;
83 }
84 public String getUnit() {
85 return unit;
86 }
87 public void setUnit(String unit) {
88 this.unit = unit;
89 }
90 public BigDecimal getSettlePrice() {
91 return settlePrice;
92 }
93 public void setSettlePrice(BigDecimal settlePrice) {
94 this.settlePrice = settlePrice;
95 }
96 public BigDecimal getSettleAmount() {
97 return settleAmount;
98 }
99 public void setSettleAmount(BigDecimal settleAmount) {
100 this.settleAmount = settleAmount;
101 }
102 public String getRegistKey() {
103 return registKey;
104 }
105 public void setRegistKey(String registKey) {
106 this.registKey = registKey;
107 }
108 public String getLot() {
109 return lot;
110 }
111 public void setLot(String lot) {
112 this.lot = lot;
113 }
114 public Date getProductionDate() {
115 return productionDate;
116 }
117 public void setProductionDate(Date productionDate) {
118 this.productionDate = productionDate;
119 }
120 public Date getExpireDate() {
121 return expireDate;
122 }
123 public void setExpireDate(Date expireDate) {
124 this.expireDate = expireDate;
125 }
126 public Date getCreate_time() {
127 return create_time;
128 }
129 public void setCreate_time(Date create_time) {
130 this.create_time = create_time;
131 }
132 public Date getUpdate_time() {
133 return update_time;
134 }
135 public void setUpdate_time(Date update_time) {
136 this.update_time = update_time;
137 }
138 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medinstore.MedInStoreDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
12 <result column="supplier_do_no" property="supplierDoNo" jdbcType="VARCHAR" />
13 <result column="supplier_do_row_no" property="supplierDoRowNo" jdbcType="TINYINT" />
14 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
15 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
16 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
17 <result column="unit" property="unit" jdbcType="VARCHAR" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
20 <result column="amount" property="amount" jdbcType="DECIMAL" />
21 <result column="lot" property="lot" jdbcType="VARCHAR" />
22 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
23 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
24 <result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
25 <result column="mvqty" property="mvqty" jdbcType="DECIMAL" />
26 <result column="memo" property="memo" jdbcType="VARCHAR" />
27 </resultMap>
28
29 <!--Base_Column_List -->
30 <sql id="Base_Column_List">id,bill_no,row_no,med_plan_row_no,supplier_do_no,supplier_do_row_no,goods_code,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,arrivalqty,mvqty,memo</sql>
31
32 <!--批量插入MedInStoreDetail -->
33 <insert id="batchInsert" parameterType="list">
34 insert into med_hli_in_store_detail (id,bill_no,row_no,med_plan_row_no,supplier_do_no,supplier_do_row_no,goods_code,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,arrivalqty,mvqty,memo)
35 values
36 <foreach collection ="list" item="obj" separator =",">
37 <trim prefix=" (" suffix=")" suffixOverrides=",">
38 #{obj.id},
39 #{obj.billNo},
40 #{obj.rowNo},
41 #{obj.medPlanRowNo},
42 #{obj.supplierDoNo},
43 #{obj.supplierDoRowNo},
44 #{obj.goodsCode},
45 #{obj.goodsName},
46 #{obj.goodsSpec},
47 #{obj.unit},
48 #{obj.manufacturer},
49 #{obj.purchaserPrice},
50 #{obj.amount},
51 #{obj.lot},
52 #{obj.productionDate},
53 #{obj.expireDate},
54 #{obj.arrivalqty},
55 #{obj.mvqty},
56 #{obj.memo}
57 </trim>
58 </foreach>
59 </insert>
60
61
62 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.suoutstore;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail;
6
7 public interface SuOutStoreDetailDao {
8
9 void batchInsert(List<SuOutStoreDetail> details);
10
11 }
1 package com.phxl.modules.goods.entity.medplan;
2
3 import java.util.Date;
4 import java.util.List;
5
6 /**
7 * 补货计划
8 */
9 public class MedPlan{
10
11 public List<MedPlanDetail> getTrmedplandetails() {
12 return trmedplandetails;
13 }
14 public void setTrmedplandetails(List<MedPlanDetail> trmedplandetails) {
15 this.trmedplandetails = trmedplandetails;
16 }
17 private String medCode; //医疗机构代码
18 private String medName; //医疗机构名称
19 private String supplierCode; //平台供应商代码
20 private String suppliername; //平台供应商名称
21 private String billNo; //单据编号
22 private String billType; //单据类型
23 private String settleType; //结算方式(0:零库存 1:非零库存)
24 private String medDeptCode; //订货科室编码
25 private String medDeptName; //订货科室名称
26 private String medStoreCode; //订货库房编码
27 private String medStoreName; //订货库房名称
28 private String firstFlag; //是否优先
29 private Date planBeginDate; //订货日期
30 private Date planEndDate; //要求到货日期
31 private String memo; //备注
32 private String operaterName; //操作人员姓名
33 private Date inputDate; //制单日期
34 private Date create_time; //创建时间
35 private Date update_time; //更新时间
36 private List<MedPlanDetail> trmedplandetails;
37
38 private String id;
39
40 public String getId() {
41 return id;
42 }
43 public void setId(String id) {
44 this.id = id;
45 }
46
47 public String getMedCode() {
48 return medCode;
49 }
50 public void setMedCode(String medCode) {
51 this.medCode = medCode;
52 }
53 public String getMedName() {
54 return medName;
55 }
56 public void setMedName(String medName) {
57 this.medName = medName;
58 }
59 public String getSupplierCode() {
60 return supplierCode;
61 }
62 public void setSupplierCode(String supplierCode) {
63 this.supplierCode = supplierCode;
64 }
65 public String getSuppliername() {
66 return suppliername;
67 }
68 public void setSuppliername(String suppliername) {
69 this.suppliername = suppliername;
70 }
71 public String getBillNo() {
72 return billNo;
73 }
74 public void setBillNo(String billNo) {
75 this.billNo = billNo;
76 }
77 public String getBillType() {
78 return billType;
79 }
80 public void setBillType(String billType) {
81 this.billType = billType;
82 }
83 public String getMedDeptCode() {
84 return medDeptCode;
85 }
86 public void setMedDeptCode(String medDeptCode) {
87 this.medDeptCode = medDeptCode;
88 }
89 public String getMedDeptName() {
90 return medDeptName;
91 }
92 public void setMedDeptName(String medDeptName) {
93 this.medDeptName = medDeptName;
94 }
95 public String getMedStoreCode() {
96 return medStoreCode;
97 }
98 public void setMedStoreCode(String medStoreCode) {
99 this.medStoreCode = medStoreCode;
100 }
101 public String getMedStoreName() {
102 return medStoreName;
103 }
104 public void setMedStoreName(String medStoreName) {
105 this.medStoreName = medStoreName;
106 }
107 public String getFirstFlag() {
108 return firstFlag;
109 }
110 public void setFirstFlag(String firstFlag) {
111 this.firstFlag = firstFlag;
112 }
113 public Date getPlanBeginDate() {
114 return planBeginDate;
115 }
116 public void setPlanBeginDate(Date planBeginDate) {
117 this.planBeginDate = planBeginDate;
118 }
119 public Date getPlanEndDate() {
120 return planEndDate;
121 }
122 public void setPlanEndDate(Date planEndDate) {
123 this.planEndDate = planEndDate;
124 }
125 public String getMemo() {
126 return memo;
127 }
128 public void setMemo(String memo) {
129 this.memo = memo;
130 }
131 public String getOperaterName() {
132 return operaterName;
133 }
134 public void setOperaterName(String operaterName) {
135 this.operaterName = operaterName;
136 }
137 public Date getInputDate() {
138 return inputDate;
139 }
140 public void setInputDate(Date inputDate) {
141 this.inputDate = inputDate;
142 }
143 public Date getCreate_time() {
144 return create_time;
145 }
146 public void setCreate_time(Date create_time) {
147 this.create_time = create_time;
148 }
149 public Date getUpdate_time() {
150 return update_time;
151 }
152 public void setUpdate_time(Date update_time) {
153 this.update_time = update_time;
154 }
155
156 public String getSettleType() {
157 return settleType;
158 }
159
160 public void setSettleType(String settleType) {
161 this.settleType = settleType;
162 }
163 }
1 eclipse.preferences.version=1
2 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
4 org.eclipse.jdt.core.compiler.compliance=1.6
5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
8 org.eclipse.jdt.core.compiler.source=1.6
1 package com.phxl.modules.goods.service.medinstore;
2
3 import java.math.BigDecimal;
4 import java.util.List;
5
6 import org.apache.commons.lang3.StringUtils;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.phxl.common.utils.BaseException;
13 import com.phxl.common.utils.IdUtil;
14 import com.phxl.modules.goods.dao.medinstore.MedInStoreDao;
15 import com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao;
16 import com.phxl.modules.goods.entity.medinstore.MedInStore;
17 import com.phxl.modules.goods.entity.medinstore.MedInStoreDetail;
18 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
19
20 @Service
21 public class MedInStoreService {
22 @Autowired
23 private MedInStoreDao inStoreDao;
24
25 @Autowired
26 private MedInStoreDetailDao inStoreDetailDao;
27
28 /**
29 * 日志对象
30 */
31 protected Logger logger = LoggerFactory.getLogger(getClass());
32
33
34 private void checkMedInStore(List<MedInStoreWithDetail> instores) {
35 if(instores == null || instores.size() == 0){
36 logger.error("无相应入库单单据信息");
37 throw new BaseException("无相应入库单单据信息");
38 }
39 for (MedInStoreWithDetail medinstore : instores) {
40 String medCode = medinstore.getBill().getMedGuid();
41 String medName = medinstore.getBill().getMedName();
42 if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
43 logger.error("入库单医疗机构编码以及医疗机构名称不能为空");
44 throw new BaseException("入库单医疗机构编码以及医疗机构名称不能为空");
45 }
46 String supplierCode = medinstore.getBill().getSupplierGuid();
47 String suppliername = medinstore.getBill().getSupplierName();
48 if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(suppliername)) {
49 logger.error("入库单平台供应商代码以及平台供应商名称不能为空");
50 throw new BaseException("入库单平台供应商代码以及平台供应商名称不能为空");
51 }
52 String billNo = medinstore.getBill().getBillNo();
53 if (StringUtils.isEmpty(billNo)) {
54 logger.error("入库单单据编号不能为空");
55 throw new BaseException("入库单单据编号不能为空");
56 }
57 String billType = medinstore.getBill().getBillType();
58 if (StringUtils.isEmpty(billType)) {
59 logger.error("入库单单据类型不能为空");
60 throw new BaseException("入库单单据类型不能为空");
61 }
62 List<MedInStoreDetail> details = medinstore.getBill().getBilldetaillist();
63 if(details == null || details.size() == 0){
64 logger.error("入库单单据编号:"+billNo+"入库明细不能为空");
65 throw new BaseException("入库单单据编号:"+billNo+"入库明细不能为空");
66 }
67 for (MedInStoreDetail medInStoreDetail : details) {
68 String detailBillNo = medInStoreDetail.getBillNo();
69 if (StringUtils.isEmpty(detailBillNo)) {
70 logger.error("入库单单据编号:"+billNo+"入库明细单据编号不能为空");
71 throw new BaseException("入库单单据编号:"+billNo+"入库明细单据编号不能为空");
72 }
73 String goodsCode = medInStoreDetail.getGoodsCode();
74 String goodsName = medInStoreDetail.getGoodsName();
75 if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
76 logger.error("入库单单据编号:"+billNo+"入库明细商品编码以及商品名称不能为空");
77 throw new BaseException("入库单单据编号:"+billNo+"入库明细商品编码以及商品名称不能为空");
78 }
79 BigDecimal mvQty = medInStoreDetail.getMvqty();
80 if (mvQty == null) {
81 logger.error("入库单单据编号:"+billNo+"入库明细商品入库实收数不能为空");
82 throw new BaseException("入库单单据编号:"+billNo+"入库明细商品入库实收数不能为空");
83 }
84 BigDecimal arrivalQty = medInStoreDetail.getArrivalqty();
85 if (arrivalQty == null) {
86 logger.error("入库单单据编号:"+billNo+"入库明细商品出库数量不能为空");
87 throw new BaseException("补货计划单据编号:"+billNo+"入库明细商品出库数量不能为空");
88 }
89 BigDecimal amount = medInStoreDetail.getAmount();
90 if (amount == null) {
91 logger.error("入库单单据编号:"+billNo+"入库明细商品金额不能为空");
92 throw new BaseException("入库单单据编号:"+billNo+"入库明细商品金额不能为空");
93 }
94 String unit = medInStoreDetail.getUnit();
95 if (StringUtils.isEmpty(unit)) {
96 logger.error("入库单单据编号:"+billNo+"入库明细商品单位不能为空");
97 throw new BaseException("入库单单据编号:"+billNo+"入库明细商品单位不能为空");
98 }
99 BigDecimal purchaserPrice = medInStoreDetail.getPurchaserPrice();
100 if (purchaserPrice == null) {
101 logger.error("入库单单据编号:"+billNo+"入库明细商品采购价格不能为空");
102 throw new BaseException("入库单单据编号:"+billNo+"入库明细商品采购价格不能为空");
103 }
104 String medPlanRowNo = medInStoreDetail.getMedPlanRowNo();
105 if (StringUtils.isEmpty(medPlanRowNo)) {
106 logger.error("入库单单据编号:"+billNo+"入库明细补货计划单据原行号不能为空");
107 throw new BaseException("入库单单据编号:"+billNo+"入库明细补货计划单据原行号不能为空");
108 }
109 String supplierDoNo = medInStoreDetail.getSupplierDoNo();
110 if (StringUtils.isEmpty(supplierDoNo)) {
111 logger.error("入库单单据编号:"+billNo+"入库明细供应商出库单号不能为空");
112 throw new BaseException("入库单单据编号:"+billNo+"入库明细供应商出库单号不能为空");
113 }
114 String supplierDoRowNo = medInStoreDetail.getSupplierDoRowNo();
115 if (StringUtils.isEmpty(supplierDoRowNo)) {
116 logger.error("入库单单据编号:"+billNo+"入库明细供应商出库单行号不能为空");
117 throw new BaseException("入库单单据编号:"+billNo+"入库明细供应商出库单行号不能为空");
118 }
119 }
120 }
121
122
123 }
124
125
126 public boolean batchSave(List<MedInStoreWithDetail> instores) {
127
128 boolean result = true;
129 try {
130 checkMedInStore(instores);
131 } catch (Exception e) {
132 throw new BaseException(e.getMessage());
133 }
134 for (MedInStoreWithDetail medInStoreWithDetail : instores) {
135 MedInStore medinstore = medInStoreWithDetail.getBill();
136 List<MedInStoreDetail> details = medinstore.getBilldetaillist();
137 String id = IdUtil.uuid();
138 medInStoreWithDetail.getBill().setId(id);
139 if(details != null && details.size() != 0){
140 for (MedInStoreDetail medinstoredetail : details) {
141 medinstoredetail.setBillNo(medInStoreWithDetail.getBill().getBillNo());
142 medinstoredetail.setId(id);
143 }
144 inStoreDao.insert(medinstore);
145 inStoreDetailDao.batchInsert(details);
146 }
147 }
148 return result;
149 }
150
151
152
153 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medplan.MedPlanDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
15 <result column="po_qty" property="poQty" jdbcType="DECIMAL" />
16 <result column="unit" property="unit" jdbcType="VARCHAR" />
17 <result column="taxprice" property="taxprice" jdbcType="DECIMAL" />
18 <result column="taxsum" property="taxsum" jdbcType="DECIMAL" />
19 </resultMap>
20
21 <!--Base_Column_List -->
22 <sql id="Base_Column_List">id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum</sql>
23
24 <!--批量插入MedPlanDetail -->
25 <insert id="batchInsert" parameterType="list">
26 insert into med_hli_plan_detail (id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum)
27 values
28 <foreach collection ="list" item="obj" separator =",">
29 <trim prefix=" (" suffix=")" suffixOverrides=",">
30 #{obj.id},
31 #{obj.billNo},
32 #{obj.rowNo},
33 #{obj.goodsCode},
34 #{obj.goodsName},
35 #{obj.goodsSpec},
36 #{obj.manufacturer},
37 #{obj.poQty},
38 #{obj.unit},
39 #{obj.taxprice},
40 #{obj.taxsum}
41 </trim>
42 </foreach>
43 </insert>
44
45
46 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.service.supplygoods;
2
3 import java.math.BigDecimal;
4 import java.util.List;
5
6 import org.apache.commons.lang3.StringUtils;
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9 import org.apache.xmlbeans.impl.xb.xsdschema.Public;
10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service;
12 import org.springframework.transaction.annotation.Transactional;
13
14 import com.phxl.common.util.JsonMapper;
15 import com.phxl.common.utils.BaseException;
16 import com.phxl.common.utils.IdUtil;
17 import com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao;
18 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
19
20 @Service
21 public class MedSupplyGoodsService{
22
23
24 @Autowired
25 private MedSupplyGoodsDao medSupplyGoodsDao;
26
27 private static Log log = LogFactory.getLog(MedSupplyGoodsService.class);
28
29
30 @Transactional
31 public boolean batchSave(List<MedSupplyGoods> supplyGoods) {
32 boolean result = false;
33 if(supplyGoods != null && supplyGoods.size() != 0){
34 for (MedSupplyGoods medSupplyGoods : supplyGoods) {
35 try {
36 checkGoods(medSupplyGoods);
37 } catch (Exception e) {
38 String json = JsonMapper.toJsonString(medSupplyGoods);
39 log.error("采购目录:"+json+"信息异常");
40 throw new BaseException(e.getMessage());
41 }
42 medSupplyGoods.setId(IdUtil.uuid());
43 }
44 medSupplyGoodsDao.batchInsert(supplyGoods);
45 result = true;
46 }
47 return result;
48 }
49
50 /**
51 * 采购目录信息校验
52 * @param medSupplyGoods
53 */
54 private void checkGoods(MedSupplyGoods medSupplyGoods) {
55 //获取采购目录供应商信息
56 String medSuppliercode = medSupplyGoods.getMedSuppliercode();
57 String medSuppliername = medSupplyGoods.getMedSuppliername();
58 if(StringUtils.isEmpty(medSuppliercode) || StringUtils.isEmpty(medSuppliername)){
59 log.error("采购目录信息供应商编号以及供应商名称不能为空");
60 throw new BaseException("采购目录信息供应商编号以及供应商名称不能为空");
61 }
62 //获取采购目录商品信息
63 String goodsCode = medSupplyGoods.getGoodsCode();
64 String goodsName = medSupplyGoods.getGoodsName();
65 if(StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)){
66 log.error("采购目录信息商品编号以及商品名称不能为空");
67 throw new BaseException("采购目录信息商品编号以及商品名称不能为空");
68 }
69 //对应商品规格
70 String goodsSpec = medSupplyGoods.getGoodsSpec();
71 if(StringUtils.isEmpty(goodsSpec)){
72 log.error("采购目录信息商品规格以及商品名称不能为空");
73 throw new BaseException("采购目录信息商品规格以及商品名称不能为空");
74 }
75 BigDecimal price = medSupplyGoods.getPrice();
76 if (price == null) {
77 log.error("采购目录信息采购价不能为空");
78 throw new BaseException("采购目录信息采购价不能为空");
79 }
80 }
81
82
83 }
1 package com.phxl.modules.goods.service.ctcareprov;
2
3 import org.apache.commons.collections.CollectionUtils;
4 import org.apache.commons.lang3.StringUtils;
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service;
9
10 import com.phxl.common.utils.BaseException;
11 import com.phxl.common.utils.IdUtil;
12 import com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao;
13 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
14
15 import java.util.*;
16
17 @Service
18 public class CTCareProvService{
19
20 @Autowired
21 private CTCareProvDao cTCareProvDao;
22
23 /**
24 * 日志对象
25 */
26 protected Logger logger = LoggerFactory.getLogger(getClass());
27
28 public boolean batchSaveOrUpdate(List<CTCareProv> careProvs) {
29 boolean success = false;
30 try {
31 checkCTCareProv(careProvs);
32 } catch (Exception e) {
33 throw new BaseException(e.getMessage());
34 }
35 if (CollectionUtils.isNotEmpty(careProvs)) {
36 List<String> codes = new ArrayList<String>();
37 for (CTCareProv ctCareProv : careProvs) {
38 String ryCode = ctCareProv.getMfmedStaffCode();
39 codes.add(ryCode);
40 }
41 Map<String,Object> map = new HashMap<String, Object>();
42 map.put("ryCodes",codes);
43 List<CTCareProv> exsitList = cTCareProvDao.batchSelect(map);
44 List<CTCareProv> insertList = new ArrayList<CTCareProv>();
45 List<CTCareProv> updateList = new ArrayList<CTCareProv>();
46 for (CTCareProv ctCareProv : careProvs) {
47 boolean flag = false;
48 for (CTCareProv exsitCtCareProv : exsitList) {
49 if (ctCareProv.getMfmedStaffCode().equals(exsitCtCareProv.getMfmedStaffCode())) {
50 ctCareProv.setId(exsitCtCareProv.getId());
51 flag = true;
52 }
53 }
54 if (!flag) {
55 ctCareProv.setId(IdUtil.uuid());
56 insertList.add(ctCareProv);
57 }else{
58 updateList.add(ctCareProv);
59 }
60 }
61 if(CollectionUtils.isNotEmpty(updateList)){
62 cTCareProvDao.batchUpdate(updateList);
63 }
64 if(CollectionUtils.isNotEmpty(insertList)){
65 cTCareProvDao.batchInsert(insertList);
66 }
67 success = true;
68 }
69 return success;
70 }
71
72 private void checkCTCareProv(List<CTCareProv> careProvs) {
73 if(careProvs == null || careProvs.size() == 0){
74 logger.error("无相应人员资料信息");
75 throw new BaseException("无相应人员资料信息");
76 }
77 for (CTCareProv ctCareProv : careProvs) {
78 String mfmedStaffCode = ctCareProv.getMfmedStaffCode();
79 if (StringUtils.isEmpty(mfmedStaffCode)) {
80 logger.error("人员资料人员代码不能为空");
81 throw new BaseException("人员资料人员代码不能为空");
82 }
83 String logonUser = ctCareProv.getLogonUser();
84 if (StringUtils.isEmpty(logonUser)) {
85 logger.error("人员资料登陆账号不能为空");
86 throw new BaseException("人员资料登陆账号不能为空");
87 }
88 String realName = ctCareProv.getRealName();
89 if (StringUtils.isEmpty(realName)) {
90 logger.error("人员资料真实账号不能为空");
91 throw new BaseException("人员资料真实账号不能为空");
92 }
93 }
94 }
95
96
97
98 }
1 jdbc.type=mysql
2 jdbc.driver=com.mysql.jdbc.Driver
3 jdbc.url=jdbc:mysql://114.115.184.70:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
4 jdbc.username=root
5 jdbc.password=Puhua888@com
6
7
8 spd_service_url = http://localhost:8080/medicinal-web/a/spdrecvsupplier/
9
10
11
12
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
6 <title>微信绑定页面</title>
7 </head>
8 <body>
9 <div style="width: 240px;">
10 <div style="height: 240px;width: 240px;">
11 ${qrImage}
12 </div>
13 </div>
14
15 </body>
16 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
11 <result column="med_name" property="medName" jdbcType="VARCHAR" />
12 <result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
13 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
14 <result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
15 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
16 <result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
17 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
18 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
19 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
20 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
21 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
22 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
25 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
30
31 <!-- 新增MedPlan-->
32 <insert id="insert" parameterType="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
33 insert into med_supplier_out_store (id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
34 values (
35 #{id,jdbcType=VARCHAR}
36 ,#{billNo,jdbcType=VARCHAR}
37 ,#{medGuid,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{medDeptGuid,jdbcType=VARCHAR}
40 ,#{medDeptName,jdbcType=VARCHAR}
41 ,#{medStoreGuid,jdbcType=VARCHAR}
42 ,#{medStoreName,jdbcType=VARCHAR}
43 ,#{supplierGuid,jdbcType=VARCHAR}
44 ,#{supplierName,jdbcType=VARCHAR}
45 ,#{billDate,jdbcType=TIMESTAMP}
46 ,#{countSum,jdbcType=TINYINT}
47 ,#{detailSum,jdbcType=DECIMAL}
48 ,#{operaterName,jdbcType=VARCHAR}
49 ,#{inputDate,jdbcType=TIMESTAMP}
50 ,#{memo,jdbcType=VARCHAR}
51 ,#{createTime,jdbcType=TIMESTAMP}
52 ,#{updateTime,jdbcType=TIMESTAMP}
53 )
54 </insert>
55
56 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <classpath>
3 <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
4 <attributes>
5 <attribute name="optional" value="true"/>
6 <attribute name="maven.pomderived" value="true"/>
7 </attributes>
8 </classpathentry>
9 <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10 <attributes>
11 <attribute name="maven.pomderived" value="true"/>
12 </attributes>
13 </classpathentry>
14 <classpathentry kind="src" output="target/test-classes" path="src/test/java">
15 <attributes>
16 <attribute name="optional" value="true"/>
17 <attribute name="maven.pomderived" value="true"/>
18 </attributes>
19 </classpathentry>
20 <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
21 <attributes>
22 <attribute name="maven.pomderived" value="true"/>
23 <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
24 </attributes>
25 </classpathentry>
26 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
27 <attributes>
28 <attribute name="maven.pomderived" value="true"/>
29 </attributes>
30 </classpathentry>
31 <classpathentry kind="output" path="target/classes"/>
32 </classpath>
1 package com.phxl.modules.goods.dao.hisCtMedicineMaterial;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
6
7 /**
8 *
9 * @ClassName: HisCtMedicineMaterialDao
10 * @Description: HisCtMedicineMaterial数据访问接口
11 * @author hehaihong
12 * @date 2018-08-06 14:44:26
13 *
14 */
15 public interface HisCtMedicineMaterialDao {
16
17
18 List<HisCtMedicineMaterial> findLists(HisCtMedicineMaterial material);
19
20 HisCtMedicineMaterial getMedicine(HisCtMedicineMaterial material);
21
22 HisCtMedicineMaterial get(HisCtMedicineMaterial materials);
23
24 void update(HisCtMedicineMaterial materials);
25
26 void insert(HisCtMedicineMaterial materials);
27
28 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.suoutstore;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5 import java.util.List;
6
7 import com.fasterxml.jackson.annotation.JsonFormat;
8
9 /**
10 * 供应商出库单信息
11 */
12
13 public class SuOutStore{
14
15 private String billNo; //单据编号
16 private String medGuid; //医疗机构代码
17 private String medName; //医疗机构名称
18 private String medDeptGuid; //订货科室编码
19 private String medDeptName; //订货科室名称
20 private String medStoreGuid; //订货库房编码
21 private String medStoreName; //订货库房名称
22 private String supplierGuid; //供应商编码
23 private String supplierName; //供应商名称
24 private Date billDate; //出库日期
25 private int countSum; //明细条数
26 private BigDecimal detailSum; //明细金额
27 private String operaterName; //出库人员姓名
28 private Date inputDate; //制单日期
29 private String memo; //备注
30 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
31 private Date createTime; //创建时间
32 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
33 private Date updateTime; //更新时间
34
35
36 private List<SuOutStoreDetail> billdetaillist; //出库单明细
37
38 private String id;
39
40 public String getBillNo() {
41 return billNo;
42 }
43
44 public void setBillNo(String billNo) {
45 this.billNo = billNo;
46 }
47
48 public String getMedGuid() {
49 return medGuid;
50 }
51
52 public void setMedGuid(String medGuid) {
53 this.medGuid = medGuid;
54 }
55
56 public String getMedName() {
57 return medName;
58 }
59
60 public void setMedName(String medName) {
61 this.medName = medName;
62 }
63
64 public String getMedDeptGuid() {
65 return medDeptGuid;
66 }
67
68 public void setMedDeptGuid(String medDeptGuid) {
69 this.medDeptGuid = medDeptGuid;
70 }
71
72 public String getMedDeptName() {
73 return medDeptName;
74 }
75
76 public void setMedDeptName(String medDeptName) {
77 this.medDeptName = medDeptName;
78 }
79
80 public String getMedStoreGuid() {
81 return medStoreGuid;
82 }
83
84 public void setMedStoreGuid(String medStoreGuid) {
85 this.medStoreGuid = medStoreGuid;
86 }
87
88 public String getMedStoreName() {
89 return medStoreName;
90 }
91
92 public void setMedStoreName(String medStoreName) {
93 this.medStoreName = medStoreName;
94 }
95
96 public String getSupplierGuid() {
97 return supplierGuid;
98 }
99
100 public void setSupplierGuid(String supplierGuid) {
101 this.supplierGuid = supplierGuid;
102 }
103
104 public String getSupplierName() {
105 return supplierName;
106 }
107
108 public void setSupplierName(String supplierName) {
109 this.supplierName = supplierName;
110 }
111
112 public Date getBillDate() {
113 return billDate;
114 }
115
116 public void setBillDate(Date billDate) {
117 this.billDate = billDate;
118 }
119
120 public int getCountSum() {
121 return countSum;
122 }
123
124 public void setCountSum(int countSum) {
125 this.countSum = countSum;
126 }
127
128 public BigDecimal getDetailSum() {
129 return detailSum;
130 }
131
132 public void setDetailSum(BigDecimal detailSum) {
133 this.detailSum = detailSum;
134 }
135
136 public String getOperaterName() {
137 return operaterName;
138 }
139
140 public void setOperaterName(String operaterName) {
141 this.operaterName = operaterName;
142 }
143
144 public Date getInputDate() {
145 return inputDate;
146 }
147
148 public void setInputDate(Date inputDate) {
149 this.inputDate = inputDate;
150 }
151
152 public String getMemo() {
153 return memo;
154 }
155
156 public void setMemo(String memo) {
157 this.memo = memo;
158 }
159
160 public Date getCreateTime() {
161 return createTime;
162 }
163
164 public void setCreateTime(Date createTime) {
165 this.createTime = createTime;
166 }
167
168 public Date getUpdateTime() {
169 return updateTime;
170 }
171
172 public void setUpdateTime(Date updateTime) {
173 this.updateTime = updateTime;
174 }
175
176 public List<SuOutStoreDetail> getBilldetaillist() {
177 return billdetaillist;
178 }
179
180 public void setBilldetaillist(List<SuOutStoreDetail> billdetaillist) {
181 this.billdetaillist = billdetaillist;
182 }
183
184 public String getId() {
185 return id;
186 }
187
188 public void setId(String id) {
189 this.id = id;
190 }
191
192
193 }
1 package com.phxl.common.util;
2
3
4 import java.lang.reflect.Type;
5 import java.util.Collection;
6 import java.util.Date;
7 import java.util.Enumeration;
8 import java.util.Iterator;
9
10
11 import org.apache.commons.logging.Log;
12 import org.apache.commons.logging.LogFactory;
13
14 import com.google.gson.Gson;
15 import com.google.gson.GsonBuilder;
16 import com.google.gson.reflect.TypeToken;
17
18 public class JsonUtils {
19 private static final Log log = LogFactory.getLog(JsonUtils.class);
20 public static final String EMPTY = "";
21 /** 空的 {@code JSON} 数据 - <code>"{}"</code>。 */
22 public static final String EMPTY_JSON = "{}";
23 /** 空的 {@code JSON} 数组(集合)数据 - {@code "[]"}。 */
24 public static final String EMPTY_JSON_ARRAY = "[]";
25 /** 默认的 {@code JSON} 日期/时间字段的格式化模式。 */
26 public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss SSS";
27 /** {@code Google Gson} 的 {@literal @Since} 注解常用的版本号常量 - {@code 1.0}。 */
28 public static final Double SINCE_VERSION_10 = 1.0d;
29 /** {@code Google Gson} 的 {@literal @Since} 注解常用的版本号常量 - {@code 1.1}。 */
30 public static final Double SINCE_VERSION_11 = 1.1d;
31 /** {@code Google Gson} 的 {@literal @Since} 注解常用的版本号常量 - {@code 1.2}。 */
32 public static final Double SINCE_VERSION_12 = 1.2d;
33
34 /**
35 * 将给定的目标对象根据指定的条件参数转换成 {@code JSON} 格式的字符串。
36 * <p />
37 * <strong>该方法转换发生错误时,不会抛出任何异常。若发生错误时,曾通对象返回 <code>"{}"</code>; 集合或数组对象返回
38 * <code>"[]"</code></strong>
39 *
40 * @param target
41 * 目标对象。
42 * @param targetType
43 * 目标对象的类型。
44 * @param isSerializeNulls
45 * 是否序列化 {@code null} 值字段。
46 * @param version
47 * 字段的版本号注解。
48 * @param datePattern
49 * 日期字段的格式化模式。
50 * @param excludesFieldsWithoutExpose
51 * 是否排除未标注 {@literal @Expose} 注解的字段。
52 * @return 目标对象的 {@code JSON} 格式的字符串。
53 */
54 public static String toJson(Object target, Type targetType,
55 boolean isSerializeNulls, Double version, String datePattern,
56 boolean excludesFieldsWithoutExpose) {
57 if (target == null)
58 return EMPTY_JSON;
59 GsonBuilder builder = new GsonBuilder();
60 if (isSerializeNulls)
61 builder.serializeNulls();
62 if (version != null)
63 builder.setVersion(version.doubleValue());
64 if (isEmpty(datePattern))
65 datePattern = DEFAULT_DATE_PATTERN;
66 builder.setDateFormat(datePattern);
67 if (excludesFieldsWithoutExpose)
68 builder.excludeFieldsWithoutExposeAnnotation();
69 String result = EMPTY;
70 Gson gson = builder.create();
71 try {
72 if (targetType != null) {
73 result = gson.toJson(target, targetType);
74 } else {
75 result = gson.toJson(target);
76 }
77 } catch (Exception ex) {
78 log.warn("目标对象 " + target.getClass().getName()
79 + " 转换 JSON 字符串时,发生异常!", ex);
80 if (target instanceof Collection || target instanceof Iterator
81 || target instanceof Enumeration
82 || target.getClass().isArray()) {
83 result = EMPTY_JSON_ARRAY;
84 } else
85 result = EMPTY_JSON;
86 }
87 return result;
88 }
89
90 /**
91 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
92 * 对象。</strong>
93 * <ul>
94 * <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
95 * <li>该方法不会转换 {@code null} 值字段;</li>
96 * <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
97 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
98 * </ul>
99 *
100 * @param target
101 * 要转换成 {@code JSON} 的目标对象。
102 * @return 目标对象的 {@code JSON} 格式的字符串。
103 */
104 public static String toJson(Object target) {
105 return toJson(target, null, false, null, null, true);
106 }
107
108 /**
109 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
110 * 对象。</strong>
111 * <ul>
112 * <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
113 * <li>该方法不会转换 {@code null} 值字段;</li>
114 * <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
115 * </ul>
116 *
117 * @param target
118 * 要转换成 {@code JSON} 的目标对象。
119 * @param datePattern
120 * 日期字段的格式化模式。
121 * @return 目标对象的 {@code JSON} 格式的字符串。
122 */
123 public static String toJson(Object target, String datePattern) {
124 return toJson(target, null, false, null, datePattern, true);
125 }
126
127 /**
128 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
129 * 对象。</strong>
130 * <ul>
131 * <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
132 * <li>该方法不会转换 {@code null} 值字段;</li>
133 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
134 * </ul>
135 *
136 * @param target
137 * 要转换成 {@code JSON} 的目标对象。
138 * @param version
139 * 字段的版本号注解({@literal @Since})。
140 * @return 目标对象的 {@code JSON} 格式的字符串。
141 */
142 public static String toJson(Object target, Double version) {
143 return toJson(target, null, false, version, null, true);
144 }
145
146 /**
147 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
148 * 对象。</strong>
149 * <ul>
150 * <li>该方法不会转换 {@code null} 值字段;</li>
151 * <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
152 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
153 * </ul>
154 *
155 * @param target
156 * 要转换成 {@code JSON} 的目标对象。
157 * @param excludesFieldsWithoutExpose
158 * 是否排除未标注 {@literal @Expose} 注解的字段。
159 * @return 目标对象的 {@code JSON} 格式的字符串。
160 */
161 public static String toJson(Object target,
162 boolean excludesFieldsWithoutExpose) {
163 return toJson(target, null, false, null, null,
164 excludesFieldsWithoutExpose);
165 }
166
167 /**
168 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
169 * 对象。</strong>
170 * <ul>
171 * <li>该方法不会转换 {@code null} 值字段;</li>
172 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
173 * </ul>
174 *
175 * @param target
176 * 要转换成 {@code JSON} 的目标对象。
177 * @param version
178 * 字段的版本号注解({@literal @Since})。
179 * @param excludesFieldsWithoutExpose
180 * 是否排除未标注 {@literal @Expose} 注解的字段。
181 * @return 目标对象的 {@code JSON} 格式的字符串。
182 */
183 public static String toJson(Object target, Double version,
184 boolean excludesFieldsWithoutExpose) {
185 return toJson(target, null, false, version, null,
186 excludesFieldsWithoutExpose);
187 }
188
189 /**
190 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
191 * <ul>
192 * <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
193 * <li>该方法不会转换 {@code null} 值字段;</li>
194 * <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
195 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSSS};</li>
196 * </ul>
197 *
198 * @param target
199 * 要转换成 {@code JSON} 的目标对象。
200 * @param targetType
201 * 目标对象的类型。
202 * @return 目标对象的 {@code JSON} 格式的字符串。
203 */
204 public static String toJson(Object target, Type targetType) {
205 return toJson(target, targetType, false, null, null, true);
206 }
207
208 /**
209 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
210 * <ul>
211 * <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
212 * <li>该方法不会转换 {@code null} 值字段;</li>
213 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSSS};</li>
214 * </ul>
215 *
216 * @param target
217 * 要转换成 {@code JSON} 的目标对象。
218 * @param targetType
219 * 目标对象的类型。
220 * @param version
221 * 字段的版本号注解({@literal @Since})。
222 * @return 目标对象的 {@code JSON} 格式的字符串。
223 */
224 public static String toJson(Object target, Type targetType, Double version) {
225 return toJson(target, targetType, false, version, null, true);
226 }
227
228 /**
229 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
230 * <ul>
231 * <li>该方法不会转换 {@code null} 值字段;</li>
232 * <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
233 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
234 * </ul>
235 *
236 * @param target
237 * 要转换成 {@code JSON} 的目标对象。
238 * @param targetType
239 * 目标对象的类型。
240 * @param excludesFieldsWithoutExpose
241 * 是否排除未标注 {@literal @Expose} 注解的字段。
242 * @return 目标对象的 {@code JSON} 格式的字符串。
243 */
244 public static String toJson(Object target, Type targetType,
245 boolean excludesFieldsWithoutExpose) {
246 return toJson(target, targetType, false, null, null,
247 excludesFieldsWithoutExpose);
248 }
249
250 /**
251 * 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
252 * <ul>
253 * <li>该方法不会转换 {@code null} 值字段;</li>
254 * <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
255 * </ul>
256 *
257 * @param target
258 * 要转换成 {@code JSON} 的目标对象。
259 * @param targetType
260 * 目标对象的类型。
261 * @param version
262 * 字段的版本号注解({@literal @Since})。
263 * @param excludesFieldsWithoutExpose
264 * 是否排除未标注 {@literal @Expose} 注解的字段。
265 * @return 目标对象的 {@code JSON} 格式的字符串。
266 */
267 public static String toJson(Object target, Type targetType, Double version,
268 boolean excludesFieldsWithoutExpose) {
269 return toJson(target, targetType, false, version, null,
270 excludesFieldsWithoutExpose);
271 }
272
273 /**
274 * 将给定的 {@code JSON} 字符串转换成指定的类型对象。
275 *
276 * @param <T>
277 * 要转换的目标类型。
278 * @param json
279 * 给定的 {@code JSON} 字符串。
280 * @param token
281 * {@code com.google.gson.reflect.TypeToken} 的类型指示类对象。
282 * @param datePattern
283 * 日期格式模式。
284 * @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
285 */
286 public static <T> T fromJson(String json, TypeToken<T> token,
287 String datePattern) {
288 if (isEmpty(json)) {
289 return null;
290 }
291 GsonBuilder builder = new GsonBuilder();
292 if (isEmpty(datePattern)) {
293 datePattern = DEFAULT_DATE_PATTERN;
294 }
295 Gson gson = builder.create();
296 try {
297 return gson.fromJson(json, token.getType());
298 } catch (Exception ex) {
299 log.error(json + " 无法转换为 " + token.getRawType().getName() + " 对象!",
300 ex);
301 return null;
302 }
303 }
304
305 /**
306 * 将给定的 {@code JSON} 字符串转换成指定的类型对象。
307 *
308 * @param <T>
309 * 要转换的目标类型。
310 * @param json
311 * 给定的 {@code JSON} 字符串。
312 * @param token
313 * {@code com.google.gson.reflect.TypeToken} 的类型指示类对象。
314 * @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
315 */
316 public static <T> T fromJson(String json, TypeToken<T> token) {
317 return fromJson(json, token, null);
318 }
319
320 /**
321 * 将给定的 {@code JSON} 字符串转换成指定的类型对象。<strong>此方法通常用来转换普通的 {@code JavaBean}
322 * 对象。</strong>
323 *
324 * @param <T>
325 * 要转换的目标类型。
326 * @param json
327 * 给定的 {@code JSON} 字符串。
328 * @param clazz
329 * 要转换的目标类。
330 * @param datePattern
331 * 日期格式模式。
332 * @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
333 */
334 public static <T> T fromJson(String json, Class<T> clazz, String datePattern) {
335 if (isEmpty(json)) {
336 return null;
337 }
338 /* GsonBuilder builder = new GsonBuilder();
339 builder.registerTypeAdapter(Date.class, new ImprovedDateTypeAdapter());*/
340 if (isEmpty(datePattern)) {
341 datePattern = DEFAULT_DATE_PATTERN;
342 }
343 /* Gson gson = builder.create(); */
344 Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonDateDeserializer()).create();
345 try {
346 return gson.fromJson(json, clazz);
347 } catch (Exception ex) {
348 log.error(json + " 无法转换为 " + clazz.getName() + " 对象!", ex);
349 return null;
350 }
351 }
352
353 /**
354 * 将给定的 {@code JSON} 字符串转换成指定的类型对象。<strong>此方法通常用来转换普通的 {@code JavaBean}
355 * 对象。</strong>
356 *
357 * @param <T>
358 * 要转换的目标类型。
359 * @param json
360 * 给定的 {@code JSON} 字符串。
361 * @param clazz
362 * 要转换的目标类。
363 * @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
364 */
365 public static <T> T fromJson(String json, Class<T> clazz) {
366 return fromJson(json, clazz, null);
367 }
368
369 public static boolean isEmpty(String inStr) {
370 boolean reTag = false;
371 if (inStr == null || "".equals(inStr)) {
372 reTag = true;
373 }
374 return reTag;
375 }
376
377
378 public static void main(String[] args) {
379 System.out.println(new Date(1474176253000l));
380 }
381 }
382
1 package com.phxl.modules.goods.entity.billback;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4
5 import java.math.BigDecimal;
6 import java.util.Date;
7
8 /**
9 * 医院退货单明细信息
10 */
11
12 public class BillBackDetail{
13
14 @JSONField(name = "BillNo")
15 private String billNo; //单据编号
16
17 @JSONField(name = "RowNo")
18 private int rowNo; //行号
19
20 @JSONField(name = "MedMVBillNo")
21 private String medMVBillNo; //入库单据编号
22
23 @JSONField(name = "MedMVRowNo")
24 private int medMVRowNo; //入库单据原行号
25
26 @JSONField(name = "GoodsCode")
27 private String goodsCode; //商品编码
28
29 @JSONField(name = "GoodsName")
30 private String goodsName; //商品名称
31
32 @JSONField(name = "GoodsSpec")
33 private String goodsSpec; //商品规格
34
35 @JSONField(name = "Returns_Unit")
36 private String returns_Unit; //包装单位
37
38 @JSONField(name = "Returns_Price")
39 private BigDecimal returns_Price; //退货价格
40
41 @JSONField(name = "Manufacturer")
42 private String manufacturer; //生产厂商
43
44 @JSONField(name = "RpiQty")
45 private BigDecimal rpiQty; //退货数量
46
47 @JSONField(name = "Amount")
48 private BigDecimal amount; //金额
49
50 @JSONField(name = "Lot")
51 private String lot; //批号
52
53 @JSONField(name = "ProductionDate")
54 private Date productionDate; //生产日期
55
56 @JSONField(name = "ExpireDate")
57 private Date expireDate; //有效期至
58
59 @JSONField(name = "Memo")
60 private String memo; //备注
61
62 private String id;
63
64 public String getId() {
65 return id;
66 }
67 public void setId(String id) {
68 this.id = id;
69 }
70
71 public String getBillNo() {
72 return billNo;
73 }
74 public void setBillNo(String billNo) {
75 this.billNo = billNo;
76 }
77 public int getRowNo() {
78 return rowNo;
79 }
80 public void setRowNo(int rowNo) {
81 this.rowNo = rowNo;
82 }
83 public String getMedMVBillNo() {
84 return medMVBillNo;
85 }
86 public void setMedMVBillNo(String medMVBillNo) {
87 this.medMVBillNo = medMVBillNo;
88 }
89 public int getMedMVRowNo() {
90 return medMVRowNo;
91 }
92 public void setMedMVRowNo(int medMVRowNo) {
93 this.medMVRowNo = medMVRowNo;
94 }
95 public String getGoodsCode() {
96 return goodsCode;
97 }
98 public void setGoodsCode(String goodsCode) {
99 this.goodsCode = goodsCode;
100 }
101 public String getGoodsName() {
102 return goodsName;
103 }
104 public void setGoodsName(String goodsName) {
105 this.goodsName = goodsName;
106 }
107 public String getGoodsSpec() {
108 return goodsSpec;
109 }
110 public void setGoodsSpec(String goodsSpec) {
111 this.goodsSpec = goodsSpec;
112 }
113 public String getReturns_Unit() {
114 return returns_Unit;
115 }
116 public void setReturns_Unit(String returns_Unit) {
117 this.returns_Unit = returns_Unit;
118 }
119 public BigDecimal getReturns_Price() {
120 return returns_Price;
121 }
122 public void setReturns_Price(BigDecimal returns_Price) {
123 this.returns_Price = returns_Price;
124 }
125 public String getManufacturer() {
126 return manufacturer;
127 }
128 public void setManufacturer(String manufacturer) {
129 this.manufacturer = manufacturer;
130 }
131 public BigDecimal getRpiQty() {
132 return rpiQty;
133 }
134 public void setRpiQty(BigDecimal rpiQty) {
135 this.rpiQty = rpiQty;
136 }
137 public BigDecimal getAmount() {
138 return amount;
139 }
140 public void setAmount(BigDecimal amount) {
141 this.amount = amount;
142 }
143 public String getLot() {
144 return lot;
145 }
146 public void setLot(String lot) {
147 this.lot = lot;
148 }
149 public Date getProductionDate() {
150 return productionDate;
151 }
152 public void setProductionDate(Date productionDate) {
153 this.productionDate = productionDate;
154 }
155 public Date getExpireDate() {
156 return expireDate;
157 }
158 public void setExpireDate(Date expireDate) {
159 this.expireDate = expireDate;
160 }
161 public String getMemo() {
162 return memo;
163 }
164 public void setMemo(String memo) {
165 this.memo = memo;
166 }
167
168 }
1 package com.phxl.modules.goods.service.hisCtMedicineMaterial;
2
3 import org.apache.commons.lang3.StringUtils;
4 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory;
6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Service;
8 import org.springframework.transaction.annotation.Transactional;
9
10 import com.phxl.common.utils.BaseException;
11 import com.phxl.common.utils.IdUtil;
12 import com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao;
13 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
14
15
16 @Service
17 public class HisCtMedicineMaterialService{
18
19 @Autowired
20 private HisCtMedicineMaterialDao hisCtMedicineMaterialDao;
21
22 /**
23 * 日志对象
24 */
25 protected Logger logger = LoggerFactory.getLogger(getClass());
26
27
28 /**
29 * 同步药品目录信息
30 */
31 @Transactional
32 public String saveMedicine(HisCtMedicineMaterial materials) {
33 try {
34 checkMaterial(materials);
35 if(hisCtMedicineMaterialDao.get(materials)!=null){
36 hisCtMedicineMaterialDao.update(materials);
37 }else{
38 materials.setId(IdUtil.uuid());
39 hisCtMedicineMaterialDao.insert(materials);
40 }
41 } catch (Exception e) {
42 logger.error(e.getMessage());
43 throw new BaseException(e.getMessage());
44 }
45 return "1";
46 }
47
48
49 private void checkMaterial(HisCtMedicineMaterial materials) {
50 String medCode = materials.getMedCode();
51 String medName = materials.getMedName();
52 if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
53 logger.error("前置机:药品目录医疗机构编码以及医疗机构名称不能为空");
54 throw new BaseException("前置机:药品目录医疗机构编码以及医疗机构名称不能为空");
55 }
56 String goodsCode = materials.getGoodsCode();
57 String goodsName = materials.getGoodsName();
58 if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
59 logger.error("前置机:药品目录商品编码以及商品名称不能为空");
60 throw new BaseException("前置机:药品目录商品编码以及商品名称不能为空");
61 }
62 String goodsSpec = materials.getGoodsSpec();
63 if (StringUtils.isEmpty(goodsSpec)) {
64 logger.error("前置机:药品目录商品规格不能为空");
65 throw new BaseException("前置机:药品目录商品规格不能为空");
66 }
67 }
68
69
70 public String createRequest() {
71
72 return null;
73
74 }
75
76
77 }
1 package com.phxl.common.constants;
2
3 public class HisResponseConstant {
4
5 public static class ResponseBodyMsg{
6 public static final String success_ResultCode = "001";
7 public static final String getSuccess_ResultContent = "成功";
8 }
9
10 public static class ResponseHeaderMsg{
11 public static final String SUPPLYGOODS_MESSAGEID = "004";
12 public static final String SUPPLYGOODS_SOURCESYSTEM = "医院采购目录";
13 }
14
15 }
1 package com.phxl.modules.goods.entity.billsettlement;
2
3 public class BillSettlementWithDetail {
4
5 private BillSettlement TRSettle;
6
7 public BillSettlement getTRSettle() {
8 return TRSettle;
9 }
10
11 public void setTRSettle(BillSettlement tRSettle) {
12 TRSettle = tRSettle;
13 }
14 }
1 package com.phxl.common.response;
2
3 public class PlatFormResponseConstant {
4
5 public static class ResponseBodyMsg{
6
7 public static final String success_ResultCode = "Y";
8 public static final String fail_ResultCode = "E";
9
10 public static final String getSuccess_ResultContent = "成功";
11 public static final String getFail_ResultContent = "失败";
12
13 }
14
15 public static class ResponseHeaderMsg{
16 public static final String SUPPLYGOODS_MESSAGEID = "004";
17 public static final String SUPPLYGOODS_SOURCESYSTEM = "医院采购目录";
18 }
19
20 }
1 package com.phxl.common.util;
2
3 import com.thoughtworks.xstream.XStream;
4
5 public class XMLUtil {
6 private static final XStream xStream = new XStream();
7
8 // 将对象转为XML字符串
9 public static <T> String toXML(T obj) {
10 Class<?> cls = obj.getClass();
11 xStream.alias(cls.getSimpleName().toLowerCase(), cls);
12 xStream.aliasSystemAttribute(null, "class");
13 return xStream.toXML(obj);
14 }
15
16 // 将XML字符串转为对象
17 @SuppressWarnings({"unchecked"})
18 public static <T> T fromXML(String xml) {
19 return (T) xStream.fromXML(xml);
20 }
21 }
1 package com.phxl.modules.goods.entity.invoiceback;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5 import java.util.List;
6
7 import com.alibaba.fastjson.annotation.JSONField;
8
9 public class SuInvoiceBack{
10 @JSONField(name = "SettleBillNo")
11 private String settleBillNo; //结算单号
12 @JSONField(name = "SettleDate")
13 private Date settleDate; //结算单日期
14 @JSONField(name = "MedCode")
15 private String medCode; //医疗机构编码
16 @JSONField(name = "MedName")
17 private String medName; //医疗机构名称
18 @JSONField(name = "SupplierCode")
19 private String supplierCode; //供应商编码
20 @JSONField(name = "SupplierName")
21 private String supplierName; //供应商名称
22 @JSONField(name = "GoodsSum")
23 private int goodsSum; //商品条目/品规数
24 @JSONField(name = "Amount")
25 private BigDecimal amount; //结算金额
26 @JSONField(name = "BeginDate")
27 private Date beginDate; //业务开始日期
28 @JSONField(name = "EndDate")
29 private Date endDate; //业务结束日期
30 @JSONField(name = "CREATE_TIME")
31 private Date create_time; //创建时间
32 @JSONField(name = "UPDATE_TIME")
33 private Date update_time; //更新时间
34
35
36 public Date getCreate_time() {
37 return create_time;
38 }
39
40 public void setCreate_time(Date create_time) {
41 this.create_time = create_time;
42 }
43
44 public Date getUpdate_time() {
45 return update_time;
46 }
47
48 public void setUpdate_time(Date update_time) {
49 this.update_time = update_time;
50 }
51
52 private List<SuInvoiceBackDetail> billdetaillist; //回传发票明细
53
54 private String id;
55
56 public String getSettleBillNo() {
57 return settleBillNo;
58 }
59
60 public void setSettleBillNo(String settleBillNo) {
61 this.settleBillNo = settleBillNo;
62 }
63
64 public Date getSettleDate() {
65 return settleDate;
66 }
67
68 public void setSettleDate(Date settleDate) {
69 this.settleDate = settleDate;
70 }
71
72 public String getMedCode() {
73 return medCode;
74 }
75
76 public void setMedCode(String medCode) {
77 this.medCode = medCode;
78 }
79
80 public String getMedName() {
81 return medName;
82 }
83
84 public void setMedName(String medName) {
85 this.medName = medName;
86 }
87
88 public String getSupplierCode() {
89 return supplierCode;
90 }
91
92 public void setSupplierCode(String supplierCode) {
93 this.supplierCode = supplierCode;
94 }
95
96 public String getSupplierName() {
97 return supplierName;
98 }
99
100 public void setSupplierName(String supplierName) {
101 this.supplierName = supplierName;
102 }
103
104 public int getGoodsSum() {
105 return goodsSum;
106 }
107
108 public void setGoodsSum(int goodsSum) {
109 this.goodsSum = goodsSum;
110 }
111
112 public BigDecimal getAmount() {
113 return amount;
114 }
115
116 public void setAmount(BigDecimal amount) {
117 this.amount = amount;
118 }
119
120 public Date getBeginDate() {
121 return beginDate;
122 }
123
124 public void setBeginDate(Date beginDate) {
125 this.beginDate = beginDate;
126 }
127
128 public Date getEndDate() {
129 return endDate;
130 }
131
132 public void setEndDate(Date endDate) {
133 this.endDate = endDate;
134 }
135
136 public String getId() {
137 return id;
138 }
139
140 public void setId(String id) {
141 this.id = id;
142 }
143
144 public List<SuInvoiceBackDetail> getBilldetaillist() {
145 return billdetaillist;
146 }
147
148 public void setBilldetaillist(List<SuInvoiceBackDetail> billdetaillist) {
149 this.billdetaillist = billdetaillist;
150 }
151
152
153 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billback.BillBack">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
11 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
12 <result column="supplierb_name" property="supplierbName" jdbcType="VARCHAR" />
13 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
14 <result column="med_name" property="medName" jdbcType="VARCHAR" />
15 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
16 <result column="reason" property="reason" jdbcType="VARCHAR" />
17 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
18 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
19 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
20 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
21 <result column="memo" property="memo" jdbcType="VARCHAR" />
22 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
23 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
24 </resultMap>
25
26 <!--Base_Column_List -->
27 <sql id="Base_Column_List">id,bill_no,medMV_bill_no,supplier_code,supplierb_name,med_code,med_name,bill_date,reason,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
28
29
30 <!-- 新增BillBack-->
31 <insert id="insert" parameterType="com.phxl.modules.goods.entity.billback.BillBack">
32 insert into med_bill_back (id,bill_no,medMV_bill_no,supplier_code,supplierb_name,med_code,med_name,bill_date,reason,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
33 values (
34 #{id,jdbcType=VARCHAR}
35 ,#{billNo,jdbcType=VARCHAR}
36 ,#{medMVBillNo,jdbcType=VARCHAR}
37 ,#{supplierCode,jdbcType=VARCHAR}
38 ,#{supplierbName,jdbcType=VARCHAR}
39 ,#{medCode,jdbcType=VARCHAR}
40 ,#{medName,jdbcType=VARCHAR}
41 ,#{billDate,jdbcType=TIMESTAMP}
42 ,#{reason,jdbcType=VARCHAR}
43 ,#{countSum,jdbcType=TINYINT}
44 ,#{detailSum,jdbcType=DECIMAL}
45 ,#{operaterName,jdbcType=VARCHAR}
46 ,#{inputDate,jdbcType=TIMESTAMP}
47 ,#{memo,jdbcType=VARCHAR}
48 ,#{create_time,jdbcType=TIMESTAMP}
49 ,#{update_time,jdbcType=TIMESTAMP}
50 )
51 </insert>
52
53 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 Window
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.interfaceLog;
2
3 import com.phxl.modules.goods.entity.interfaceLog.InterfaceLog;
4
5 /**
6 * 接口日志DAO接口
7 * @author zhangbing
8 * @version 2018-08-20
9 */
10
11 public interface InterfaceLogDao{
12
13 void insert(InterfaceLog interfaceLog);
14
15 void update(InterfaceLog interfaceLog);
16
17
18 }
1 package com.phxl.modules.goods.entity.medinstore;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 public class MedInStoreDetail {
7 public String getBillNo() {
8 return billNo;
9 }
10 public void setBillNo(String billNo) {
11 this.billNo = billNo;
12 }
13 public String getRowNo() {
14 return rowNo;
15 }
16 public void setRowNo(String rowNo) {
17 this.rowNo = rowNo;
18 }
19 public String getMedPlanRowNo() {
20 return medPlanRowNo;
21 }
22 public void setMedPlanRowNo(String medPlanRowNo) {
23 this.medPlanRowNo = medPlanRowNo;
24 }
25 public String getSupplierDoNo() {
26 return supplierDoNo;
27 }
28 public void setSupplierDoNo(String supplierDoNo) {
29 this.supplierDoNo = supplierDoNo;
30 }
31 public String getSupplierDoRowNo() {
32 return supplierDoRowNo;
33 }
34 public void setSupplierDoRowNo(String supplierDoRowNo) {
35 this.supplierDoRowNo = supplierDoRowNo;
36 }
37 public String getGoodsCode() {
38 return goodsCode;
39 }
40 public void setGoodsCode(String goodsCode) {
41 this.goodsCode = goodsCode;
42 }
43 public String getGoodsName() {
44 return goodsName;
45 }
46 public void setGoodsName(String goodsName) {
47 this.goodsName = goodsName;
48 }
49 public String getGoodsSpec() {
50 return goodsSpec;
51 }
52 public void setGoodsSpec(String goodsSpec) {
53 this.goodsSpec = goodsSpec;
54 }
55 public String getUnit() {
56 return unit;
57 }
58 public void setUnit(String unit) {
59 this.unit = unit;
60 }
61 public String getManufacturer() {
62 return manufacturer;
63 }
64 public void setManufacturer(String manufacturer) {
65 this.manufacturer = manufacturer;
66 }
67 public BigDecimal getPurchaserPrice() {
68 return purchaserPrice;
69 }
70 public void setPurchaserPrice(BigDecimal purchaserPrice) {
71 this.purchaserPrice = purchaserPrice;
72 }
73 public BigDecimal getAmount() {
74 return amount;
75 }
76 public void setAmount(BigDecimal amount) {
77 this.amount = amount;
78 }
79 public String getLot() {
80 return lot;
81 }
82 public void setLot(String lot) {
83 this.lot = lot;
84 }
85 public Date getProductionDate() {
86 return productionDate;
87 }
88 public void setProductionDate(Date productionDate) {
89 this.productionDate = productionDate;
90 }
91 public Date getExpireDate() {
92 return expireDate;
93 }
94 public void setExpireDate(Date expireDate) {
95 this.expireDate = expireDate;
96 }
97 public BigDecimal getArrivalqty() {
98 return arrivalqty;
99 }
100 public void setArrivalqty(BigDecimal arrivalqty) {
101 this.arrivalqty = arrivalqty;
102 }
103 public BigDecimal getMvqty() {
104 return mvqty;
105 }
106 public void setMvqty(BigDecimal mvqty) {
107 this.mvqty = mvqty;
108 }
109 public String getMemo() {
110 return memo;
111 }
112 public void setMemo(String memo) {
113 this.memo = memo;
114 }
115 private String id;
116
117 public String getId() {
118 return id;
119 }
120 public void setId(String id) {
121 this.id = id;
122 }
123 private String billNo;
124 private String rowNo;
125 private String medPlanRowNo;
126 private String supplierDoNo;
127 private String supplierDoRowNo;
128 private String goodsCode;
129 private String goodsName;
130 private String goodsSpec;
131 private String unit;
132 private String manufacturer;
133 private BigDecimal purchaserPrice;
134 private BigDecimal amount;
135 private String lot;
136 private Date productionDate;
137 private Date expireDate;
138 private BigDecimal arrivalqty;
139 private BigDecimal mvqty;
140 private String memo;
141
142 }
1 jdbc.type=mysql
2 jdbc.driver=com.mysql.jdbc.Driver
3 jdbc.url=jdbc:mysql://114.115.184.70:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
4 jdbc.username=root
5 jdbc.password=Puhua888@com
6
7
8 spd_service_url = http://localhost:8080/medicinal-web/a/spdrecvsupplier/
1 package com.phxl.common.util;
2
3
4 import java.io.BufferedReader;
5 import java.io.IOException;
6 import java.io.InputStream;
7 import java.io.InputStreamReader;
8 import java.util.List;
9 import java.util.regex.Matcher;
10 import java.util.regex.Pattern;
11
12 import org.apache.commons.logging.Log;
13 import org.apache.commons.logging.LogFactory;
14
15
16 public class VideoThumbTaker {
17
18 static Log log = LogFactory.getLog(VideoThumbTaker.class);
19
20 protected String ffmpegApp;
21
22 public VideoThumbTaker(String ffmpegApp) {
23 this.ffmpegApp = ffmpegApp;
24 }
25
26 @SuppressWarnings("unused")
27 /****
28 * 获取指定时间内的图片
29 *
30 * @param videoFilename:视频路径
31 * @param thumbFilename:图片保存路径
32 * @param width:图片长
33 * @param height:图片宽
34 * @param hour:指定时
35 * @param min:指定分
36 * @param sec:指定秒
37 * @throws IOException
38 * @throws InterruptedException
39 */
40 public void getThumb(String videoFilename, String thumbFilename, int width, int height, int hour, int min,
41 float sec) throws IOException, InterruptedException {
42 ProcessBuilder processBuilder = new ProcessBuilder(ffmpegApp, "-y", "-i", videoFilename, "-vframes", "1", "-ss",
43 hour + ":" + min + ":" + sec, "-f", "mjpeg", "-s", width + "*" + height, "-an", thumbFilename);
44
45 Process process = processBuilder.start();
46
47 InputStream stderr = process.getErrorStream();
48 InputStreamReader isr = new InputStreamReader(stderr);
49 BufferedReader br = new BufferedReader(isr);
50 String line;
51 while ((line = br.readLine()) != null)
52 ;
53 process.waitFor();
54
55 if (br != null)
56 br.close();
57 if (isr != null)
58 isr.close();
59 if (stderr != null)
60 stderr.close();
61 }
62
63 /****
64 * 获取指定时间内的图片
65 *
66 * @param ffmpeg:ffmpeg插件路径
67 * @param localMp4:本地mp4保存路径
68 * @param localMp4Img:本地mp4图片保存路径
69 * @throws IOException
70 * @throws InterruptedException
71 */
72 public static void getVidioImg(String ffmpeg,String localMp4,String localMp4Img) throws Exception{
73 VideoThumbTaker videoThumbTaker = new VideoThumbTaker(ffmpeg);
74 videoThumbTaker.getThumb(localMp4, localMp4Img, 800,600, 0, 0, 0.5f);
75
76 }
77
78
79 /**
80 * 获取视频总时间
81 * @param viedo_path 视频路径
82 * @param ffmpeg_path ffmpeg路径
83 * @return
84 */
85 public static int getVideoTime(String video_path, String ffmpeg_path) {
86 List<String> commands = new java.util.ArrayList<String>();
87 commands.add(ffmpeg_path);
88 commands.add("-i");
89 commands.add(video_path);
90 try {
91 ProcessBuilder builder = new ProcessBuilder();
92 builder.command(commands);
93 final Process p = builder.start();
94
95 //从输入流中读取视频信息
96 BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream()));
97 StringBuffer sb = new StringBuffer();
98 String line = "";
99 while ((line = br.readLine()) != null) {
100 sb.append(line);
101 }
102 br.close();
103
104 //从视频信息中解析时长
105 String regexDuration = "Duration: (.*?), start: (.*?), bitrate: (\\d*) kb\\/s";
106 Pattern pattern = Pattern.compile(regexDuration);
107 Matcher m = pattern.matcher(sb.toString());
108 if (m.find()) {
109 int time = getTimelen(m.group(1));
110 //log.info(video_path+",视频时长:"+time+", 开始时间:"+m.group(2)+",比特率:"+m.group(3)+"kb/s");
111 return time;
112 }
113 } catch (Exception e) {
114 log.error("获取音频时长失败:"+e);
115 }
116
117 return 0;
118 }
119
120 //格式:"00:00:10.68"
121 private static int getTimelen(String timelen){
122 int min=0;
123 String strs[] = timelen.split(":");
124 if (strs[0].compareTo("0") > 0) {
125 min+=Integer.valueOf(strs[0])*60*60;//秒
126 }
127 if(strs[1].compareTo("0")>0){
128 min+=Integer.valueOf(strs[1])*60;
129 }
130 if(strs[2].compareTo("0")>0){
131 min+=Math.round(Float.valueOf(strs[2]));
132 }
133 return min;
134 }
135
136 //测试方法
137 public static void main(String[] args) {
138 String ffmpegPath = "D:\\software\\ffmpeg\\bin\\ffmpeg.exe";
139 //VideoThumbTaker videoThumbTaker = new VideoThumbTaker("D:\\software\\ffmpeg\\bin\\ffmpeg.exe");
140 try {
141 /*videoThumbTaker.getThumb("D:\\videoMp4sLoc\\114265ef-beb6-437f-9015-2e9af8fa2b9a.mp4", "D:\\thumbTest222.png", 800,600, 0, 0, 1);
142 System.out.println("over");*/
143
144 System.out.println(getVideoTime("D:\\jpg\\22.mp3",ffmpegPath));
145 } catch (Exception e) {
146 e.printStackTrace();
147 }
148 }
149 }
1 // JavaScript Document
2 jQuery.extend({
3
4 createUploadIframe: function(id, uri)
5 {
6 //create frame
7 var frameId = 'jUploadFrame' + id;
8
9 if(window.ActiveXObject) {
10 var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
11 if(typeof uri== 'boolean'){
12 io.src = 'javascript:false';
13 }
14 else if(typeof uri== 'string'){
15 io.src = uri;
16 }
17 }
18 else {
19 var io = document.createElement('iframe');
20 io.id = frameId;
21 io.name = frameId;
22 }
23 io.style.position = 'absolute';
24 io.style.top = '-1000px';
25 io.style.left = '-1000px';
26
27 document.body.appendChild(io);
28
29 return io;
30 },
31 createUploadForm: function(id, fileElementId)
32 {
33 //create form
34 var formId = 'jUploadForm' + id;
35 var fileId = 'jUploadFile' + id;
36 var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
37 var oldElement = jQuery('#' + fileElementId);
38 var newElement = jQuery(oldElement).clone();
39 jQuery(oldElement).attr('id', fileId);
40 jQuery(oldElement).before(newElement);
41 jQuery(oldElement).appendTo(form);
42 //set attributes
43 jQuery(form).css('position', 'absolute');
44 jQuery(form).css('top', '-1200px');
45 jQuery(form).css('left', '-1200px');
46 jQuery(form).appendTo('body');
47 return form;
48 },
49
50 ajaxFileUpload: function(s) {
51 // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
52 s = jQuery.extend({}, jQuery.ajaxSettings, s);
53 var id = s.fileElementId;
54 var form = jQuery.createUploadForm(id, s.fileElementId);
55 var io = jQuery.createUploadIframe(id, s.secureuri);
56 var frameId = 'jUploadFrame' + id;
57 var formId = 'jUploadForm' + id;
58
59 if( s.global && ! jQuery.active++ )
60 {
61 // Watch for a new set of requests
62 jQuery.event.trigger( "ajaxStart" );
63 }
64 var requestDone = false;
65 // Create the request object
66 var xml = {};
67 if( s.global )
68 {
69 jQuery.event.trigger("ajaxSend", [xml, s]);
70 }
71
72 var uploadCallback = function(isTimeout)
73 {
74 // Wait for a response to come back
75 var io = document.getElementById(frameId);
76 try
77 {
78 if(io.contentWindow)
79 {
80 xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
81 xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
82
83 }else if(io.contentDocument)
84 {
85 xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
86 xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
87 }
88 }catch(e)
89 {
90 jQuery.handleError(s, xml, null, e);
91 }
92 if( xml || isTimeout == "timeout")
93 {
94 requestDone = true;
95 var status;
96 try {
97 status = isTimeout != "timeout" ? "success" : "error";
98 // Make sure that the request was successful or notmodified
99 if( status != "error" )
100 {
101 // process the data (runs the xml through httpData regardless of callback)
102 var data = jQuery.uploadHttpData( xml, s.dataType );
103 if( s.success )
104 {
105 // ifa local callback was specified, fire it and pass it the data
106 s.success( data, status );
107 };
108 if( s.global )
109 {
110 // Fire the global callback
111 jQuery.event.trigger( "ajaxSuccess", [xml, s] );
112 };
113 } else
114 {
115 jQuery.handleError(s, xml, status);
116 }
117
118 } catch(e)
119 {
120 status = "error";
121 jQuery.handleError(s, xml, status, e);
122 };
123 if( s.global )
124 {
125 // The request was completed
126 jQuery.event.trigger( "ajaxComplete", [xml, s] );
127 };
128
129
130 // Handle the global AJAX counter
131 if(s.global && ! --jQuery.active)
132 {
133 jQuery.event.trigger("ajaxStop");
134 };
135 if(s.complete)
136 {
137 s.complete(xml, status);
138 } ;
139
140 jQuery(io).unbind();
141
142 setTimeout(function()
143 { try
144 {
145 jQuery(io).remove();
146 jQuery(form).remove();
147
148 } catch(e)
149 {
150 jQuery.handleError(s, xml, null, e);
151 }
152
153 }, 100);
154
155 xml = null;
156
157 };
158 }
159 // Timeout checker
160 if( s.timeout > 0 )
161 {
162 setTimeout(function(){
163
164 if( !requestDone )
165 {
166 // Check to see ifthe request is still happening
167 uploadCallback( "timeout" );
168 }
169
170 }, s.timeout);
171 }
172 try
173 {
174 var form = jQuery('#' + formId);
175 jQuery(form).attr('action', s.url);
176 jQuery(form).attr('method', 'POST');
177 jQuery(form).attr('target', frameId);
178 if(form.encoding)
179 {
180 form.encoding = 'multipart/form-data';
181 }
182 else
183 {
184 form.enctype = 'multipart/form-data';
185 }
186 jQuery(form).submit();
187
188 } catch(e)
189 {
190 jQuery.handleError(s, xml, null, e);
191 }
192 if(window.attachEvent){
193 document.getElementById(frameId).attachEvent('onload', uploadCallback);
194 }
195 else{
196 document.getElementById(frameId).addEventListener('load', uploadCallback, false);
197 }
198 return {abort: function () {}};
199
200 },
201
202
203 handleError: function( s, xhr, status, e ) {
204 // If a local callback was specified, fire it
205 if ( s.error ) {
206 s.error.call( s.context || s, xhr, status, e );
207 }
208
209 // Fire the global callback
210 if ( s.global ) {
211 (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
212 }
213 },
214
215 uploadHttpData: function( r, type ) {
216 var data = !type;
217 data = type == "xml" || data ? r.responseXML : r.responseText;
218 // ifthe type is "script", eval it in global context
219 if( type == "script" )
220 {
221 jQuery.globalEval( data );
222 }
223
224 // Get the JavaScript object, ifJSON is used.
225 if( type == "json" )
226 {
227 eval( "data = " + data );
228 }
229
230 // evaluate scripts within html
231 if( type == "html" )
232 {
233 jQuery("<div>").html(data).evalScripts();
234 }
235
236 return data;
237 }
238 });
239
240
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_cate" property="goodsCate" jdbcType="VARCHAR" />
12 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
13 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
14 <result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
15 <result column="unit" property="unit" jdbcType="VARCHAR" />
16 <result column="settle_price" property="settleUnit" jdbcType="DECIMAL" />
17 <result column="settle_amount" property="settlePrice" jdbcType="DECIMAL" />
18 <result column="regist_key" property="registKey" jdbcType="VARCHAR" />
19 <result column="producer_name" property="producerName" jdbcType="VARCHAR" />
20 <result column="lot" property="lot" jdbcType="VARCHAR" />
21 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
22 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
23 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
24 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,settle_bill_no,row_no,goods_code,goods_name,settle_qty,unit,settle_price,settle_amount,regist_key,producer_name,lot,production_date,expire_date,create_time,update_time,goods_cate</sql>
29
30 <!--批量插入BillBackDetail -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_bill_settlement_detail (id,settle_bill_no,row_no,goods_code,goods_name,settle_qty,unit,settle_price,settle_amount,regist_key,producer_name,lot,production_date,expire_date,create_time,update_time,goods_cate)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.settleBillNo},
38 #{obj.rowNo},
39 #{obj.goodsCode},
40 #{obj.goodsName},
41 #{obj.settleQty},
42 #{obj.unit},
43 #{obj.settlePrice},
44 #{obj.settleAmount},
45 #{obj.registKey},
46 #{obj.producerName},
47 #{obj.lot},
48 #{obj.productionDate},
49 #{obj.expireDate},
50 #{obj.create_time},
51 #{obj.update_time},
52 #{obj.goodsCate}
53 </trim>
54 </foreach>
55 </insert>
56
57 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.medplan;
2
3 import java.util.List;
4
5 public class MedPlanDto {
6
7 private List<MedPlan> list;
8
9 public List<MedPlan> getList() {
10 return list;
11 }
12
13 public void setList(List<MedPlan> list) {
14 this.list = list;
15 }
16
17 }
1 package com.phxl.modules.goods.entity.suoutstore;
2
3 public class SuOutStoreWithDetail {
4 public SuOutStore getBill() {
5 return bill;
6 }
7
8 public void setBill(SuOutStore bill) {
9 this.bill = bill;
10 }
11
12 private SuOutStore bill;
13
14 }
1 package com.phxl.modules.goods.entity.hisCtMedicineMaterial;
2
3 import java.math.BigDecimal;
4 /**
5 *
6 * @ClassName: HisCtMedicineMaterial
7 * @Description: 药品目录表实体类
8 * @author zhangbing
9 * @date 2018-09-18 14:44:26
10 *
11 */
12 public class HisCtMedicineMaterial{
13
14 private String id;
15 private String medCode; //HIS库房编码
16 private String medName; //HIS库房名称
17 public String getMedCode() {
18 return medCode;
19 }
20 private String goodsCode; //HIS商品编码
21 private String goodsSpec; //规格
22 private String goodsName; //商品名称
23 private String sName; //通用名称
24 private String pName; //打印名称
25 private String helpCode; //助记码
26 private String producer; //生产厂商
27 private String agentName; //代理商/售后服务机构
28 private String medGoodsCateGUID; //商品类别GUID
29 private String medGoodsCateName; //商品类别名称
30 private String registKey; //批准文号
31 private BigDecimal price; //采购价
32 private BigDecimal salePrice; //零售价
33 private BigDecimal batSalePrice; //批发价
34 private String productionAddress; //产地
35 private String dosageForm; //剂型
36 private BigDecimal length; //长
37 private BigDecimal width; //宽
38 private BigDecimal height; //高
39 private BigDecimal grossWeight; //毛重
40 private BigDecimal netWeight; //净重
41 private String unitStyle; //计量单位,最小单位:支、片等
42 private String bigUnitStyle; //大包装单位
43 private BigDecimal bigUnitQty; //大包装含量
44 private String bigBcd; //大包装条码
45 private String minUnitStyle; //小包装单位
46 private BigDecimal minUnitQty; //小包装含量
47 private String litBcd; //小包装条码
48 private String isLotCtrlInput; //批号必输检验
49 private String bizState; //业务状态
50 private String importedFlag; //生产来源
51 private String reportFlag; //报告药标识
52 private String noxiousFlag; //毒麻标识
53 private String drugNerveFlag; //精神药标识
54 private String productStandardCode; //产品本位码
55 private String specStandardCode; //规格本位码
56 private String brand; //品牌
57 private String coldFlag; //冷藏标识
58 private String supplierCode; //供应商编码
59 private String supplierName; //供应商名称
60 private String memo; //备注
61 public void setMedCode(String medCode) {
62 this.medCode = medCode;
63 }
64 public String getMedName() {
65 return medName;
66 }
67 public void setMedName(String medName) {
68 this.medName = medName;
69 }
70 public String getGoodsCode() {
71 return goodsCode;
72 }
73 public void setGoodsCode(String goodsCode) {
74 this.goodsCode = goodsCode;
75 }
76 public String getGoodsSpec() {
77 return goodsSpec;
78 }
79 public void setGoodsSpec(String goodsSpec) {
80 this.goodsSpec = goodsSpec;
81 }
82 public String getGoodsName() {
83 return goodsName;
84 }
85 public void setGoodsName(String goodsName) {
86 this.goodsName = goodsName;
87 }
88 public String getsName() {
89 return sName;
90 }
91 public void setsName(String sName) {
92 this.sName = sName;
93 }
94 public String getpName() {
95 return pName;
96 }
97 public void setpName(String pName) {
98 this.pName = pName;
99 }
100 public String getHelpCode() {
101 return helpCode;
102 }
103 public void setHelpCode(String helpCode) {
104 this.helpCode = helpCode;
105 }
106 public String getProducer() {
107 return producer;
108 }
109 public void setProducer(String producer) {
110 this.producer = producer;
111 }
112 public String getAgentName() {
113 return agentName;
114 }
115 public void setAgentName(String agentName) {
116 this.agentName = agentName;
117 }
118 public String getMedGoodsCateGUID() {
119 return medGoodsCateGUID;
120 }
121 public void setMedGoodsCateGUID(String medGoodsCateGUID) {
122 this.medGoodsCateGUID = medGoodsCateGUID;
123 }
124 public String getMedGoodsCateName() {
125 return medGoodsCateName;
126 }
127 public void setMedGoodsCateName(String medGoodsCateName) {
128 this.medGoodsCateName = medGoodsCateName;
129 }
130 public String getRegistKey() {
131 return registKey;
132 }
133 public void setRegistKey(String registKey) {
134 this.registKey = registKey;
135 }
136 public BigDecimal getPrice() {
137 return price;
138 }
139 public void setPrice(BigDecimal price) {
140 this.price = price;
141 }
142 public BigDecimal getSalePrice() {
143 return salePrice;
144 }
145 public void setSalePrice(BigDecimal salePrice) {
146 this.salePrice = salePrice;
147 }
148 public BigDecimal getBatSalePrice() {
149 return batSalePrice;
150 }
151 public void setBatSalePrice(BigDecimal batSalePrice) {
152 this.batSalePrice = batSalePrice;
153 }
154 public String getProductionAddress() {
155 return productionAddress;
156 }
157 public void setProductionAddress(String productionAddress) {
158 this.productionAddress = productionAddress;
159 }
160 public String getDosageForm() {
161 return dosageForm;
162 }
163 public void setDosageForm(String dosageForm) {
164 this.dosageForm = dosageForm;
165 }
166 public BigDecimal getLength() {
167 return length;
168 }
169 public void setLength(BigDecimal length) {
170 this.length = length;
171 }
172 public BigDecimal getWidth() {
173 return width;
174 }
175 public void setWidth(BigDecimal width) {
176 this.width = width;
177 }
178 public BigDecimal getHeight() {
179 return height;
180 }
181 public void setHeight(BigDecimal height) {
182 this.height = height;
183 }
184 public BigDecimal getGrossWeight() {
185 return grossWeight;
186 }
187 public void setGrossWeight(BigDecimal grossWeight) {
188 this.grossWeight = grossWeight;
189 }
190 public BigDecimal getNetWeight() {
191 return netWeight;
192 }
193 public void setNetWeight(BigDecimal netWeight) {
194 this.netWeight = netWeight;
195 }
196 public String getUnitStyle() {
197 return unitStyle;
198 }
199 public void setUnitStyle(String unitStyle) {
200 this.unitStyle = unitStyle;
201 }
202 public String getBigUnitStyle() {
203 return bigUnitStyle;
204 }
205 public void setBigUnitStyle(String bigUnitStyle) {
206 this.bigUnitStyle = bigUnitStyle;
207 }
208 public BigDecimal getBigUnitQty() {
209 return bigUnitQty;
210 }
211 public void setBigUnitQty(BigDecimal bigUnitQty) {
212 this.bigUnitQty = bigUnitQty;
213 }
214 public String getBigBcd() {
215 return bigBcd;
216 }
217 public void setBigBcd(String bigBcd) {
218 this.bigBcd = bigBcd;
219 }
220 public String getMinUnitStyle() {
221 return minUnitStyle;
222 }
223 public void setMinUnitStyle(String minUnitStyle) {
224 this.minUnitStyle = minUnitStyle;
225 }
226 public BigDecimal getMinUnitQty() {
227 return minUnitQty;
228 }
229 public void setMinUnitQty(BigDecimal minUnitQty) {
230 this.minUnitQty = minUnitQty;
231 }
232 public String getLitBcd() {
233 return litBcd;
234 }
235 public void setLitBcd(String litBcd) {
236 this.litBcd = litBcd;
237 }
238 public String getIsLotCtrlInput() {
239 return isLotCtrlInput;
240 }
241 public void setIsLotCtrlInput(String isLotCtrlInput) {
242 this.isLotCtrlInput = isLotCtrlInput;
243 }
244 public String getBizState() {
245 return bizState;
246 }
247 public void setBizState(String bizState) {
248 this.bizState = bizState;
249 }
250 public String getImportedFlag() {
251 return importedFlag;
252 }
253 public void setImportedFlag(String importedFlag) {
254 this.importedFlag = importedFlag;
255 }
256 public String getReportFlag() {
257 return reportFlag;
258 }
259 public void setReportFlag(String reportFlag) {
260 this.reportFlag = reportFlag;
261 }
262 public String getNoxiousFlag() {
263 return noxiousFlag;
264 }
265 public void setNoxiousFlag(String noxiousFlag) {
266 this.noxiousFlag = noxiousFlag;
267 }
268 public String getDrugNerveFlag() {
269 return drugNerveFlag;
270 }
271 public void setDrugNerveFlag(String drugNerveFlag) {
272 this.drugNerveFlag = drugNerveFlag;
273 }
274 public String getProductStandardCode() {
275 return productStandardCode;
276 }
277 public void setProductStandardCode(String productStandardCode) {
278 this.productStandardCode = productStandardCode;
279 }
280 public String getSpecStandardCode() {
281 return specStandardCode;
282 }
283 public void setSpecStandardCode(String specStandardCode) {
284 this.specStandardCode = specStandardCode;
285 }
286 public String getBrand() {
287 return brand;
288 }
289 public void setBrand(String brand) {
290 this.brand = brand;
291 }
292 public String getColdFlag() {
293 return coldFlag;
294 }
295 public void setColdFlag(String coldFlag) {
296 this.coldFlag = coldFlag;
297 }
298 public String getSupplierCode() {
299 return supplierCode;
300 }
301 public void setSupplierCode(String supplierCode) {
302 this.supplierCode = supplierCode;
303 }
304 public String getSupplierName() {
305 return supplierName;
306 }
307 public void setSupplierName(String supplierName) {
308 this.supplierName = supplierName;
309 }
310 public String getMemo() {
311 return memo;
312 }
313 public void setMemo(String memo) {
314 this.memo = memo;
315 }
316 public String getId() {
317 return id;
318 }
319 public void setId(String id) {
320 this.id = id;
321 }
322
323 }
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:aop="http://www.springframework.org/schema/aop"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:mvc="http://www.springframework.org/schema/mvc"
6 xmlns:tx="http://www.springframework.org/schema/tx"
7 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8 xsi:schemaLocation="http://www.springframework.org/schema/aop
9 http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
10 http://www.springframework.org/schema/beans
11 http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
12 http://www.springframework.org/schema/context
13 http://www.springframework.org/schema/context/spring-context-4.1.xsd
14 http://www.springframework.org/schema/mvc
15 http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
16 http://www.springframework.org/schema/tx
17 http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
18
19 <mvc:annotation-driven>
20 <mvc:message-converters register-defaults="true">
21 <bean class="org.springframework.http.converter.StringHttpMessageConverter">
22 <constructor-arg value="UTF-8" />
23 </bean>
24 </mvc:message-converters>
25 </mvc:annotation-driven>
26
27 <mvc:default-servlet-handler/>
28 <context:component-scan base-package="com.phxl.*" />
29
30
31
32 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
33 <property name="prefix" value="/WEB-INF/views/" />
34 <property name="suffix" value=".jsp" />
35 </bean>
36
37 <bean id="multipartResolver"
38 class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
39 <!--设置最大上传文件501M-->
40 <property name="maxUploadSize" value="525336576"/>
41
42 <property name="resolveLazily" value="true"/>
43 </bean>
44
45
46
47
48 <!-- 处理JSON数据转换的 -->
49 <bean id="mappingJacksonHttpMessageConverter"
50 class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
51 <property name="supportedMediaTypes">
52 <list>
53 <value>text/html;charset=UTF-8</value>
54 <value>text/xml;charset=UTF-8</value>
55 <value>application/xml;charset=UTF-8</value>
56 </list>
57 </property>
58 </bean>
59
60
61
62
63 <!-- SpringMVC在超出上传文件限制时,会抛出org.springframework.web.multipart.MaxUploadSizeExceededException -->
64 <!-- 该异常是SpringMVC在检查上传的文件信息时抛出来的,而且此时还没有进入到Controller方法中 -->
65 <!-- <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
66 <property name="exceptionMappings">
67 <props>
68 遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面
69 <prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">error</prop>
70 </props>
71 </property>
72 </bean> -->
73 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 <root>
2 <facet id="jst.jaxrs">
3 <node name="libprov">
4 <attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
5 </node>
6 </facet>
7 </root>
1 package com.phxl.modules.goods.dao.invoiceback;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail;
6
7 public interface SuInvoiceBackDetailDao {
8
9 void batchInsert(List<SuInvoiceBackDetail> backDetails);
10
11 }
1 package com.phxl.modules.goods.web.spd;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.servlet.http.HttpServletRequest;
8
9 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
10
11 import org.apache.http.HttpEntity;
12 import org.apache.http.HttpResponse;
13 import org.apache.http.client.HttpClient;
14 import org.apache.http.client.methods.HttpPost;
15 import org.apache.http.entity.mime.MultipartEntityBuilder;
16 import org.apache.http.entity.mime.content.FileBody;
17 import org.apache.http.impl.client.HttpClients;
18 import org.apache.http.util.EntityUtils;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.stereotype.Controller;
23 import org.springframework.web.bind.annotation.RequestBody;
24 import org.springframework.web.bind.annotation.RequestMapping;
25 import org.springframework.web.bind.annotation.RequestMethod;
26 import org.springframework.web.bind.annotation.RequestParam;
27 import org.springframework.web.bind.annotation.ResponseBody;
28 import org.springframework.web.multipart.MultipartFile;
29
30 import com.alibaba.fastjson.JSON;
31 import com.alibaba.fastjson.JSONObject;
32 import com.alibaba.fastjson.serializer.SerializerFeature;
33 import com.fasterxml.jackson.annotation.JsonFormat;
34 import com.phxl.common.constants.PlatformConstant;
35 import com.phxl.common.response.PlatFormResponse;
36 import com.phxl.common.response.PlatFormResponseConstant;
37 import com.phxl.common.util.HTTPClient;
38 import com.phxl.common.util.JsonMapper;
39 import com.phxl.common.utils.IdUtil;
40 import com.phxl.modules.goods.entity.billback.BillBack;
41 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
42 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
43 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
44 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
45 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
46 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
47 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
48 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
49 import com.phxl.modules.goods.entity.medplan.MedPlan;
50 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
51 import com.phxl.modules.goods.entity.medstock.MedStock;
52 import com.phxl.modules.goods.entity.medstock.MedStockList;
53 import com.phxl.modules.goods.entity.spills.HisSpills;
54 import com.phxl.modules.goods.entity.spills.HisSpillsList;
55 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
56 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
57 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
58 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
59 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
60 import com.phxl.modules.goods.service.billback.BillBackService;
61 import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
62 import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
63 import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
64 import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
65 import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
66 import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
67 import com.phxl.modules.goods.service.medinstore.MedInStoreService;
68 import com.phxl.modules.goods.service.medplan.MedPlanService;
69 import com.phxl.modules.goods.service.medstock.MedStockService;
70 import com.phxl.modules.goods.service.spills.HisSpillsService;
71 import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
72 import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
73 import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
74
75 @Controller
76 @RequestMapping(value = "/Api")
77 public class SpdControlller {
78
79 /**
80 * 日志对象
81 */
82 protected Logger logger = LoggerFactory.getLogger(getClass());
83
84 @Autowired
85 private HisCtMedicineMaterialService ctMedicineMaterialService;
86
87 @Autowired
88 private InterfaceLogService interfaceLogService;
89
90 @Autowired
91 private HisCtDeptService hisCtDeptService;
92
93 @Autowired
94 private CTCareProvService cTCareProvService;
95
96 @Autowired
97 private MedSupplyGoodsService supplyGoodsService;
98
99 @Autowired
100 private MedStockService stockService;
101
102 @Autowired
103 private MedPlanService medPlanService;
104
105 @Autowired
106 private MedInStoreService medInStoreService;
107
108 @Autowired
109 private BillBackService backService;
110
111 @Autowired
112 private BillSettlementService billSettlementService;
113
114 @Autowired
115 private SupplierStockService supplierStockService;
116
117 @Autowired
118 private SuOutStoreService suOutStoreService;
119
120 @Autowired
121 private HisSpillsService hisSpillsService;
122
123 @Autowired
124 private SuInvoiceBackService suInvoiceBackService;
125
126
127 @RequestMapping(value="/setMFMedGoods")
128 @ResponseBody
129 public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
130 logger.debug("药品目录接口请求参数:{}",medgoodsList);
131 String result = "";
132 String logId = IdUtil.uuid();
133 String exception = "";
134 interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
135 PlatFormResponse response = new PlatFormResponse();
136 List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
137 try {
138 materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
139 for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
140 ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
141 }
142 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
143 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
144 result = JSON.toJSONString(response);
145 //medgoodsList = ctMedicineMaterialService.createRequest();
146 //供应商服务请求:
147 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
148 } catch (Exception e) {
149 logger.error(e.getMessage());
150 exception = e.getMessage();
151 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
152 response.setMsg(e.getMessage());
153 result = JSON.toJSONString(response);
154 }
155 interfaceLogService.setResultLog(response, logId, exception);
156 return result;
157 }
158
159 @RequestMapping(value="/setHDept")
160 @ResponseBody
161 public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
162 logger.debug("医院科室资料接口请求参数:{}",params);
163 String result = "";
164 String logId = IdUtil.uuid();
165 String exception = "";
166 interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
167 PlatFormResponse response = new PlatFormResponse();
168 List<HisCtDept> depts = new ArrayList<HisCtDept>();
169 try {
170 depts = JSONObject.parseArray(params, HisCtDept.class);
171 int end = hisCtDeptService.batchSaveOrUpdate(depts);
172 if(end==1){
173 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
174 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
175 }else{
176 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
177 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
178 }
179 result = JSON.toJSONString(response);
180 //供应商服务请求:
181 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
182 } catch (Exception e) {
183 logger.error(e.getMessage());
184 exception = e.getMessage();
185 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
186 response.setMsg(e.getMessage());
187 result = JSON.toJSONString(response);
188 }
189 interfaceLogService.setResultLog(response, logId, exception);
190 return result;
191 }
192
193 /**
194 * 医院人员资料接口
195 * @param request
196 * @param params
197 * @return
198 */
199 @RequestMapping("/setMedStaff")
200 @ResponseBody
201 public String setMedStaff(HttpServletRequest request, @RequestBody String params){
202 logger.debug("医院人员资料接口请求参数:{}",params);
203 String result = "";
204 String logId = IdUtil.uuid();
205 String exception = "";
206 interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
207 PlatFormResponse response = new PlatFormResponse();
208 List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
209 boolean end = false;
210 try {
211 careProvs = JSONObject.parseArray(params, CTCareProv.class);
212 end = cTCareProvService.batchSaveOrUpdate(careProvs);
213 if(end){
214 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
215 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
216 }else{
217 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
218 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
219 }
220 result = JSON.toJSONString(response);
221 //供应商服务请求:
222 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
223 } catch (Exception e) {
224 logger.error(e.getMessage());
225 exception = e.getMessage();
226 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
227 response.setMsg(e.getMessage());
228 result = JSON.toJSONString(response);
229 }
230 interfaceLogService.setResultLog(response, logId, exception);
231 return result;
232 }
233
234
235 /**
236 * 医院采购目录接口
237 * @param request
238 * @param params
239 * @return
240 */
241 @RequestMapping("/setMFSupplyGoods")
242 @ResponseBody
243 public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
244 logger.debug("医院采购目录接口请求参数:{}",params);
245 String result = "";
246 String logId = IdUtil.uuid();
247 String exception = "";
248 interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
249 PlatFormResponse response = new PlatFormResponse();
250 List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
251 boolean end = false;
252 try {
253 supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
254 end = supplyGoodsService.batchSave(supplyGoods);
255 if(end){
256 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
257 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
258 }else{
259 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
260 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
261 }
262 result = JSON.toJSONString(response);
263 //供应商服务请求:
264 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
265 } catch (Exception e) {
266 logger.error(e.getMessage());
267 exception = e.getMessage();
268 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
269 response.setMsg(e.getMessage());
270 result = JSON.toJSONString(response);
271 }
272 interfaceLogService.setResultLog(response, logId, exception);
273 return result;
274 }
275
276
277 /**
278 * 医院库存接口
279 * @param request
280 * @param params
281 * @return
282 */
283 @ResponseBody
284 @RequestMapping(value="/setMedStock",method = RequestMethod.POST)
285 public String setMedStock(HttpServletRequest request, @RequestBody String params){
286 logger.debug("HLI同步医院库存数据请求参数:{}",params);
287 String result = "";
288 String logId = IdUtil.uuid();
289 String exception = "";
290 interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
291 PlatFormResponse response = new PlatFormResponse();
292 List<MedStockList> stocks = new ArrayList<MedStockList>();
293 boolean end = false;
294 try {
295 stocks = JSONObject.parseArray(params, MedStockList.class);
296 end = stockService.batchSave(stocks);
297 if(end){
298 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
299 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
300 }else{
301 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
302 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
303 }
304 result = JSON.toJSONString(response);
305 //供应商服务请求:
306 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
307 } catch (Exception e) {
308 logger.error(e.getMessage());
309 exception = e.getMessage();
310 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
311 response.setMsg(e.getMessage());
312 result = JSON.toJSONString(response);
313 }
314 interfaceLogService.setResultLog(response, logId, exception);
315 return result;
316 }
317
318
319 /**
320 * 医院补货计划接口
321 * @param request
322 * @param params
323 * @return
324 */
325 @RequestMapping("/setMedPlan")
326 @ResponseBody
327 public String setMedPlan(HttpServletRequest request, @RequestBody String params){
328 logger.debug("补货计划接口请求参数:{}",params);
329 String result = "";
330 String logId = IdUtil.uuid();
331 String exception = "";
332 interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
333 PlatFormResponse response = new PlatFormResponse();
334 List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
335 boolean end = false;
336 try {
337 //改成批量的操作
338 medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
339 end = medPlanService.batchSave(medPlans);
340 if(end){
341 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
342 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
343 }else{
344 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
345 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
346 }
347 result = JSON.toJSONString(response);
348 //供应商服务请求:
349 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
350 } catch (Exception e) {
351 logger.error(e.getMessage());
352 exception = e.getMessage();
353 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
354 response.setMsg(e.getMessage());
355 result = JSON.toJSONString(response);
356 }
357 interfaceLogService.setResultLog(response, logId, exception);
358 return result;
359 }
360
361
362 /**
363 * 医院退货接口
364 * @param request
365 * @param params
366 * @return
367 */
368 @RequestMapping("/setTRMedRPI")
369 @ResponseBody
370 public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
371 logger.debug("医院退货计划接口请求参数:{}",params);
372 String result = "";
373 String logId = IdUtil.uuid();
374 String exception = "";
375 interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
376 PlatFormResponse response = new PlatFormResponse();
377 List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
378 boolean end = false;
379 try {
380 billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
381 end = backService.batchSave(billBacks);
382 if(end){
383 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
384 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
385 }else{
386 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
387 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
388 }
389 result = JSON.toJSONString(response);
390 //供应商服务请求:
391 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
392 } catch (Exception e) {
393 logger.error(e.getMessage());
394 exception = e.getMessage();
395 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
396 response.setMsg(e.getMessage());
397 result = JSON.toJSONString(response);
398 }
399 interfaceLogService.setResultLog(response, logId, exception);
400 return result;
401 }
402
403 /**
404 * 结算单接口
405 * @param request
406 * @param params
407 * @return
408 */
409 @RequestMapping("/setTRSettle")
410 @ResponseBody
411 public String setTRSettle(HttpServletRequest request, @RequestBody String params){
412 logger.debug("同步医院结算单请求参数:{}",params);
413 String result = "";
414 String logId = IdUtil.uuid();
415 String exception = "";
416 interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
417 PlatFormResponse response = new PlatFormResponse();
418 List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
419 boolean end = false;
420 try {
421 settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
422 end = billSettlementService.batchSave(settlementWithDetails);
423 if(end){
424 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
425 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
426 }else{
427 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
428 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
429 }
430 result = JSON.toJSONString(response);
431 //供应商服务请求:
432 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
433 } catch (Exception e) {
434 logger.error(e.getMessage());
435 exception = e.getMessage();
436 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
437 response.setMsg(e.getMessage());
438 result = JSON.toJSONString(response);
439 }
440 interfaceLogService.setResultLog(response, logId, exception);
441 return result;
442 }
443
444
445 /**
446 * 供应商库存接口
447 * @param request
448 * @param params
449 * @return
450 */
451 @RequestMapping("/setStock")
452 @ResponseBody
453 public String setStock(HttpServletRequest request, @RequestBody String params){
454 logger.debug("供应商同步库存数据请求参数:{}",params);
455 String result = "";
456 String logId = IdUtil.uuid();
457 String exception = "";
458 interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
459 PlatFormResponse response = new PlatFormResponse();
460 List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
461 boolean end = false;
462 try {
463 supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
464 end = supplierStockService.batchSave(supplierStocks);
465 if(end){
466 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
467 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
468 }else{
469 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
470 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
471 }
472 result = JSON.toJSONString(response);
473 try
474 {
475 //SPD服务请求:
476 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
477 response = JSONObject.parseObject(result,PlatFormResponse.class);
478 response.setMsg("SPD:"+response.getMsg());
479 }
480 catch(Exception ex){
481 logger.error("SPD:"+ex.getMessage());
482 exception = "SPD:"+ex.getMessage();
483 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
484 response.setMsg("SPD:"+ex.getMessage());
485 result = JSON.toJSONString(response);
486 }
487
488 } catch (Exception e) {
489 logger.error("前置机:"+e.getMessage());
490 exception = "前置机:"+e.getMessage();
491 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
492 response.setMsg("前置机:"+e.getMessage());
493 result = JSON.toJSONString(response);
494 }
495 interfaceLogService.setResultLog(response, logId, exception);
496 return result;
497 }
498
499
500 /**
501 * 供应商出库单接口
502 * @param request
503 * @param params
504 * @return
505 */
506 @RequestMapping("/setTrmedwv")
507 @ResponseBody
508 public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
509 logger.debug("同步供应商出库单请求参数:{}",params);
510 String result = "";
511 String logId = IdUtil.uuid();
512 String exception = "";
513 interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
514 PlatFormResponse response = new PlatFormResponse();
515 List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
516 boolean end = false;
517 try {
518 suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
519 end = suOutStoreService.batchSave(suOutStores);
520 if(end){
521 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
522 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
523 }else{
524 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
525 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
526 }
527 result = JSON.toJSONString(response);
528 try
529 {
530 //SPD服务请求:
531 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
532 response = JSONObject.parseObject(result,PlatFormResponse.class);
533 response.setMsg("SPD:"+response.getMsg());
534 }
535 catch(Exception ex){
536 logger.error("SPD:"+ex.getMessage());
537 exception = "SPD:"+ex.getMessage();
538 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
539 response.setMsg("SPD:"+ex.getMessage());
540 result = JSON.toJSONString(response);
541 }
542
543 } catch (Exception e) {
544 logger.error("前置机:"+e.getMessage());
545 exception = "前置机:"+e.getMessage();
546 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
547 response.setMsg("前置机:"+e.getMessage());
548 result = JSON.toJSONString(response);
549 }
550 interfaceLogService.setResultLog(response, logId, exception);
551 return result;
552 }
553
554 /**
555 * 医院盘点损溢接口
556 * @param request
557 * @param params
558 * @return
559 */
560 @RequestMapping(value="/setTrDiff")
561 @ResponseBody
562 public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
563 logger.debug("医院盘点损溢接口请求参数:{}",params);
564 String result = "";
565 String logId = IdUtil.uuid();
566 String exception = "";
567 interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
568 PlatFormResponse response = new PlatFormResponse();
569 List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
570 boolean end = false;
571 try {
572 spills = JSONObject.parseArray(params, HisSpillsList.class);
573 end = hisSpillsService.batchSave(spills);
574 if(end){
575 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
576 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
577 }else{
578 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
579 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
580 }
581 result = JSON.toJSONString(response);
582 //供应商服务请求:
583 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
584 } catch (Exception e) {
585 logger.error(e.getMessage());
586 exception = e.getMessage();
587 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
588 response.setMsg(e.getMessage());
589 result = JSON.toJSONString(response);
590 }
591 interfaceLogService.setResultLog(response, logId, exception);
592 return result;
593 }
594
595
596 /**
597 * 供应商发票回传接口
598 * @param request
599 * @param params
600 * @return
601 */
602 @RequestMapping("/setInvoice")
603 @ResponseBody
604 public String setInvoice(HttpServletRequest request, @RequestBody String params){
605 logger.debug("供应商发票回传接口请求参数:{}",params);
606 String result = "";
607 String logId = IdUtil.uuid();
608 String exception = "";
609 interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
610 PlatFormResponse response = new PlatFormResponse();
611 List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
612 boolean end = false;
613 try {
614 suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
615 end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
616 if(end){
617 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
618 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
619 }else{
620 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
621 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
622 }
623 result = JSON.toJSONString(response);
624 try
625 {
626 //SPD服务请求:
627 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
628 response = JSONObject.parseObject(result,PlatFormResponse.class);
629 response.setMsg("SPD:"+response.getMsg());
630 }
631 catch(Exception ex){
632 logger.error("SPD:"+ex.getMessage());
633 exception = "SPD:"+ex.getMessage();
634 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
635 response.setMsg("SPD:"+ex.getMessage());
636 result = JSON.toJSONString(response);
637 }
638
639 } catch (Exception e) {
640 logger.error("前置机:"+e.getMessage());
641 exception = "前置机:"+e.getMessage();
642 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
643 response.setMsg("前置机:"+e.getMessage());
644 result = JSON.toJSONString(response);
645 }
646 interfaceLogService.setResultLog(response, logId, exception);
647 return result;
648 }
649
650 /*
651 * 医院入库单回传接口
652 * @param request
653 * @param params
654 * @return
655 */
656 @RequestMapping("/setMedInStore")
657 @ResponseBody
658 public String setMedInStore(HttpServletRequest request, @RequestBody String params){
659 logger.debug("医院入库单回传接口请求参数:{}",params);
660 String result = "";
661 String logId = IdUtil.uuid();
662 String exception = "";
663 interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
664 PlatFormResponse response = new PlatFormResponse();
665 List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
666 boolean end = false;
667 try {
668 //改成批量的操作
669 medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
670 end = medInStoreService.batchSave(medInStores);
671 if(end){
672 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
673 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
674 }else{
675 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
676 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
677 }
678 result = JSON.toJSONString(response);
679 //供应商服务请求:
680 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
681 } catch (Exception e) {
682 logger.error(e.getMessage());
683 exception = e.getMessage();
684 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
685 response.setMsg(e.getMessage());
686 result = JSON.toJSONString(response);
687 }
688 interfaceLogService.setResultLog(response, logId, exception);
689 return result;
690 }
691
692 /***
693 * 推送对账数据到平台
694 * @param params
695 * @return
696 */
697 @RequestMapping("/pushBalance")
698 @ResponseBody
699 public String pushBalance(@RequestBody String params) {
700 logger.debug("推送对账数据:{}", params);
701 String result = "";
702 String logId = IdUtil.uuid();
703 String exception = "";
704 interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
705 PlatFormResponse response = new PlatFormResponse();
706 try {
707 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
708 JSONObject jsonObject = JSONObject.parseObject(result);
709 if(jsonObject.getIntValue("errorCode") != 0){
710 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
711 }else {
712 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
713 }
714 response.setMsg(jsonObject.getString("message"));
715 } catch (Exception e) {
716 logger.error(e.getMessage());
717 exception = e.getMessage();
718 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
719 response.setMsg("发送对账数据给平台错误:" + e.getMessage());
720 result = JSON.toJSONString(response);
721 }
722 interfaceLogService.setResultLog(response, logId, exception);
723 return result;
724
725 }
726
727
728 /**
729 * 推送发药数据到平台
730 * @param params
731 * @return
732 */
733 @RequestMapping("/pushDispensing")
734 @ResponseBody
735 public String pushDispensing(@RequestBody String params){
736 logger.debug("推送发药数据:{}", params);
737 String result = "";
738 String logId = IdUtil.uuid();
739 String exception = "";
740 interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
741 PlatFormResponse response = new PlatFormResponse();
742 try {
743 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
744 JSONObject jsonObject = JSONObject.parseObject(result);
745 if(jsonObject.getIntValue("errorCode") != 0){
746 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
747 }else {
748 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
749 }
750 response.setMsg(jsonObject.getString("message"));
751 } catch (Exception e) {
752 logger.error(e.getMessage());
753 exception = e.getMessage();
754 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
755 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
756 result = JSON.toJSONString(response);
757 }
758 interfaceLogService.setResultLog(response, logId, exception);
759 return result;
760 }
761
762
763 /**
764 * 推送库存数据到平台
765 * @param params
766 * @return
767 */
768 @RequestMapping("/pushStock")
769 @ResponseBody
770 public String pushStock(@RequestBody String params){
771 logger.debug("推送库存数据:{}", params);
772 String result = "";
773 String logId = IdUtil.uuid();
774 String exception = "";
775 interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
776 PlatFormResponse response = new PlatFormResponse();
777 try {
778 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
779 JSONObject jsonObject = JSONObject.parseObject(result);
780 if(jsonObject.getIntValue("errorCode") != 0){
781 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
782 }else {
783 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
784 }
785 response.setMsg(jsonObject.getString("message"));
786 } catch (Exception e) {
787 logger.error(e.getMessage());
788 exception = e.getMessage();
789 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
790 response.setMsg("发送库存数据给平台错误:" + e.getMessage());
791 result = JSON.toJSONString(response);
792 }
793 interfaceLogService.setResultLog(response, logId, exception);
794 return result;
795 }
796
797 /**
798 * 推送证照数据到平台
799 * @param params
800 * @return
801 */
802 @RequestMapping("/pushlicinfo")
803 @ResponseBody
804 public String pushlicinfo(@RequestBody String params){
805 logger.debug("证照数据:{}", params);
806 String result = "";
807 String logId = IdUtil.uuid();
808 String exception = "";
809 interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
810 PlatFormResponse response = new PlatFormResponse();
811 try {
812 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
813 JSONObject jsonObject = JSONObject.parseObject(result);
814 if(jsonObject.getIntValue("errorCode") != 0){
815 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
816 }else {
817 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
818 }
819 response.setMsg(jsonObject.getString("message"));
820 } catch (Exception e) {
821 logger.error(e.getMessage());
822 exception = e.getMessage();
823 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
824 response.setMsg("发送证照数据给平台错误:" + e.getMessage());
825 result = JSON.toJSONString(response);
826 }
827 interfaceLogService.setResultLog(response, logId, exception);
828 return result;
829 }
830
831
832 /**
833 * 推送证照图片数据到平台
834 * @param params
835 * @return
836 */
837 @RequestMapping("/pushlicpicinfo")
838 @ResponseBody
839 public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
840 String result = "";
841 String logId = IdUtil.uuid();
842 String exception = "";
843 PlatFormResponse response = new PlatFormResponse();
844 try {
845 if (file!=null) {
846 HttpClient client = HttpClients.createDefault();
847 HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
848 String fileName = file.getOriginalFilename();
849 String prefix = fileName.substring(fileName.lastIndexOf("."));
850 File newfile = File.createTempFile(System.currentTimeMillis() + "", prefix);
851 file.transferTo(newfile);
852 FileBody bin = new FileBody(newfile);
853 HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
854 post.setEntity(reqEntity);
855 HttpResponse htppresponse = client.execute(post);
856 HttpEntity resEntity = htppresponse.getEntity();
857 result = EntityUtils.toString(resEntity, "UTF-8");
858 JSONObject jsonObject = JSONObject.parseObject(result);
859 if(jsonObject.getIntValue("errorCode") != 0){
860 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
861 }else {
862 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
863 }
864 response.setMsg(jsonObject.getString("message"));
865 }else{
866 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
867 response.setMsg("发送证照图片数据给平台错误:参数为空");
868 }
869
870 } catch (Exception e) {
871 logger.error(e.getMessage());
872 exception = e.getMessage();
873 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
874 response.setMsg("发送证照图片数据给平台错误:" + e.getMessage());
875 result = JSON.toJSONString(response);
876 }
877 interfaceLogService.setResultLog(response, logId, exception);
878 return result;
879 }
880 }
1 package com.phxl.modules.goods.entity.ctdept;
2
3 import java.util.Date;
4 /**
5 *
6 * @ClassName: HisCtDept
7 * @Description: 医院科室表实体类
8 * @author hehaihong
9 * @date 2018-08-08 09:28:47
10 *
11 */
12 public class HisCtDept{
13
14 private String hdeptCode; //科室编码
15 private String hdeptName; //科室名称
16 private String helpCode; //助记码
17 private String upperGUID; //上级编号
18 private String isOrderRight; //是否有订货权限
19 private String category; //类别
20 private String director; //主管
21 private String state; //状态
22 private String isLastLevel; //是否末级
23 private Date create_time; //创建时间
24 private Date update_time; //更新时间
25
26 private String id;
27
28
29 public String getId() {
30 return id;
31 }
32 public void setId(String id) {
33 this.id = id;
34 }
35 public String getHdeptCode() {
36 return hdeptCode;
37 }
38 public void setHdeptCode(String hdeptCode) {
39 this.hdeptCode = hdeptCode;
40 }
41 public String getHdeptName() {
42 return hdeptName;
43 }
44 public void setHdeptName(String hdeptName) {
45 this.hdeptName = hdeptName;
46 }
47 public String getHelpCode() {
48 return helpCode;
49 }
50 public void setHelpCode(String helpCode) {
51 this.helpCode = helpCode;
52 }
53 public String getUpperGUID() {
54 return upperGUID;
55 }
56 public void setUpperGUID(String upperGUID) {
57 this.upperGUID = upperGUID;
58 }
59 public String getIsOrderRight() {
60 return isOrderRight;
61 }
62 public void setIsOrderRight(String isOrderRight) {
63 this.isOrderRight = isOrderRight;
64 }
65 public String getCategory() {
66 return category;
67 }
68 public void setCategory(String category) {
69 this.category = category;
70 }
71 public String getDirector() {
72 return director;
73 }
74 public void setDirector(String director) {
75 this.director = director;
76 }
77 public String getState() {
78 return state;
79 }
80 public void setState(String state) {
81 this.state = state;
82 }
83 public String getIsLastLevel() {
84 return isLastLevel;
85 }
86 public void setIsLastLevel(String isLastLevel) {
87 this.isLastLevel = isLastLevel;
88 }
89 public Date getCreate_time() {
90 return create_time;
91 }
92 public void setCreate_time(Date create_time) {
93 this.create_time = create_time;
94 }
95 public Date getUpdate_time() {
96 return update_time;
97 }
98 public void setUpdate_time(Date update_time) {
99 this.update_time = update_time;
100 }
101
102 }
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medplan.MedPlan">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
10 <result column="med_name" property="medName" jdbcType="VARCHAR" />
11 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
12 <result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
13 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
14 <result column="bill_type" property="billType" jdbcType="VARCHAR" />
15 <result column="settle_type" property="settleType" jdbcType="VARCHAR" />
16 <result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
17 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
18 <result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
19 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
20 <result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
21 <result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
22 <result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
25 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
26 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
27 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
28 </resultMap>
29
30 <!--Base_Column_List -->
31 <sql id="Base_Column_List">id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time</sql>
32
33 <!--批量插入 -->
34 <insert id="batchInsert" parameterType="list">
35 insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
36 values
37 <foreach collection ="list" item="obj" separator =",">
38 <trim prefix=" (" suffix=")" suffixOverrides=",">
39 #{obj.id},
40 #{obj.medCode},
41 #{obj.medName},
42 #{obj.supplierCode},
43 #{obj.suppliername},
44 #{obj.billNo},
45 #{obj.billType},
46 #{obj.medDeptCode},
47 #{obj.medDeptName},
48 #{obj.medStoreCode},
49 #{obj.medStoreName},
50 #{obj.firstFlag},
51 #{obj.planBeginDate},
52 #{obj.planEndDate},
53 #{obj.memo},
54 #{obj.operaterName},
55 #{obj.inputDate},
56 #{obj.create_time},
57 #{obj.update_time}
58 </trim>
59 </foreach>
60 </insert>
61
62 <!-- 新增MedPlan-->
63 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
64 insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,settle_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
65 values (
66 #{id,jdbcType=VARCHAR}
67 ,#{medCode,jdbcType=VARCHAR}
68 ,#{medName,jdbcType=VARCHAR}
69 ,#{supplierCode,jdbcType=VARCHAR}
70 ,#{suppliername,jdbcType=VARCHAR}
71 ,#{billNo,jdbcType=VARCHAR}
72 ,#{billType,jdbcType=VARCHAR}
73 ,#{settleType,jdbcType=VARCHAR}
74 ,#{medDeptCode,jdbcType=VARCHAR}
75 ,#{medDeptName,jdbcType=VARCHAR}
76 ,#{medStoreCode,jdbcType=VARCHAR}
77 ,#{medStoreName,jdbcType=VARCHAR}
78 ,#{firstFlag,jdbcType=VARCHAR}
79 ,#{planBeginDate,jdbcType=TIMESTAMP}
80 ,#{planEndDate,jdbcType=TIMESTAMP}
81 ,#{memo,jdbcType=VARCHAR}
82 ,#{operaterName,jdbcType=VARCHAR}
83 ,#{inputDate,jdbcType=TIMESTAMP}
84 ,#{create_time,jdbcType=TIMESTAMP}
85 ,#{update_time,jdbcType=TIMESTAMP}
86 )
87 </insert>
88
89 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.medplan;
2
3
4 public class MedPlanWithDetail {
5
6 public MedPlan getTrmedPlan() {
7 return trmedPlan;
8 }
9
10 public void setTrmedPlan(MedPlan trmedPlan) {
11 this.trmedPlan = trmedPlan;
12 }
13
14 private MedPlan trmedPlan;
15
16
17 }
1 package com.phxl.modules.goods.entity.invoiceback;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 import com.alibaba.fastjson.annotation.JSONField;
7
8 public class SuInvoiceBackDetail {
9 @JSONField(name="SettleBillNo")
10 private String settleBillNo; //结算单号
11 @JSONField(name="RowNo")
12 private int rowNo; //行号
13 @JSONField(name="GoodsCode")
14 private String goodsCode; //商品编码
15 public String getSettleBillNo() {
16 return settleBillNo;
17 }
18 public void setSettleBillNo(String settleBillNo) {
19 this.settleBillNo = settleBillNo;
20 }
21 public int getRowNo() {
22 return rowNo;
23 }
24 public void setRowNo(int rowNo) {
25 this.rowNo = rowNo;
26 }
27 public String getGoodsCode() {
28 return goodsCode;
29 }
30 public void setGoodsCode(String goodsCode) {
31 this.goodsCode = goodsCode;
32 }
33 public String getGoodsName() {
34 return goodsName;
35 }
36 public void setGoodsName(String goodsName) {
37 this.goodsName = goodsName;
38 }
39 public String getGoodsSpec() {
40 return goodsSpec;
41 }
42 public void setGoodsSpec(String goodsSpec) {
43 this.goodsSpec = goodsSpec;
44 }
45 public String getProducerName() {
46 return producerName;
47 }
48 public void setProducerName(String producerName) {
49 this.producerName = producerName;
50 }
51 public String getRegistKey() {
52 return registKey;
53 }
54 public void setRegistKey(String registKey) {
55 this.registKey = registKey;
56 }
57 public BigDecimal getSettleQty() {
58 return settleQty;
59 }
60 public void setSettleQty(BigDecimal settleQty) {
61 this.settleQty = settleQty;
62 }
63 public String getUnit() {
64 return unit;
65 }
66 public void setUnit(String unit) {
67 this.unit = unit;
68 }
69 public BigDecimal getSettlePrice() {
70 return settlePrice;
71 }
72 public void setSettlePrice(BigDecimal settlePrice) {
73 this.settlePrice = settlePrice;
74 }
75 public BigDecimal getSettleAmount() {
76 return settleAmount;
77 }
78 public void setSettleAmount(BigDecimal settleAmount) {
79 this.settleAmount = settleAmount;
80 }
81 public String getInvoiceNo() {
82 return invoiceNo;
83 }
84 public void setInvoiceNo(String invoiceNo) {
85 this.invoiceNo = invoiceNo;
86 }
87 public String getInvoiceCode() {
88 return invoiceCode;
89 }
90 public void setInvoiceCode(String invoiceCode) {
91 this.invoiceCode = invoiceCode;
92 }
93 public Date getInvoiceTime() {
94 return invoiceTime;
95 }
96 public void setInvoiceTime(Date invoiceTime) {
97 this.invoiceTime = invoiceTime;
98 }
99 public BigDecimal getInvoiceAmount() {
100 return invoiceAmount;
101 }
102 public void setInvoiceAmount(BigDecimal invoiceAmount) {
103 this.invoiceAmount = invoiceAmount;
104 }
105 public String getId() {
106 return id;
107 }
108 public void setId(String id) {
109 this.id = id;
110 }
111 public String getSupplierCode() {
112 return supplierCode;
113 }
114 public void setSupplierCode(String supplierCode) {
115 this.supplierCode = supplierCode;
116 }
117 public String getSupplierName() {
118 return supplierName;
119 }
120 public void setSupplierName(String supplierName) {
121 this.supplierName = supplierName;
122 }
123 public Date getSettleDate() {
124 return settleDate;
125 }
126 public void setSettleDate(Date settleDate) {
127 this.settleDate = settleDate;
128 }
129 @JSONField(name="GoodsName")
130 private String goodsName; //商品名称
131 @JSONField(name="GoodsSpec")
132 private String goodsSpec; //商品规格
133 @JSONField(name="ProducerName")
134 private String producerName; //生产厂商名称
135 @JSONField(name="RegistKey")
136 private String registKey; //批准文号
137 @JSONField(name="SettleQty")
138 private BigDecimal settleQty; //结算数量
139 @JSONField(name="Unit")
140 private String unit; //包装单位
141 public Date getCreate_time() {
142 return create_time;
143 }
144 public void setCreate_time(Date create_time) {
145 this.create_time = create_time;
146 }
147 public Date getUpdate_time() {
148 return update_time;
149 }
150 public void setUpdate_time(Date update_time) {
151 this.update_time = update_time;
152 }
153 @JSONField(name="SettlePrice")
154 private BigDecimal settlePrice; //结算价格
155 @JSONField(name="SettleAmount")
156 private BigDecimal settleAmount; //结算金额
157 @JSONField(name="CREATE_TIME",format="yyyy-MM-dd HH:mm:ss")
158 private Date create_time; //创建时间
159 @JSONField(name="UPDATE_TIME",format="yyyy-MM-dd HH:mm:ss")
160 private Date update_time; //更新时间
161 @JSONField(name="InvoiceNo")
162 private String invoiceNo; //发票号
163 @JSONField(name="InvoiceCode")
164 private String invoiceCode; //发票代码
165 @JSONField(name="InvoiceTime")
166 private Date invoiceTime; //发票日期
167 @JSONField(name="InvoiceAmount")
168 private BigDecimal invoiceAmount; //发票金额
169
170 private String id;
171 //供应商code
172 @JSONField(name="SupplierCode")
173 private String supplierCode;
174 //供应商名称
175 @JSONField(name="SupplierName")
176 private String supplierName;
177 //结算日期
178 @JSONField(name="SettleDate")
179 private Date settleDate;
180
181
182 }
1 package com.phxl.modules.goods.entity.medinstore;
2
3 import java.util.Date;
4 import java.util.List;
5
6 public class MedInStore {
7 public String getBillNo() {
8 return billNo;
9 }
10 public void setBillNo(String billNo) {
11 this.billNo = billNo;
12 }
13 public String getMedGuid() {
14 return medGuid;
15 }
16 public void setMedGuid(String medGuid) {
17 this.medGuid = medGuid;
18 }
19 public String getMedName() {
20 return medName;
21 }
22 public void setMedName(String medName) {
23 this.medName = medName;
24 }
25 public String getMedDeptGuid() {
26 return medDeptGuid;
27 }
28 public void setMedDeptGuid(String medDeptGuid) {
29 this.medDeptGuid = medDeptGuid;
30 }
31 public String getMedDeptName() {
32 return medDeptName;
33 }
34 public void setMedDeptName(String medDeptName) {
35 this.medDeptName = medDeptName;
36 }
37 public String getMedStoreGuid() {
38 return medStoreGuid;
39 }
40 public void setMedStoreGuid(String medStoreGuid) {
41 this.medStoreGuid = medStoreGuid;
42 }
43 public String getMedStoreName() {
44 return medStoreName;
45 }
46 public void setMedStoreName(String medStoreName) {
47 this.medStoreName = medStoreName;
48 }
49 public String getSupplierGuid() {
50 return supplierGuid;
51 }
52 public void setSupplierGuid(String supplierGuid) {
53 this.supplierGuid = supplierGuid;
54 }
55 public String getSupplierName() {
56 return supplierName;
57 }
58 public void setSupplierName(String supplierName) {
59 this.supplierName = supplierName;
60 }
61 public Date getBillDate() {
62 return billDate;
63 }
64 public void setBillDate(Date billDate) {
65 this.billDate = billDate;
66 }
67 public String getBillType() {
68 return billType;
69 }
70 public void setBillType(String billType) {
71 this.billType = billType;
72 }
73 public String getCountSum() {
74 return countSum;
75 }
76 public void setCountSum(String countSum) {
77 this.countSum = countSum;
78 }
79 public String getDetailSum() {
80 return detailSum;
81 }
82 public void setDetailSum(String detailSum) {
83 this.detailSum = detailSum;
84 }
85 public String getOperaterName() {
86 return operaterName;
87 }
88 public void setOperaterName(String operaterName) {
89 this.operaterName = operaterName;
90 }
91 public Date getInputDate() {
92 return inputDate;
93 }
94 public void setInputDate(Date inputDate) {
95 this.inputDate = inputDate;
96 }
97 public String getMemo() {
98 return memo;
99 }
100 public void setMemo(String memo) {
101 this.memo = memo;
102 }
103 public Date getCreate_time() {
104 return create_time;
105 }
106 public void setCreate_time(Date create_time) {
107 this.create_time = create_time;
108 }
109 public Date getUpdate_time() {
110 return update_time;
111 }
112 public void setUpdate_time(Date update_time) {
113 this.update_time = update_time;
114 }
115 public List<MedInStoreDetail> getBilldetaillist() {
116 return billdetaillist;
117 }
118 public void setBilldetaillist(List<MedInStoreDetail> billdetaillist) {
119 this.billdetaillist = billdetaillist;
120 }
121 private String id;
122
123 public String getId() {
124 return id;
125 }
126 public void setId(String id) {
127 this.id = id;
128 }
129
130 private String billNo;
131 private String medGuid;
132 private String medName;
133 private String medDeptGuid;
134 private String medDeptName;
135 private String medStoreGuid;
136 private String medStoreName;
137 private String supplierGuid;
138 private String supplierName;
139 private Date billDate;
140 private String billType;
141 private String countSum;
142 private String detailSum;
143 private String operaterName;
144 private Date inputDate;
145 private String memo;
146 private Date create_time;
147 private Date update_time;
148 private List<MedInStoreDetail> billdetaillist;
149
150 }
1
2 package com.phxl.common.util;
3
4 import java.util.UUID;
5
6 /**
7 * 生成ID、流水号等标识串常用工具类 <br/>
8 */
9 public class IdentifieUtil {
10
11 /**
12 * 获取GuId
13 * @return String
14 */
15 public static String getGuId(){
16 UUID uuid = UUID.randomUUID();
17 // 得到对象产生的ID
18 String guId = uuid.toString();
19 // 转换为大写
20 guId = guId.toUpperCase();
21 // 替换 -
22 guId = guId.replaceAll("-", "");
23 return guId;
24 }
25
26 private final static char[] DIGITS64 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"
27 .toCharArray();
28
29 public static String get26GuId() {
30 UUID u = UUID.randomUUID();
31 // 转换为大写
32 String guId = toIDString(u.getMostSignificantBits()) + toIDString(u.getLeastSignificantBits());
33 guId = guId.toUpperCase();
34 if(guId.contains("-") || guId.contains("_")){
35 guId = get26GuId();
36 }
37 return guId;
38 }
39
40 private static String toIDString(long l) {
41 char[] buf = "0000000000000".toCharArray(); // 限定13位长度
42 int length = 11;
43 long least = 63L; // 0x0000003FL
44 do {
45 buf[--length] = DIGITS64[(int) (l & least)]; // l & least取低6位
46 l >>>= 6;
47 } while (l != 0);
48 return new String(buf);
49 }
50
51 /**
52 * 测试
53 */
54 public static void main(String[] args) {
55 System.out.println(getGuId());
56 }
57 }
58
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.service.billsettlement;
2
3 import java.math.BigDecimal;
4 import java.util.ArrayList;
5 import java.util.Date;
6 import java.util.List;
7
8 import org.apache.commons.lang3.StringUtils;
9 import org.apache.poi.ss.formula.functions.Now;
10 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Service;
14
15 import com.phxl.common.util.DateUtils;
16 import com.phxl.common.utils.BaseException;
17 import com.phxl.common.utils.IdUtil;
18 import com.phxl.modules.goods.dao.billsettlement.BillSettlementDao;
19 import com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao;
20 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
21 import com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail;
22 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
23
24
25 @Service
26 public class BillSettlementService{
27
28 @Autowired
29 private BillSettlementDao billSettlementDao;
30
31 @Autowired
32 private BillSettlementDetailDao billSettlementDetailDao;
33
34 /**
35 * 日志对象
36 */
37 protected Logger logger = LoggerFactory.getLogger(getClass());
38
39 public boolean batchSave(List<BillSettlementWithDetail> settlementWithDetails) {
40 boolean result = true;
41 try {
42 checkBillSettlement(settlementWithDetails);
43 } catch (Exception e) {
44 throw new BaseException(e.getMessage());
45 }
46 for (BillSettlementWithDetail settlement : settlementWithDetails) {
47 BillSettlement billSettlement = settlement.getTRSettle();
48 List<BillSettlementDetail> details = new ArrayList<BillSettlementDetail>();
49 details = settlement.getTRSettle().getTRSettleDetail();
50 String id = IdUtil.uuid();
51 Integer rowno = 1;
52 billSettlement.setId(id);
53 if(details != null && details.size() != 0){
54 for (BillSettlementDetail billSettlementDetail : details) {
55 billSettlementDetail.setSettleBillNo(billSettlement.getSettleBillNo());
56 billSettlementDetail.setId(id);
57 billSettlementDetail.setRowNo(rowno);
58 billSettlementDetail.setCreate_time(new Date());
59 billSettlementDetail.setUpdate_time(new Date());
60 rowno ++;
61 }
62 billSettlementDao.insert(billSettlement);
63 billSettlementDetailDao.batchInsert(details);
64 }
65 }
66 return result;
67 }
68
69
70 private void checkBillSettlement(List<BillSettlementWithDetail> settlementWithDetails) {
71 if(settlementWithDetails == null || settlementWithDetails.size() == 0){
72 logger.error("无相应结算单据信息");
73 throw new BaseException("无相应结算单据信息");
74 }
75 for (BillSettlementWithDetail billSettlementWithDetail : settlementWithDetails) {
76 BillSettlement billSettlement = billSettlementWithDetail.getTRSettle();
77 String settleBillNo = billSettlement.getSettleBillNo();
78 if (StringUtils.isEmpty(settleBillNo)) {
79 logger.error("结算单结算单号不能为空");
80 throw new BaseException("结算单结算单号不能为空");
81 }
82 Date settleDate = billSettlement.getSettleDate();
83 if (settleDate == null) {
84 logger.error("结算单结算单号:"+settleBillNo+"结算单结算单日期不能为空");
85 throw new BaseException("结算单结算单号:"+settleBillNo+"结算单结算单日期不能为空");
86 }
87 List<BillSettlementDetail> details = billSettlement.getTRSettleDetail();
88 if(details == null || details.size() == 0){
89 logger.error("结算单结算单号:"+settleBillNo+"无相应结算单据明细信息");
90 throw new BaseException("结算单结算单号:"+settleBillNo+"无相应结算单据明细信息");
91 }
92 String useBillNo = billSettlement.getUseBillNo();
93 if (StringUtils.isEmpty(useBillNo)) {
94 logger.error("结算单结算单号:"+settleBillNo+","+"结算单发药单据编号不能为空");
95 throw new BaseException("结算单结算单号:"+settleBillNo+", "+"结算单明细发药单据编号不能为空");
96 }
97 for (BillSettlementDetail billSettlementDetail : details) {
98 String detailSettleBillNo = billSettlementDetail.getSettleBillNo();
99 if (StringUtils.isEmpty(detailSettleBillNo)) {
100 logger.error("结算单结算单号:"+settleBillNo+"结算单明细结算单号不能为空");
101 throw new BaseException("结算单结算单号:"+settleBillNo+"结算单明细结算单号不能为空");
102 }
103 int rowNo = billSettlementDetail.getRowNo();
104 if (rowNo == 0) {
105 logger.error("结算单结算单号:"+settleBillNo+"结算单明细行号不能为空");
106 throw new BaseException("结算单结算单号:"+settleBillNo+"结算单明细行号不能为空");
107 }
108 String purchaser_GoodsCode = billSettlementDetail.getGoodsCode();
109 if (StringUtils.isEmpty(purchaser_GoodsCode)) {
110 logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品编码不能为空");
111 throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品编码不能为空");
112 }
113 String purchase_GoodsName = billSettlementDetail.getGoodsName();
114 if (StringUtils.isEmpty(purchase_GoodsName)) {
115 logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品名称不能为空");
116 throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品名称不能为空");
117 }
118 BigDecimal purchase_SettleQty = billSettlementDetail.getSettleQty();
119 if (purchase_SettleQty == null) {
120 logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_结算数量不能为空");
121 throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_结算数量不能为空");
122 }
123 String purchase_Unit = billSettlementDetail.getUnit();
124 if (StringUtils.isEmpty(purchase_Unit)) {
125 logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_包装单位不能为空");
126 throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_包装单位不能为空");
127 }
128 Date productionDate = billSettlementDetail.getProductionDate();
129 if (productionDate == null) {
130 logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细生产日期前不能为空");
131 throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细生产日期前不能为空");
132 }
133 Date expireDate = billSettlementDetail.getExpireDate();
134 if (expireDate == null) {
135 logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细有效日期不能为空");
136 throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细有效日期不能为空");
137 }
138 }
139 }
140
141 }
142
143
144
145 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.ctdept.HisCtDeptDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.ctdept.HisCtDept">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
10 <result column="hdept_name" property="hdeptName" jdbcType="VARCHAR" />
11 <result column="help_code" property="helpCode" jdbcType="VARCHAR" />
12 <result column="upper_GUID" property="upperGUID" jdbcType="VARCHAR" />
13 <result column="is_order_right" property="isOrderRight" jdbcType="VARCHAR" />
14 <result column="category" property="category" jdbcType="VARCHAR" />
15 <result column="director" property="director" jdbcType="VARCHAR" />
16 <result column="state" property="state" jdbcType="VARCHAR" />
17 <result column="is_last_level" property="isLastLevel" jdbcType="VARCHAR" />
18 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
19 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
20 </resultMap>
21
22 <!--Base_Column_List -->
23 <sql id="Base_Column_List">id,hdept_code,hdept_name,help_code,upper_GUID,is_order_right,category,director,state,is_last_level,create_time,update_time</sql>
24
25 <!-- 批量查询 -->
26 <select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
27 select
28 <include refid="Base_Column_List" />
29 from med_hli_dept
30 <if test="ctcpCodes != null">
31 where hdept_code in
32 <foreach item="item" index="index" collection="ctcpCodes" open="(" separator="," close=")">
33 #{item}
34 </foreach>
35 </if>
36 </select>
37
38 <!--批量插入 -->
39 <insert id="batchInsert" parameterType="list">
40 insert into med_hli_dept (id,hdept_code,hdept_name,help_code,upper_GUID,is_order_right,category,director,state,is_last_level,create_time,update_time)
41 values
42 <foreach collection ="list" item="obj" separator =",">
43 <trim prefix=" (" suffix=")" suffixOverrides=",">
44 #{obj.id},
45 #{obj.hdeptCode},
46 #{obj.hdeptName},
47 #{obj.helpCode},
48 #{obj.upperGUID},
49 #{obj.isOrderRight},
50 #{obj.category},
51 #{obj.director},
52 #{obj.state},
53 #{obj.isLastLevel},
54 #{obj.create_time},
55 #{obj.update_time}
56 </trim>
57 </foreach>
58 </insert>
59
60 <update id="batchUpdate" parameterType="list">
61 update med_hli_dept
62 <trim prefix="set" suffixOverrides=",">
63 <trim prefix="hdept_code=case" suffix="end,">
64 <foreach collection="list" item="obj" index="index">
65 <if test="obj.hdeptCode != null and obj.hdeptCode != ''">
66 when id = #{obj.id}
67 then #{obj.hdeptCode,jdbcType=VARCHAR}
68 </if>
69 </foreach>
70 </trim>
71 <trim prefix="hdept_name=case" suffix="end,">
72 <foreach collection="list" item="obj" index="index">
73 <if test="obj.hdeptName != null and obj.hdeptName != ''">
74 when id = #{obj.id}
75 then
76 #{obj.hdeptName,jdbcType=VARCHAR}
77 </if>
78 </foreach>
79 </trim>
80 <trim prefix="help_code=case" suffix="end,">
81 <foreach collection="list" item="obj" index="index">
82 <if test="obj.helpCode != null and obj.helpCode != ''">
83 when id = #{obj.id}
84 then #{obj.helpCode,jdbcType=VARCHAR}
85 </if>
86 </foreach>
87 </trim>
88 <trim prefix="upper_GUID=case" suffix="end,">
89 <foreach collection="list" item="obj" index="index">
90 <if test="obj.upperGUID != null and obj.upperGUID != ''">
91 when id = #{obj.id}
92 then #{obj.upperGUID,jdbcType=VARCHAR}
93 </if>
94 </foreach>
95 </trim>
96 <trim prefix="is_order_right=case" suffix="end,">
97 <foreach collection="list" item="obj" index="index">
98 <if test="obj.isOrderRight != null and obj.isOrderRight != ''">
99 when id = #{obj.id}
100 then #{obj.isOrderRight,jdbcType=VARCHAR}
101 </if>
102 </foreach>
103 </trim>
104 <trim prefix="category=case" suffix="end,">
105 <foreach collection="list" item="obj" index="index">
106 <if test="obj.category != null and obj.category != ''">
107 when id = #{obj.id}
108 then #{obj.category,jdbcType=VARCHAR}
109 </if>
110 </foreach>
111 </trim>
112 <trim prefix="director=case" suffix="end,">
113 <foreach collection="list" item="obj" index="index">
114 <if test="obj.director != null and obj.director != ''">
115 when id = #{obj.id}
116 then #{obj.director,jdbcType=VARCHAR}
117 </if>
118 </foreach>
119 </trim>
120 <trim prefix="state=case" suffix="end,">
121 <foreach collection="list" item="obj" index="index">
122 <if test="obj.state != null and obj.state != ''">
123 when id = #{obj.id}
124 then #{obj.state,jdbcType=VARCHAR}
125 </if>
126 </foreach>
127 </trim>
128 <trim prefix="is_last_level=case" suffix="end,">
129 <foreach collection="list" item="obj" index="index">
130 <if test="obj.isLastLevel != null and obj.isLastLevel != ''">
131 when id = #{obj.id}
132 then #{obj.isLastLevel,jdbcType=VARCHAR}
133 </if>
134 </foreach>
135 </trim>
136 <trim prefix="create_time=case" suffix="end,">
137 <foreach collection="list" item="obj" index="index">
138 <if test="obj.create_time != null">
139 when id = #{obj.id}
140 then #{obj.create_time,jdbcType=DATE}
141 </if>
142 </foreach>
143 </trim>
144 <trim prefix="update_time=case" suffix="end,">
145 <foreach collection="list" item="obj" index="index">
146 <if test="obj.update_time != null">
147 when id = #{obj.id}
148 then #{obj.update_time,jdbcType=DATE}
149 </if>
150 </foreach>
151 </trim>
152 </trim>
153 where
154 <foreach collection="list" separator="or" item="obj" index="index">
155 id
156 = #{obj.id}
157 </foreach>
158 </update>
159
160
161 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 /**
2 * Copyright &copy; 2012-2016 <a href="https://github.com/phxl/medicinal">medicinal</a> All rights reserved.
3 */
4 package com.phxl.common.util;
5
6 import java.io.File;
7 import java.io.IOException;
8 import java.util.HashMap;
9 import java.util.Map;
10
11 import org.apache.commons.lang3.StringUtils;
12 import org.springframework.core.io.DefaultResourceLoader;
13
14
15
16
17 /**
18 * 全局配置类
19 * @author phxl
20 * @version 2014-06-25
21 */
22 public class Global {
23
24 /**
25 * 当前对象实例
26 */
27 private static Global global = new Global();
28
29 /**
30 * 保存全局属性值
31 */
32 private static Map<String, String> map = new HashMap<String,String>();
33
34 /**
35 * 属性文件加载对象
36 */
37 private static PropertiesLoader loader = new PropertiesLoader("config.properties");
38
39 /**
40 * 显示/隐藏
41 */
42 public static final String SHOW = "1";
43 public static final String HIDE = "0";
44
45 /**
46 * 是/否
47 */
48 public static final String YES = "1";
49 public static final String NO = "0";
50
51 /**
52 * 对/错
53 */
54 public static final String TRUE = "true";
55 public static final String FALSE = "false";
56
57 /**
58 * 上传文件基础虚拟路径
59 */
60 public static final String USERFILES_BASE_URL = "/userfiles/";
61
62 /**
63 * 获取当前对象实例
64 */
65 public static Global getInstance() {
66 return global;
67 }
68
69 /**
70 * 获取配置
71 * @see ${fns:getConfig('adminPath')}
72 */
73 public static String getConfig(String key) {
74 String value = map.get(key);
75 if (value == null){
76 value = loader.getProperty(key);
77 map.put(key, value != null ? value : StringUtils.EMPTY);
78 }
79 return value;
80 }
81
82 /**
83 * 获取管理端根路径
84 */
85 public static String getAdminPath() {
86 return getConfig("adminPath");
87 }
88
89 /**
90 * 获取前端根路径
91 */
92 public static String getFrontPath() {
93 return getConfig("frontPath");
94 }
95
96 /**
97 * 获取URL后缀
98 */
99 public static String getUrlSuffix() {
100 return getConfig("urlSuffix");
101 }
102
103 /**
104 * 是否是演示模式,演示模式下不能修改用户、角色、密码、菜单、授权
105 */
106 public static Boolean isDemoMode() {
107 String dm = getConfig("demoMode");
108 return "true".equals(dm) || "1".equals(dm);
109 }
110
111 /**
112 * 在修改系统用户和角色时是否同步到Activiti
113 */
114 public static Boolean isSynActivitiIndetity() {
115 String dm = getConfig("activiti.isSynActivitiIndetity");
116 return "true".equals(dm) || "1".equals(dm);
117 }
118
119 /**
120 * 页面获取常量
121 * @see ${fns:getConst('YES')}
122 */
123 public static Object getConst(String field) {
124 try {
125 return Global.class.getField(field).get(null);
126 } catch (Exception e) {
127 // 异常代表无配置,这里什么也不做
128 }
129 return null;
130 }
131
132 /**
133 * 获取上传文件的根目录
134 * @return
135 */
136 public static String getUserfilesBaseDir() {
137 String dir = getConfig("userfiles.basedir");
138 /* if (StringUtils.isBlank(dir)){
139 try {
140 dir = ServletContextFactory.getServletContext().getRealPath("/");
141 } catch (Exception e) {
142 return "";
143 }
144 }
145 if(!dir.endsWith("/")) {
146 dir += "/";
147 }*/
148 // System.out.println("userfiles.basedir: " + dir);
149 return dir;
150 }
151
152 /**
153 * 获取工程路径
154 * @return
155 */
156 public static String getProjectPath(){
157 // 如果配置了工程路径,则直接返回,否则自动获取。
158 String projectPath = Global.getConfig("projectPath");
159 if (StringUtils.isNotBlank(projectPath)){
160 return projectPath;
161 }
162 try {
163 File file = new DefaultResourceLoader().getResource("").getFile();
164 if (file != null){
165 while(true){
166 File f = new File(file.getPath() + File.separator + "src" + File.separator + "main");
167 if (f == null || f.exists()){
168 break;
169 }
170 if (file.getParentFile() != null){
171 file = file.getParentFile();
172 }else{
173 break;
174 }
175 }
176 projectPath = file.toString();
177 }
178 } catch (IOException e) {
179 e.printStackTrace();
180 }
181 return projectPath;
182 }
183
184 }
1 /**
2 * Project Name:HSCM File Name:SystemConfig.java Package Name:com.phxl.hscm.common.util Date:2015年6月29日下午5:13:50 Copyright (c) 2015, PHXL All Rights Reserved.
3 */
4
5 package com.phxl.common.util;
6
7 import org.apache.commons.collections.MapUtils;
8 import org.apache.commons.lang.StringUtils;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11 import org.springframework.core.io.Resource;
12 import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
13 import org.springframework.stereotype.Component;
14
15 import javax.annotation.PostConstruct;
16 import java.io.IOException;
17 import java.util.Map;
18 import java.util.Properties;
19 import java.util.TreeMap;
20
21
22 /**
23 * 系统配置工具<br/>
24 * 加载系统Properties配置文件至内存中<br/>
25 * @Date 2015年6月29日 下午5:13:50
26 * @author shijingbang
27 * @version 1.0
28 * @since JDK 1.6
29 */
30 @Component
31 public class SystemConfig {
32 private static final Logger logger = LoggerFactory.getLogger(SystemConfig.class);
33 private static final Properties properties = new Properties();
34
35 @PostConstruct
36 public void init() throws IOException {
37 PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(this.getClass().getClassLoader());
38 //Resource[] resources = resolver.getResources("classpath:**/spring/*.properties");
39 Resource[] resources = resolver.getResources("classpath:**/*.properties");
40 for (Resource resource : resources) {
41 if (logger.isDebugEnabled()) {
42 logger.debug("加载Properties配置文件{}", resource.getFilename());
43 }
44 properties.load(resource.getInputStream());
45 }
46 if(logger.isDebugEnabled()){
47 Map<String, Object> configuration = MapUtils.typedSortedMap(new TreeMap(properties), String.class, Object.class);
48 //logger.debug("****************系统配置参数表****************\n{}", JSONUtils.toPrettyJsonLoosely(configuration));
49 }
50 }
51
52 /**
53 * 根据key找出value值
54 * @param key 键
55 * @return String
56 * @author shijingbang
57 */
58 public static String getProperty(String key) {
59 return properties.getProperty(key);
60 }
61
62 /**
63 * 根据key找出value值.没有找到则返回第二个参数的值
64 * @param key 键
65 * @param defaultValue 默认值
66 * @return String
67 * @author shijingbang
68 */
69 public static String getProperty(String key, String defaultValue) {
70 return properties.getProperty(key, defaultValue);
71 }
72
73 /**
74 * 获取整数参数值
75 * @param key
76 * @return Integer
77 */
78 public static Integer getIntProperty(String key){
79 String value = properties.getProperty(key);
80 if(StringUtils.isNotBlank(value)){
81 return Integer.parseInt(value);
82 }
83 return null;
84 }
85
86 /**
87 * 获取整数参数值,必需指定默认值
88 * @param key
89 * @param defaultValue
90 * @return int
91 */
92 public static int getIntProperty(String key, Integer defaultValue){
93 //LocalAssert.notNull(defaultValue, "defaultValue,不能为空");
94 String value = properties.getProperty(key);
95 if(StringUtils.isBlank(value)){
96 return defaultValue;
97 }
98 return Integer.parseInt(value);
99 }
100
101 /**
102 * 检查是否包含指定key
103 * @param key
104 * @return boolean
105 * @author shijingbang
106 */
107 public static boolean containsKey(Object key) {
108 return properties.containsKey(key);
109 }
110
111 /**
112 * 检查系统环境是否包含指定值
113 * @param value
114 * @return boolean
115 * @author shijingbang
116 */
117 public static boolean containsValue(Object value) {
118 return properties.containsValue(value);
119 }
120 }
1 /**
2 * Copyright &copy; 2012-2016 <a href="https://github.com/phxl/medicinal">medicinal</a> All rights reserved.
3 */
4 package com.phxl.common.util;
5
6 import java.io.IOException;
7 import java.util.TimeZone;
8
9 import org.apache.commons.lang3.StringEscapeUtils;
10 import org.apache.commons.lang3.StringUtils;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
13
14 import com.fasterxml.jackson.annotation.JsonInclude.Include;
15 import com.fasterxml.jackson.core.JsonGenerator;
16 import com.fasterxml.jackson.core.JsonParser.Feature;
17 import com.fasterxml.jackson.core.JsonProcessingException;
18 import com.fasterxml.jackson.databind.DeserializationFeature;
19 import com.fasterxml.jackson.databind.JavaType;
20 import com.fasterxml.jackson.databind.JsonSerializer;
21 import com.fasterxml.jackson.databind.ObjectMapper;
22 import com.fasterxml.jackson.databind.SerializationFeature;
23 import com.fasterxml.jackson.databind.SerializerProvider;
24 import com.fasterxml.jackson.databind.module.SimpleModule;
25 import com.fasterxml.jackson.databind.util.JSONPObject;
26
27 /**
28 * 简单封装Jackson,实现JSON String<->Java Object的Mapper.
29 * 封装不同的输出风格, 使用不同的builder函数创建实例.
30 * @author phxl
31 * @version 2013-11-15
32 */
33 public class JsonMapper extends ObjectMapper {
34
35 private static final long serialVersionUID = 1L;
36
37 private static Logger logger = LoggerFactory.getLogger(JsonMapper.class);
38
39 private static JsonMapper mapper;
40
41 public JsonMapper() {
42 this(Include.NON_EMPTY);
43 }
44
45 public JsonMapper(Include include) {
46
47 // 设置输出时包含属性的风格
48 if (include != null) {
49 this.setSerializationInclusion(include);
50 }
51 // 允许单引号、允许不带引号的字段名称
52 this.enableSimple();
53 // 设置输入时忽略在JSON字符串中存在但Java对象实际没有的属性
54 this.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
55 // 空值处理为空串
56 this.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>(){
57 @Override
58 public void serialize(Object value, JsonGenerator jgen,
59 SerializerProvider provider) throws IOException,
60 JsonProcessingException {
61 jgen.writeString("");
62 }
63 });
64 // 进行HTML解码。
65 this.registerModule(new SimpleModule().addSerializer(String.class, new JsonSerializer<String>(){
66 @Override
67 public void serialize(String value, JsonGenerator jgen,
68 SerializerProvider provider) throws IOException,
69 JsonProcessingException {
70 jgen.writeString(StringEscapeUtils.unescapeHtml4(value));
71 }
72 }));
73 // 设置时区
74 this.setTimeZone(TimeZone.getDefault());//getTimeZone("GMT+8:00")
75
76 /* try {
77 this.writerWithType(Void.TYPE).writeValueAsBytes(null);
78 } catch (JsonProcessingException e) {
79 e.printStackTrace();
80 }*/
81 }
82
83 /**
84 * 创建只输出非Null且非Empty(如List.isEmpty)的属性到Json字符串的Mapper,建议在外部接口中使用.
85 */
86 public static JsonMapper getInstance() {
87 if (mapper == null){
88 mapper = new JsonMapper().enableSimple();
89 }
90 return mapper;
91 }
92
93 /**
94 * 创建只输出初始值被改变的属性到Json字符串的Mapper, 最节约的存储方式,建议在内部接口中使用。
95 */
96 public static JsonMapper nonDefaultMapper() {
97 if (mapper == null){
98 mapper = new JsonMapper(Include.NON_DEFAULT);
99 }
100 return mapper;
101 }
102
103 /**
104 * Object可以是POJO,也可以是Collection或数组。
105 * 如果对象为Null, 返回"null".
106 * 如果集合为空集合, 返回"[]".
107 */
108 public String toJson(Object object) {
109 try {
110 return this.writeValueAsString(object);
111 } catch (IOException e) {
112 logger.warn("write to json string error:" + object, e);
113 return null;
114 }
115 }
116
117 /**
118 * 反序列化POJO或简单Collection如List<String>.
119 *
120 * 如果JSON字符串为Null或"null"字符串, 返回Null.
121 * 如果JSON字符串为"[]", 返回空集合.
122 *
123 * 如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String,JavaType)
124 * @see #fromJson(String, JavaType)
125 */
126 public <T> T fromJson(String jsonString, Class<T> clazz) {
127 if (StringUtils.isEmpty(jsonString)) {
128 return null;
129 }
130 try {
131 return this.readValue(jsonString, clazz);
132 } catch (IOException e) {
133 logger.warn("parse json string error:" + jsonString, e);
134 return null;
135 }
136 }
137
138 /**
139 * 反序列化复杂Collection如List<Bean>, 先使用函數createCollectionType构造类型,然后调用本函数.
140 * @see #createCollectionType(Class, Class...)
141 */
142 @SuppressWarnings("unchecked")
143 public <T> T fromJson(String jsonString, JavaType javaType) {
144 if (StringUtils.isEmpty(jsonString)) {
145 return null;
146 }
147 try {
148 return (T) this.readValue(jsonString, javaType);
149 } catch (IOException e) {
150 logger.warn("parse json string error:" + jsonString, e);
151 return null;
152 }
153 }
154
155 /**
156 * 構造泛型的Collection Type如:
157 * ArrayList<MyBean>, 则调用constructCollectionType(ArrayList.class,MyBean.class)
158 * HashMap<String,MyBean>, 则调用(HashMap.class,String.class, MyBean.class)
159 */
160 public JavaType createCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
161 return this.getTypeFactory().constructParametricType(collectionClass, elementClasses);
162 }
163
164 /**
165 * 當JSON裡只含有Bean的部分屬性時,更新一個已存在Bean,只覆蓋該部分的屬性.
166 */
167 @SuppressWarnings("unchecked")
168 public <T> T update(String jsonString, T object) {
169 try {
170 return (T) this.readerForUpdating(object).readValue(jsonString);
171 } catch (JsonProcessingException e) {
172 logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
173 } catch (IOException e) {
174 logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
175 }
176 return null;
177 }
178
179 /**
180 * 輸出JSONP格式數據.
181 */
182 public String toJsonP(String functionName, Object object) {
183 return toJson(new JSONPObject(functionName, object));
184 }
185
186 /**
187 * 設定是否使用Enum的toString函數來讀寫Enum,
188 * 為False時時使用Enum的name()函數來讀寫Enum, 默認為False.
189 * 注意本函數一定要在Mapper創建後, 所有的讀寫動作之前調用.
190 */
191 public JsonMapper enableEnumUseToString() {
192 this.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
193 this.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
194 return this;
195 }
196
197 /**
198 * 允许单引号
199 * 允许不带引号的字段名称
200 */
201 public JsonMapper enableSimple() {
202 this.configure(Feature.ALLOW_SINGLE_QUOTES, true);
203 this.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
204 return this;
205 }
206
207 /**
208 * 取出Mapper做进一步的设置或使用其他序列化API.
209 */
210 public ObjectMapper getMapper() {
211 return this;
212 }
213
214 /**
215 * 对象转换为JSON字符串
216 * @param object
217 * @return
218 */
219 public static String toJsonString(Object object){
220 return JsonMapper.getInstance().toJson(object);
221 }
222
223 /**
224 * JSON字符串转换为对象
225 * @param jsonString
226 * @param clazz
227 * @return
228 */
229 public static Object fromJsonString(String jsonString, Class<?> clazz){
230 return JsonMapper.getInstance().fromJson(jsonString, clazz);
231 }
232
233
234
235
236
237 /**
238 * 测试
239 */
240 public static void main(String[] args) {
241 /*List<Map<String, Object>> list = Lists.newArrayList();
242 Map<String, Object> map = Maps.newHashMap();
243 map.put("id", 1);
244 map.put("pId", -1);
245 map.put("name", "根节点");
246 list.add(map);
247 map = Maps.newHashMap();
248 map.put("id", 2);
249 map.put("pId", 1);
250 map.put("name", "你好");
251 map.put("open", true);
252 list.add(map);
253 String json = JsonMapper.getInstance().toJson(list);
254 System.out.println(json);*/
255
256 }
257
258 }
1 package com.phxl.common.constants;
2
3 public class HisRequestConstant {
4
5 public static final String APPLICATION_XML = "application/xml";
6
7 public static final String TEXT_XML = "text/xml";
8
9
10 }
1 package com.phxl.modules.goods.entity.billback;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4
5 /**
6 * @ClassName BillBackWithDetail
7 * @Description TODO
8 * @Author json
9 * @Date 2018/11/1 19:22
10 **/
11 public class BillBackWithDetail {
12
13 @JSONField(name = "TRMedRPI")
14 private BillBack TRMedRPI;
15
16 public BillBack getTRMedRPI() {
17 return TRMedRPI;
18 }
19
20 public void setTRMedRPI(BillBack TRMedRPI) {
21 this.TRMedRPI = TRMedRPI;
22 }
23 }
1 package com.phxl.modules.goods.entity.invoiceback;
2
3 public class SuInvoiceBackWithDetail {
4 private SuInvoiceBack bill;
5
6 public SuInvoiceBack getBill() {
7 return bill;
8 }
9
10 public void setBill(SuInvoiceBack bill) {
11 this.bill = bill;
12 }
13 }
1 package com.phxl.modules.goods.entity.medstock;
2
3 public class MedStockList {
4 public MedStock getData() {
5 return data;
6 }
7
8 public void setData(MedStock data) {
9 this.data = data;
10 }
11
12 private MedStock data;
13 }
1 package com.phxl.modules.goods.service.supplierstock;
2
3 import java.util.Date;
4 import java.util.List;
5
6 import org.apache.commons.lang3.StringUtils;
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.phxl.common.util.JsonMapper;
13 import com.phxl.common.utils.BaseException;
14 import com.phxl.common.utils.IdUtil;
15 import com.phxl.modules.goods.dao.supplierstock.SupplierStockDao;
16 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
17 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
18
19
20 @Service
21 public class SupplierStockService{
22
23 @Autowired
24 private SupplierStockDao supplierStockDao;
25
26 private static Log log = LogFactory.getLog(SupplierStockService.class);
27
28
29 public boolean batchSave(List<SupplierStockList> supplierStocks) {
30 boolean result = false;
31 if (supplierStocks != null && supplierStocks.size() != 0) {
32 for (SupplierStockList supplierStockList : supplierStocks) {
33 SupplierStock supstock = supplierStockList.getData();
34 try {
35 checkStock(supstock);
36 } catch (Exception e) {
37 String json = JsonMapper.toJsonString(supstock);
38 log.error("同步医院库存:" + json + "信息异常");
39 throw new BaseException(e.getMessage());
40 }
41 supstock.setId(IdUtil.uuid());
42 supplierStockDao.insert(supstock);
43 }
44
45 result = true;
46 }
47 return result;
48 }
49
50 private void checkStock(SupplierStock supplierStock) {
51 //获取信息中供应商信息
52 String suppliercode = supplierStock.getSuppliercode();
53 String suppliername = supplierStock.getSuppliername();
54 if(StringUtils.isEmpty(suppliercode) || StringUtils.isEmpty(suppliername)){
55 log.error("供应商库存信息供应商编号以及供应商名称不能为空");
56 throw new BaseException("供应商库存信息供应商编号以及供应商名称不能为空");
57 }
58 //获取信息中商品信息
59 String goodsCode = supplierStock.getGoodsCode();
60 String goodsName = supplierStock.getGoodsName();
61 if(StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)){
62 log.error("供应商库存信息商品编码以及商品名称不能为空");
63 throw new BaseException("供应商库存信息商品编码以及商品名称不能为空");
64 }
65 //库存批号信息
66 String lot = supplierStock.getLot();
67 if(StringUtils.isEmpty(lot)){
68 log.error("供应商库存信息库存批号不能为空");
69 throw new BaseException("供应商库存信息库存批号不能为空");
70 }
71 Date productionDate = supplierStock.getProductionDate();
72 if(productionDate == null){
73 log.error("供应商库存信息库存生产日期不能为空");
74 throw new BaseException("供应商库存信息库存生产日期不能为空");
75 }
76 Date expireDate = supplierStock.getExpireDate();
77 if(expireDate == null){
78 log.error("供应商库存信息库存有效期至不能为空");
79 throw new BaseException("供应商库存信息库存有效期至不能为空");
80 }
81
82 }
83
84
85 }
1 package com.phxl.modules.goods.dao.ctdept;
2
3
4 import java.util.List;
5 import java.util.Map;
6
7 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
8
9 /**
10 *
11 * @ClassName: HisCtDeptDao
12 * @Description: HisCtDept数据访问接口
13 * @author hehaihong
14 * @date 2018-08-08 09:28:47
15 *
16 */
17 public interface HisCtDeptDao{
18
19 /**
20 * 批量获取数据
21 * @param map
22 * @return
23 */
24 public List<HisCtDept> batchSelect(Map<String,Object> map);
25
26 public void batchUpdate(List<HisCtDept> updateList);
27
28 public void batchInsert(List<HisCtDept> insertList);
29
30 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.service.medstock;
2
3 import java.util.Date;
4 import java.util.List;
5
6 import org.apache.commons.lang3.StringUtils;
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.phxl.common.util.JsonMapper;
13 import com.phxl.common.utils.BaseException;
14 import com.phxl.common.utils.IdUtil;
15 import com.phxl.modules.goods.dao.medstock.MedStockDao;
16 import com.phxl.modules.goods.entity.medstock.MedStock;
17 import com.phxl.modules.goods.entity.medstock.MedStockList;
18
19
20 @Service
21 public class MedStockService{
22
23 @Autowired
24 private MedStockDao stockDao;
25
26 private static Log log = LogFactory.getLog(MedStockService.class);
27
28 public boolean batchSave(List<MedStockList> stockList) {
29 boolean result = false;
30 if (stockList != null && stockList.size() != 0) {
31 for (MedStockList medStockList : stockList) {
32 MedStock medStock = medStockList.getData();
33 try {
34 checkStock(medStock);
35 } catch (Exception e) {
36 String json = JsonMapper.toJsonString(medStock);
37 log.error("同步医院库存:" + json + "信息异常");
38 throw new BaseException(e.getMessage());
39 }
40 medStock.setId(IdUtil.uuid());
41 stockDao.insert(medStock);
42 }
43 result = true;
44 }
45 return result;
46 }
47
48 private void checkStock(MedStock medStock) {
49 // 获取库存信息中供应商信息
50 String medSuppliercode = medStock.getMedSuppliercode();
51 String medSuppliername = medStock.getMedSuppliername();
52 if (StringUtils.isEmpty(medSuppliercode) || StringUtils.isEmpty(medSuppliername)) {
53 log.error("同步库存信息供应商编号以及供应商名称不能为空");
54 throw new BaseException("同步库存信息供应商编号以及供应商名称不能为空");
55 }
56 // 获取库存信息中供应商信息
57 String medCode = medStock.getMedCode();
58 String medName = medStock.getMedName();
59 if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
60 log.error("同步库存信息医院编号以及医院名称不能为空");
61 throw new BaseException("同步库存信息医院编号以及医院名称不能为空");
62 }
63 // 获取同步库存信息录商品信息
64 String goodsCode = medStock.getGoodsCode();
65 String goodsName = medStock.getGoodsName();
66 if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
67 log.error("同步库存信息商品编号以及商品名称不能为空");
68 throw new BaseException("同步库存信息商品编号以及商品名称不能为空");
69 }
70 // 获取对应商品规格
71 String goodsSpec = medStock.getGoodsSpec();
72 if (StringUtils.isEmpty(goodsSpec)) {
73 log.error("同步库存信息商品规格不能为空");
74 throw new BaseException("同步库存信息商品规格不能为空");
75 }
76 // 获取同步库存信息商品信息
77 String storeCode = medStock.getStoreCode();
78 String storeName = medStock.getStoreName();
79 if (StringUtils.isEmpty(storeCode) || StringUtils.isEmpty(storeName)) {
80 log.error("同步库存信息库房编码以及库房名称不能为空");
81 throw new BaseException("同步库存信息库房编码以及库房名称不能为空");
82 }
83 // 获取库存信息批号记录
84 String lot = medStock.getLot();
85 if (StringUtils.isEmpty(lot)) {
86 log.error("同步库存信息批号信息不能为空");
87 throw new BaseException("同步库存信息批号信息不能为空");
88 }
89 // 获取同步库存信息商品信息
90 Date productionDate = medStock.getProductionDate();
91 Date expireDate = medStock.getExpireDate();
92 if (productionDate == null || expireDate == null) {
93 log.error("同步库存信息生产日期以及有效期信息不能为空");
94 throw new BaseException("同步库存信息生产日期以及有效期信息不能为空");
95 }
96 }
97
98 }
1 package com.phxl.modules.goods.dao.invoiceback;
2
3 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
4
5 public interface SuInvoiceBackDao {
6
7 void insert(SuInvoiceBack invoiceBack);
8
9 }
1 package com.phxl.modules.goods.dao.billback;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.billback.BillBackDetail;
6
7 public interface BillBackDetailDao{
8
9 void batchInsert(List<BillBackDetail> details);
10
11
12 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
11 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
12 <result column="med_name" property="medName" jdbcType="VARCHAR" />
13 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
14 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
15 <result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
16 <result column="amount" property="amount" jdbcType="DECIMAL" />
17 <result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
18 <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
19 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
20 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
21 </resultMap>
22
23 <!--Base_Column_List -->
24 <sql id="Base_Column_List">id,settle_bill_no,settle_date,med_code,med_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,create_time,update_time</sql>
25
26 <!-- 新增invoiceback-->
27 <insert id="insert" parameterType="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
28 insert into med_supplier_invoice_back (id,settle_bill_no,settle_date,med_code,med_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,create_time,update_time)
29 values (
30 #{id,jdbcType=VARCHAR}
31 ,#{settleBillNo,jdbcType=VARCHAR}
32 ,#{settleDate,jdbcType=TIMESTAMP}
33 ,#{medCode,jdbcType=VARCHAR}
34 ,#{medName,jdbcType=VARCHAR}
35 ,#{supplierCode,jdbcType=VARCHAR}
36 ,#{supplierName,jdbcType=VARCHAR}
37 ,#{goodsSum,jdbcType=TINYINT}
38 ,#{amount,jdbcType=DECIMAL}
39 ,#{beginDate,jdbcType=TIMESTAMP}
40 ,#{endDate,jdbcType=TIMESTAMP}
41 ,#{create_time,jdbcType=TIMESTAMP}
42 ,#{update_time,jdbcType=TIMESTAMP}
43 )
44 </insert>
45
46 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
6 <title>二维码模板页面</title>
7 </head>
8 <body>
9 <div style="width: 265px;height: 130px; margin: 0px auto;">
10 <div style="text-align:center;font-size: 12px;font-family:宋体,SimSun;font-weight:900;"><span>
11 ${title}
12 </span></div>
13
14 <div style="font-size: 9px;">
15 <table border="0" cellspacing="0" cellpadding="0" style="margin-top:4px;">
16 <tr>
17 <td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">名称:</td>
18 <td valign="top" style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="106" height="15px">${materialName}</td>
19 <td style="text-align: center;" width="106" rowspan="6" >
20 ${qrImage}
21 <div style="width:106px;"><span style="width:100%;font-size:10px;font-family:宋体,SimSun;font-weight:900;">${qrcode}</span></div>
22 </td>
23 </tr>
24 <tr>
25 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">型号:</td>
26 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${fmodel}</td>
27 </tr>
28 <tr>
29 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">规格:</td>
30 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${spec}</td>
31 </tr>
32 <tr>
33 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">批号:</td>
34 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${flot}</td>
35 </tr>
36 <tr>
37 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">效期:</td>
38 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${prodDate}-${usefulDate}</td>
39 </tr>
40 <tr>
41 <td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">注册证:</td>
42 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${registerNo}</td>
43 </tr>
44 </table>
45 </div>
46 </div>
47
48
49 </body>
50 </html>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.common.util;
2
3 import java.io.File;
4 import java.io.FileInputStream;
5 import java.io.IOException;
6 import java.io.InputStream;
7 import java.security.MessageDigest;
8 import java.security.NoSuchAlgorithmException;
9
10 /**
11 * 提供一系列获取和校验MD5的方法
12 *
13 */
14 public class MD5Util {
15
16 /**
17 * 获取该输入流的MD5值
18 *
19 * @param is
20 * @return
21 * @throws NoSuchAlgorithmException
22 * @throws IOException
23 */
24 public static String getMD5(InputStream is) throws NoSuchAlgorithmException, IOException {
25 StringBuffer md5 = new StringBuffer();
26 MessageDigest md = MessageDigest.getInstance("MD5");
27 byte[] dataBytes = new byte[1024];
28
29 int nread = 0;
30 while ((nread = is.read(dataBytes)) != -1) {
31 md.update(dataBytes, 0, nread);
32 };
33 byte[] mdbytes = md.digest();
34
35 // convert the byte to hex format
36 for (int i = 0; i < mdbytes.length; i++) {
37 md5.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
38 }
39 return md5.toString();
40 }
41
42 /**
43 * 获取该文件的MD5值
44 *
45 * @param file
46 * @return
47 * @throws NoSuchAlgorithmException
48 * @throws IOException
49 */
50 public static String getMD5(File file) throws NoSuchAlgorithmException, IOException {
51 FileInputStream fis = new FileInputStream(file);
52 return getMD5(fis);
53 }
54
55 /**
56 * 获取指定路径文件的MD5值
57 *
58 * @param path
59 * @return
60 * @throws NoSuchAlgorithmException
61 * @throws IOException
62 */
63 public static String getMD5(String path) throws NoSuchAlgorithmException, IOException {
64 FileInputStream fis = new FileInputStream(path);
65 return getMD5(fis);
66 }
67
68 /**
69 * 校验该输入流的MD5值
70 *
71 * @param is
72 * @param toBeCheckSum
73 * @return
74 * @throws NoSuchAlgorithmException
75 * @throws IOException
76 */
77 public static boolean md5CheckSum(InputStream is, String toBeCheckSum) throws NoSuchAlgorithmException, IOException {
78 return getMD5(is).equals(toBeCheckSum);
79 }
80
81 /**
82 * 校验该文件的MD5值
83 *
84 * @param file
85 * @param toBeCheckSum
86 * @return
87 * @throws NoSuchAlgorithmException
88 * @throws IOException
89 */
90 public static boolean md5CheckSum(File file, String toBeCheckSum) throws NoSuchAlgorithmException, IOException {
91 return getMD5(file).equals(toBeCheckSum);
92 }
93
94 /**
95 * 校验指定路径文件的MD5值
96 *
97 * @param path
98 * @param toBeCheckSum
99 * @return
100 * @throws NoSuchAlgorithmException
101 * @throws IOException
102 */
103 public static boolean md5CheckSum(String path, String toBeCheckSum) throws NoSuchAlgorithmException, IOException {
104 return getMD5(path).equals(toBeCheckSum);
105 }
106
107 /* MD5 TEST
108 public static void main(String[] args) {
109 try {
110 System.out.println(getMD5("D:/work/BJ/ESB_CSS_CSS_ImportCustCompFormRejectInfoSrv.xml"));
111 } catch (NoSuchAlgorithmException e) {
112 e.printStackTrace();
113 } catch (IOException e) {
114 e.printStackTrace();
115 }
116 }
117 */
118 }
...\ No newline at end of file ...\ No newline at end of file
1 org.eclipse.wst.jsdt.launching.baseBrowserLibrary
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.medstock;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 import com.fasterxml.jackson.annotation.JsonFormat;
7
8 /**
9 * 医院库存信息
10 */
11
12 public class MedStock{
13
14 public String getMedCode() {
15 return medCode;
16 }
17 public void setMedCode(String medCode) {
18 this.medCode = medCode;
19 }
20 public String getMedName() {
21 return medName;
22 }
23 public void setMedName(String medName) {
24 this.medName = medName;
25 }
26 private String medCode;
27 private String medName;
28 private String medSuppliercode; //供应商代码
29 private String medSuppliername; //供应商名称
30 private String storeCode; //HIS库房编码
31 private String storeName; //HIS库房名称
32 private String goodsCode; //HIS商品编码
33 private String goodsSpec; //规格
34 private String goodsName; //商品名称
35 private String lot; //批号
36 private Date productionDate; //生产日期
37 private Date expireDate; //有效期至
38 private BigDecimal stockQty; //库存数量
39 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
40 private Date createTime; //创建时间
41 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
42 private Date updateTime; //更新时间
43
44 private String id;
45
46 public String getId() {
47 return id;
48 }
49 public void setId(String id) {
50 this.id = id;
51 }
52
53 public String getMedSuppliercode() {
54 return medSuppliercode;
55 }
56 public void setMedSuppliercode(String medSuppliercode) {
57 this.medSuppliercode = medSuppliercode;
58 }
59 public String getMedSuppliername() {
60 return medSuppliername;
61 }
62 public void setMedSuppliername(String medSuppliername) {
63 this.medSuppliername = medSuppliername;
64 }
65 public String getStoreCode() {
66 return storeCode;
67 }
68 public void setStoreCode(String storeCode) {
69 this.storeCode = storeCode;
70 }
71 public String getStoreName() {
72 return storeName;
73 }
74 public void setStoreName(String storeName) {
75 this.storeName = storeName;
76 }
77 public String getGoodsCode() {
78 return goodsCode;
79 }
80 public void setGoodsCode(String goodsCode) {
81 this.goodsCode = goodsCode;
82 }
83 public String getGoodsSpec() {
84 return goodsSpec;
85 }
86 public void setGoodsSpec(String goodsSpec) {
87 this.goodsSpec = goodsSpec;
88 }
89 public String getGoodsName() {
90 return goodsName;
91 }
92 public void setGoodsName(String goodsName) {
93 this.goodsName = goodsName;
94 }
95 public String getLot() {
96 return lot;
97 }
98 public void setLot(String lot) {
99 this.lot = lot;
100 }
101 public Date getProductionDate() {
102 return productionDate;
103 }
104 public void setProductionDate(Date productionDate) {
105 this.productionDate = productionDate;
106 }
107 public Date getExpireDate() {
108 return expireDate;
109 }
110 public void setExpireDate(Date expireDate) {
111 this.expireDate = expireDate;
112 }
113 public BigDecimal getStockQty() {
114 return stockQty;
115 }
116 public void setStockQty(BigDecimal stockQty) {
117 this.stockQty = stockQty;
118 }
119 public Date getCreateTime() {
120 return createTime;
121 }
122 public void setCreateTime(Date createTime) {
123 this.createTime = createTime;
124 }
125 public Date getUpdateTime() {
126 return updateTime;
127 }
128 public void setUpdateTime(Date updateTime) {
129 this.updateTime = updateTime;
130 }
131
132 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
6 version="2.5" >
7
8 <!-- 区分项目名称,防止默认重名 -->
9 <context-param>
10 <param-name>webAppRootKey</param-name>
11 <param-value>maven.example.root</param-value>
12 </context-param>
13
14 <!-- 设置Spring容器加载配置文件路径 -->
15 <context-param>
16 <param-name>contextConfigLocation</param-name>
17 <param-value>classpath*:spring/app*.xml</param-value>
18 </context-param>
19
20 <!-- Spring的log4j监听器 -->
21 <!-- <listener>
22 <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
23 </listener>-->
24
25
26 <!-- spring监听器 -->
27 <listener>
28 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
29 </listener>
30 <!-- Spring 刷新Introspector防止内存泄露 -->
31 <listener>
32 <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
33 </listener>
34
35
36 <listener>
37 <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
38 </listener>
39
40 <!-- filter -->
41 <filter>
42 <filter-name>encodingFilter</filter-name>
43 <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
44 <init-param>
45 <param-name>encoding</param-name>
46 <param-value>utf-8</param-value>
47 </init-param>
48 <init-param>
49 <param-name>forceEncoding</param-name>
50 <param-value>true</param-value>
51 </init-param>
52 </filter>
53 <filter-mapping>
54 <filter-name>encodingFilter</filter-name>
55 <url-pattern>/*</url-pattern>
56 </filter-mapping>
57
58
59 <!-- Spring view分发器 -->
60 <servlet>
61 <servlet-name>dispatcher</servlet-name>
62 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
63 <init-param>
64 <param-name>contextConfigLocation</param-name>
65 <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
66 </init-param>
67 <load-on-startup>1</load-on-startup>
68 </servlet>
69
70 <servlet-mapping>
71 <servlet-name>dispatcher</servlet-name>
72 <url-pattern>/</url-pattern>
73 </servlet-mapping>
74
75
76
77
78
79
80 <welcome-file-list>
81 <welcome-file>/WEB-INF/views/index.jsp</welcome-file>
82 </welcome-file-list>
83
84 </web-app>
1 package com.phxl.common.constants;
2
3 import com.phxl.common.util.Global;
4
5 public class PlatformConstant {
6
7 //平台接口地址
8 public static final String PlatForm_HUARUN_Url = Global.getConfig("huarun_service_url");
9
10 //SPD接口地址
11 public static final String PlatForm_SPD_Url = Global.getConfig("spd_service_url");
12
13 //推送对账,发药,库存平台地址
14 public static final String PlatForm_URL = Global.getConfig("platform_url");
15 }
1 package com.phxl.modules.goods.entity.billback;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4
5 import java.math.BigDecimal;
6 import java.util.Date;
7 import java.util.List;
8
9 /**
10 * 医院退货单信息
11 */
12
13 public class BillBack{
14
15 @JSONField(name = "BillNo")
16 private String billNo; //单据编号
17
18 @JSONField(name = "MedMVBillNo")
19 private String medMVBillNo; //入库单据编号
20
21 @JSONField(name = "SupplierCode")
22 private String supplierCode; //供应商编码
23
24 @JSONField(name = "SupplierbName")
25 private String supplierbName; //供应商名称
26
27 @JSONField(name = "MedCode")
28 private String medCode; //医疗机构代码
29
30 @JSONField(name = "MedName")
31 private String medName; //医疗机构名称
32
33 @JSONField(name = "BillDate")
34 private Date billDate; //退货时间
35
36 @JSONField(name = "Reason")
37 private String reason; //退货理由
38
39 @JSONField(name = "CountSum")
40 private int countSum; //明细条数
41
42 @JSONField(name = "DetailSum")
43 private BigDecimal detailSum; //明细金额
44
45 @JSONField(name = "OperaterName")
46 private String operaterName; //操作人员姓名
47
48 @JSONField(name = "InputDate")
49 private Date inputDate; //制单日期
50
51 @JSONField(name = "Memo")
52 private String memo; //备注
53
54 @JSONField(name = "CREATE_TIME")
55 private Date create_time; //创建时间
56
57 @JSONField(name = "UPDATE_TIME")
58 private Date update_time; //更新时间
59
60 @JSONField(name = "TRMedRPIdetail")
61 private List<BillBackDetail> TRMedRPIdetail; //退货单明细
62
63 private String id;
64
65 public String getId() {
66 return id;
67 }
68 public void setId(String id) {
69 this.id = id;
70 }
71
72 public String getBillNo() {
73 return billNo;
74 }
75 public void setBillNo(String billNo) {
76 this.billNo = billNo;
77 }
78 public String getMedMVBillNo() {
79 return medMVBillNo;
80 }
81 public void setMedMVBillNo(String medMVBillNo) {
82 this.medMVBillNo = medMVBillNo;
83 }
84 public String getSupplierCode() {
85 return supplierCode;
86 }
87 public void setSupplierCode(String supplierCode) {
88 this.supplierCode = supplierCode;
89 }
90 public String getSupplierbName() {
91 return supplierbName;
92 }
93 public void setSupplierbName(String supplierbName) {
94 this.supplierbName = supplierbName;
95 }
96 public String getMedCode() {
97 return medCode;
98 }
99 public void setMedCode(String medCode) {
100 this.medCode = medCode;
101 }
102 public String getMedName() {
103 return medName;
104 }
105 public void setMedName(String medName) {
106 this.medName = medName;
107 }
108 public Date getBillDate() {
109 return billDate;
110 }
111 public void setBillDate(Date billDate) {
112 this.billDate = billDate;
113 }
114 public String getReason() {
115 return reason;
116 }
117 public void setReason(String reason) {
118 this.reason = reason;
119 }
120 public int getCountSum() {
121 return countSum;
122 }
123 public void setCountSum(int countSum) {
124 this.countSum = countSum;
125 }
126 public BigDecimal getDetailSum() {
127 return detailSum;
128 }
129 public void setDetailSum(BigDecimal detailSum) {
130 this.detailSum = detailSum;
131 }
132 public String getOperaterName() {
133 return operaterName;
134 }
135 public void setOperaterName(String operaterName) {
136 this.operaterName = operaterName;
137 }
138 public Date getInputDate() {
139 return inputDate;
140 }
141 public void setInputDate(Date inputDate) {
142 this.inputDate = inputDate;
143 }
144 public String getMemo() {
145 return memo;
146 }
147 public void setMemo(String memo) {
148 this.memo = memo;
149 }
150 public Date getCreate_time() {
151 return create_time;
152 }
153 public void setCreate_time(Date create_time) {
154 this.create_time = create_time;
155 }
156 public Date getUpdate_time() {
157 return update_time;
158 }
159 public void setUpdate_time(Date update_time) {
160 this.update_time = update_time;
161 }
162
163 public List<BillBackDetail> getTRMedRPIdetail() {
164 return TRMedRPIdetail;
165 }
166
167 public void setTRMedRPIdetail(List<BillBackDetail> TRMedRPIdetail) {
168 this.TRMedRPIdetail = TRMedRPIdetail;
169 }
170 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <faceted-project>
3 <fixed facet="wst.jsdt.web"/>
4 <installed facet="java" version="1.6"/>
5 <installed facet="jst.web" version="2.5"/>
6 <installed facet="wst.jsdt.web" version="1.0"/>
7 <installed facet="jst.jaxrs" version="1.1"/>
8 </faceted-project>
1 <%-- <%@ page contentType="text/html;charset=UTF-8"%>
2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 <%
4 String path = request.getContextPath();
5 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
6 %>
7 <html>
8 <head>
9 <script type="text/javascript" src="<%=basePath%>js/jquery.js" charset="utf-8"></script>
10 <style>
11 html,body{text-align:center;margin:0px auto;}
12 </style>
13
14
15 <script type="text/javascript">
16 $(document).ready(function() {
17
18 $("#select").change(function(){
19 var value = $('#select option:selected') .val();
20 debugger;
21 if(value == '0'){
22 $("#form").attr('action','<%=basePath%>oss/uploadImage');
23 }else if(value == '1'){
24 $("#form").attr('action','<%=basePath%>oss/uploadHeadImage');
25 }else if(value == '2'){
26 $("#form").attr('action','<%=basePath%>oss/uploadAudio');
27 }else if(value == '3'){
28 $("#form").attr('action','<%=basePath%>oss/uploadVideo');
29 }
30 });
31 });
32 </script>
33 </head>
34 <body>
35
36 <div style="width:auto;height:20;margin-left:auto;margin-left:auto;">
37 ${msg}
38 </div>
39
40 <form name="form" id="form" aligin="ceter" action="<%=basePath%>oss/uploadImage" enctype="multipart/form-data" method="post"">
41
42 <div id="newUpload2">
43 <select id="select">
44 <option value ="0">图片</option>
45 <option value ="1">头像</option>
46 <option value="2">音频</option>
47 <option value="3">视频</option>
48 </select>
49 <input type="file" name="fileUpload">
50 </div>
51 <input type="submit" value="上传" >
52 </form>
53
54
55
56 </body>
57 </html> --%>
58
59
60 <%@ page contentType="text/html;charset=UTF-8"%>
61 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
62 <%
63 String path = request.getContextPath();
64 String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
65 + path + "/";
66 %>
67 <html>
68 <head>
69 <script type="text/javascript" src="<%=basePath%>js/jquery.js"
70 charset="utf-8"></script>
71 <title>搜索词自动完成</title>
72 <style type="text/css">
73 #search {
74 text-align: center;
75 position: relative;
76 }
77
78 .autocomplete {
79 border: 1px solid #9ACCFB;
80 background-color: white;
81 text-align: left;
82 }
83
84 .autocomplete li {
85 list-style-type: none;
86 }
87
88 .clickable {
89 cursor: default;
90 }
91
92 .highlight {
93 background-color: #9ACCFB;
94 }
95
96
97 </style>
98
99 <script type="text/javascript">
100
101 $(document).ready(function(){
102 sendxml();
103 });
104
105 function sendxml(){
106 var xmlData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><name>王森勇</name><author>tiger</author></book>";
107
108
109 var url = "<%=basePath%>bookInfo/sendxml";
110
111 $.ajax({
112 type: 'POST',
113 url: url ,
114 data: xmlData ,
115 dataType:"xml",
116
117 'success': function (data) {
118 alert(data);
119 } ,
120 'error': function (reslut) {
121 alert(reslut);
122 },
123 contentType:"application/xml"
124 });
125
126 }
127
128
129 $(function(){
130 //取得div层
131 var $search = $('#search');
132 //取得输入框JQuery对象
133 var $searchInput = $search.find('#search-text');
134 //关闭浏览器提供给输入框的自动完成
135 $searchInput.attr('autocomplete','off');
136 //创建自动完成的下拉列表,用于显示服务器返回的数据,插入在搜索按钮的后面,等显示的时候再调整位置
137 var $autocomplete = $('<div class="autocomplete"></div>').hide().insertAfter('#submit');
138 //清空下拉列表的内容并且隐藏下拉列表区
139 var clear = function(){
140 $autocomplete.empty().hide();
141 };
142 //注册事件,当输入框失去焦点的时候清空下拉列表并隐藏
143 $searchInput.blur(function(){
144 setTimeout(clear,500);
145 });
146 //下拉列表中高亮的项目的索引,当显示下拉列表项的时候,移动鼠标或者键盘的上下键就会移动高亮的项目,想百度搜索那样
147 var selectedItem = null;
148 //timeout的ID
149 var timeoutid = null;
150 //设置下拉项的高亮背景
151 var setSelectedItem = function(item){
152 //更新索引变量
153 selectedItem = item ;
154 //按上下键是循环显示的,小于0就置成最大的值,大于最大值就置成0
155 if(selectedItem < 0){
156 selectedItem = $autocomplete.find('li').length - 1;
157 }
158 else if(selectedItem > $autocomplete.find('li').length-1 ) {
159 selectedItem = 0;
160 }
161 //首先移除其他列表项的高亮背景,然后再高亮当前索引的背景
162 $autocomplete.find('li').removeClass('highlight')
163 .eq(selectedItem).addClass('highlight');
164 };
165 var ajax_request = function(){
166 //ajax服务端通信
167 $.ajax({
168 'url':'<%=basePath%>oss/datas', //服务器的地址
169 'data' : {
170 'search-text' : $searchInput.val()
171 }, //参数
172 'dataType' : 'json', //返回数据类型
173 'type' : 'POST', //请求类型
174 'success' : function(data) {
175 if (data.length) {
176 $autocomplete.empty();
177 //遍历data,添加到自动完成区
178 $.each(data, function(index, term) {
179 //创建li标签,添加到下拉列表中
180 $('<li></li>').text(term).appendTo($autocomplete)
181 .addClass('clickable').hover(
182 function() {
183 //下拉列表每一项的事件,鼠标移进去的操作
184 $(this).siblings().removeClass(
185 'highlight');
186 $(this).addClass('highlight');
187 selectedItem = index;
188 },
189 function() {
190 //下拉列表每一项的事件,鼠标离开的操作
191 $(this).removeClass('highlight');
192 //当鼠标离开时索引置-1,当作标记
193 selectedItem = -1;
194 }).click(function() {
195 //鼠标单击下拉列表的这一项的话,就将这一项的值添加到输入框中
196 $searchInput.val(term);
197 //清空并隐藏下拉列表
198 $autocomplete.empty().hide();
199 });
200 });//事件注册完毕
201 //设置下拉列表的位置,然后显示下拉列表
202 var ypos = $searchInput.position().top;
203 var xpos = $searchInput.position().left;
204 $autocomplete.css('width', );
205 $autocomplete.css({
206 'position' : 'relative',
207 'left' : xpos + "px",
208 'top' : ypos + "px"
209 });
210 setSelectedItem(0);
211 //显示下拉列表
212 $autocomplete.show();
213 }
214 }
215 });
216 };
217 //对输入框进行事件注册
218 $searchInput
219 .keyup(
220 function(event) {
221 //字母数字,退格,空格
222 if (event.keyCode > 40 || event.keyCode == 8
223 || event.keyCode == 32) {
224 //首先删除下拉列表中的信息
225 $autocomplete.empty().hide();
226 clearTimeout(timeoutid);
227 timeoutid = setTimeout(ajax_request, 100);
228 } else if (event.keyCode == 38) {
229 //上
230 //selectedItem = -1 代表鼠标离开
231 if (selectedItem == -1) {
232 setSelectedItem($autocomplete.find('li').length - 1);
233 } else {
234 //索引减1
235 setSelectedItem(selectedItem - 1);
236 }
237 event.preventDefault();
238 } else if (event.keyCode == 40) {
239 //下
240 //selectedItem = -1 代表鼠标离开
241 if (selectedItem == -1) {
242 setSelectedItem(0);
243 } else {
244 //索引加1
245 setSelectedItem(selectedItem + 1);
246 }
247 event.preventDefault();
248 }
249 }).keypress(
250 function(event) {
251 //enter键
252 if (event.keyCode == 13) {
253 //列表为空或者鼠标离开导致当前没有索引值
254 if ($autocomplete.find('li').length == 0
255 || selectedItem == -1) {
256 return;
257 }
258 $searchInput.val($autocomplete.find('li').eq(
259 selectedItem).text());
260 $autocomplete.empty().hide();
261 event.preventDefault();
262 }
263 }).keydown(function(event) {
264 //esc键
265 if (event.keyCode == 27) {
266 $autocomplete.empty().hide();
267 event.preventDefault();
268 }
269 });
270 //注册窗口大小改变的事件,重新调整下拉列表的位置
271 $(window).resize(function() {
272 var ypos = $searchInput.position().top;
273 var xpos = $searchInput.position().left;
274 $autocomplete.css('width', $searchInput.css('width'));
275 $autocomplete.css({
276 'position' : 'relative',
277 'left' : xpos+2 + "px",
278 'top' : ypos + "px"
279 });
280 });
281 });
282
283
284 function fileUpload() {
285 var fileName = $("#upfile").val();
286 if (fileName == null || fileName == "") {
287 alert("请选择文件");
288 } else {
289 debugger;
290 var fileType = fileName
291 .substr(fileName.length - 4, fileName.length);
292 if (fileType == ".xls" || fileType == "xlsx") {
293
294 var formData = new FormData();
295 formData.append("file", $("#upfile").prop("files")[0]);
296 $.ajax({
297 type : "post",
298 url : "<%=basePath%>exports/inLeadExcel",
299 data : formData,
300 cache : false,
301 processData : false,
302 contentType : false,
303 dataType : 'json', //返回数据类型
304 success : function(data) {
305 alert(data);
306 }
307 })
308 } else {
309 alert("导入文件类型错误!");
310 }
311 }
312 }
313
314 </script>
315 </head>
316 <body>
317 <div id="search">
318 <label for="search-text">请输入关键词</label><input type="text"
319 id="search-text" name="search-text" /> <input type="button"
320 id="submit" value="搜索" />
321
322 <a href="<%=basePath%>exports/printDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF" target="_blank"><button type="button" class="ant-btn ant-btn-primary"><span>打 印</span></button></a>
323 <a href="<%=basePath%>exports/exportDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF"><button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;"><span>导 出</span></button></a>
324 <button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;" onclick="$('#upfile').click();"><span>导 入</span></button>
325 <input type="file" class="file_input" id="upfile" onchange="fileUpload();" title=" " style="display:none">
326 </div>
327 </body>
328 </html>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:util="http://www.springframework.org/schema/util"
6 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
7 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
8 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
9
10 <context:annotation-config />
11
12
13
14 <context:component-scan base-package="com.phxl.modules.goods.web.spd">
15 <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
16 </context:component-scan>
17
18 <util:properties id="config" location="classpath:config.properties"/>
19
20 </beans>
1 ALTER TABLE med_bill_settlement ADD COLUMN use_bill_no LONGTEXT COMMENT '发药单号';
2 ALTER TABLE med_bill_settlement_detail DROP use_bill_no;
...\ No newline at end of file ...\ No newline at end of file
1 /**
2 * Copyright (c) 2005-2011 springside.org.cn
3 *
4 * $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
5 */
6 package com.phxl.common.utils;
7
8 import java.io.IOException;
9 import java.io.InputStream;
10 import java.util.NoSuchElementException;
11 import java.util.Properties;
12
13 import org.apache.commons.io.IOUtils;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16 import org.springframework.core.io.DefaultResourceLoader;
17 import org.springframework.core.io.Resource;
18 import org.springframework.core.io.ResourceLoader;
19
20 /**
21 * Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
22 * @author calvin
23 * @version 2013-05-15
24 */
25 public class PropertiesLoader {
26
27 private static Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
28
29 private static ResourceLoader resourceLoader = new DefaultResourceLoader();
30
31 private final Properties properties;
32
33 public PropertiesLoader(String... resourcesPaths) {
34 properties = loadProperties(resourcesPaths);
35 }
36
37 public Properties getProperties() {
38 return properties;
39 }
40
41 /**
42 * 取出Property,但以System的Property优先,取不到返回空字符串.
43 */
44 private String getValue(String key) {
45 String systemProperty = System.getProperty(key);
46 if (systemProperty != null) {
47 return systemProperty;
48 }
49 if (properties.containsKey(key)) {
50 return properties.getProperty(key);
51 }
52 return "";
53 }
54
55 /**
56 * 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
57 */
58 public String getProperty(String key) {
59 String value = getValue(key);
60 if (value == null) {
61 throw new NoSuchElementException();
62 }
63 return value;
64 }
65
66 /**
67 * 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
68 */
69 public String getProperty(String key, String defaultValue) {
70 String value = getValue(key);
71 return value != null ? value : defaultValue;
72 }
73
74 /**
75 * 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
76 */
77 public Integer getInteger(String key) {
78 String value = getValue(key);
79 if (value == null) {
80 throw new NoSuchElementException();
81 }
82 return Integer.valueOf(value);
83 }
84
85 /**
86 * 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
87 */
88 public Integer getInteger(String key, Integer defaultValue) {
89 String value = getValue(key);
90 return value != null ? Integer.valueOf(value) : defaultValue;
91 }
92
93 /**
94 * 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
95 */
96 public Double getDouble(String key) {
97 String value = getValue(key);
98 if (value == null) {
99 throw new NoSuchElementException();
100 }
101 return Double.valueOf(value);
102 }
103
104 /**
105 * 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
106 */
107 public Double getDouble(String key, Integer defaultValue) {
108 String value = getValue(key);
109 return value != null ? Double.valueOf(value) : defaultValue;
110 }
111
112 /**
113 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/false则返回false.
114 */
115 public Boolean getBoolean(String key) {
116 String value = getValue(key);
117 if (value == null) {
118 throw new NoSuchElementException();
119 }
120 return Boolean.valueOf(value);
121 }
122
123 /**
124 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/false则返回false.
125 */
126 public Boolean getBoolean(String key, boolean defaultValue) {
127 String value = getValue(key);
128 return value != null ? Boolean.valueOf(value) : defaultValue;
129 }
130
131 /**
132 * 载入多个文件, 文件路径使用Spring Resource格式.
133 */
134 private Properties loadProperties(String... resourcesPaths) {
135 Properties props = new Properties();
136
137 for (String location : resourcesPaths) {
138
139 // logger.debug("Loading properties file from:" + location);
140
141 InputStream is = null;
142 try {
143 Resource resource = resourceLoader.getResource(location);
144 is = resource.getInputStream();
145 props.load(is);
146 } catch (IOException ex) {
147 logger.info("Could not load properties from path:" + location + ", " + ex.getMessage());
148 } finally {
149 IOUtils.closeQuietly(is);
150 }
151 }
152 return props;
153 }
154 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao">
4
5 <insert id="insert">
6 INSERT INTO med_interface_log(
7 id,
8 request_time,
9 request_method,
10 request_param
11 ) VALUES (
12 #{id},
13 #{requestTime},
14 #{requestMethod},
15 #{requestParam}
16 )
17 </insert>
18
19 <!-- 更新接口请求结果信息-->
20 <update id="update" parameterType="com.phxl.modules.goods.entity.interfaceLog.InterfaceLog">
21 update med_interface_log
22 <set>
23 <if test="resultCode != null and resultCode != ''">
24 result_code = #{resultCode,jdbcType=VARCHAR},
25 </if>
26 <if test="resultContent != null and resultContent != ''">
27 result_content = #{resultContent,jdbcType=VARCHAR},
28 </if>
29 <if test="exception != null and exception != ''">
30 exception = #{exception,jdbcType=VARCHAR}
31 </if>
32 </set>
33 where id = #{id,jdbcType=BIGINT}
34 </update>
35
36 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.interfaceLog;
2
3 import java.util.Date;
4
5 /**
6 * 接口日志Entity
7 * @author zhangbing
8 * @version 2018-8-20
9 */
10
11 public class InterfaceLog{
12
13 private String id;
14 private Date requestTime; // 接口请求时间
15 private String requestMethod; // 请求方法
16 private String requestParam; // 接口请求参数
17 private String resultCode; // 接口请求结果状态
18 private String resultContent; // 接口请求结果内容
19 private String exception; //异常信息
20 public Date getRequestTime() {
21 return requestTime;
22 }
23 public void setRequestTime(Date requestTime) {
24 this.requestTime = requestTime;
25 }
26 public String getRequestMethod() {
27 return requestMethod;
28 }
29 public void setRequestMethod(String requestMethod) {
30 this.requestMethod = requestMethod;
31 }
32 public String getRequestParam() {
33 return requestParam;
34 }
35 public void setRequestParam(String requestParam) {
36 this.requestParam = requestParam;
37 }
38 public String getResultCode() {
39 return resultCode;
40 }
41 public void setResultCode(String resultCode) {
42 this.resultCode = resultCode;
43 }
44 public String getResultContent() {
45 return resultContent;
46 }
47 public void setResultContent(String resultContent) {
48 this.resultContent = resultContent;
49 }
50 public String getException() {
51 return exception;
52 }
53 public void setException(String exception) {
54 this.exception = exception;
55 }
56 public String getId() {
57 return id;
58 }
59 public void setId(String id) {
60 this.id = id;
61 }
62
63 }
1 package com.phxl.modules.goods.dao.medstock;
2
3 import com.phxl.modules.goods.entity.medstock.MedStock;
4
5 public interface MedStockDao{
6
7 void insert(MedStock stock);
8
9
10 }
1 package com.phxl.modules.goods.web.spd;
2
3 import javax.servlet.http.HttpServletRequest;
4
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7 import org.springframework.stereotype.Controller;
8 import org.springframework.web.bind.annotation.RequestMapping;
9 import org.springframework.web.bind.annotation.RequestMethod;
10 import org.springframework.web.bind.annotation.ResponseBody;
11
12 import com.phxl.common.constants.HisRequestConstant;
13 import com.phxl.common.util.XMLClient;
14
15
16
17 @Controller
18 @RequestMapping(value = "/hisproxy")
19 public class HisProxyController {
20
21 /**
22 * 日志对象
23 */
24 protected Logger logger = LoggerFactory.getLogger(getClass());
25
26
27 @ResponseBody
28 @RequestMapping(value="forward", method= RequestMethod.POST)
29 public Object setMFMedGoods(HttpServletRequest req, String method, String xmlInfo){
30 try{
31 String url = req.getScheme() + "://" + req.getServerName()
32 + ":" + req.getServerPort() + req.getServletPath();
33
34 return XMLClient.sendXMLDataByPost(url+"/spd/"+method,xmlInfo,HisRequestConstant.APPLICATION_XML);
35 }catch (Exception e){
36 logger.error("转换错误",e);
37 }
38 return null;
39
40 }
41
42
43 }
1 activeProfiles=
2 eclipse.preferences.version=1
3 resolveWorkspaceProjects=true
4 version=1
1 package com.phxl.modules.goods.entity.spills;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 /**
7 * 盘点损溢信息
8 */
9
10 public class HisSpills {
11
12 private String medCode; //医疗机构编码
13 private String medName; //医疗机构名称
14 private String depotCode; //库房编码
15 private String depotName; //库房名称
16 private Date tackStockDate; //报溢日期
17 private String operaterName; //审核人
18 private String goodsCode; //商品编码
19 private String goodsName; //商品名称
20 private String goodsSpec; //规格
21 private String manufacturer; //厂商
22 private String lot; //批号
23 private String unit; //单位
24 private BigDecimal number; //库存数量
25 private BigDecimal storckNum; //盘点数量
26 private BigDecimal differenceNum; //损溢数量
27 private String tackStockBillNo;
28 private String supplierCode;
29 private String supplierName;
30 private BigDecimal price;
31 private Date productionDate; //生产日期
32 private Date expireDate; //有效日期
33
34 private String id;
35
36 public String getTackStockBillNo() {
37 return tackStockBillNo;
38 }
39
40 public void setTackStockBillNo(String tackStockBillNo) {
41 this.tackStockBillNo = tackStockBillNo;
42 }
43
44 public String getSupplierCode() {
45 return supplierCode;
46 }
47
48 public void setSupplierCode(String supplierCode) {
49 this.supplierCode = supplierCode;
50 }
51
52 public String getSupplierName() {
53 return supplierName;
54 }
55
56 public void setSupplierName(String supplierName) {
57 this.supplierName = supplierName;
58 }
59
60 public BigDecimal getPrice() {
61 return price;
62 }
63
64 public void setPrice(BigDecimal price) {
65 this.price = price;
66 }
67
68
69 public String getMedCode() {
70 return medCode;
71 }
72
73 public void setMedCode(String medCode) {
74 this.medCode = medCode;
75 }
76
77 public String getMedName() {
78 return medName;
79 }
80
81 public void setMedName(String medName) {
82 this.medName = medName;
83 }
84
85 public String getDepotCode() {
86 return depotCode;
87 }
88
89 public void setDepotCode(String depotCode) {
90 this.depotCode = depotCode;
91 }
92
93 public String getDepotName() {
94 return depotName;
95 }
96
97 public void setDepotName(String depotName) {
98 this.depotName = depotName;
99 }
100
101 public Date getTackStockDate() {
102 return tackStockDate;
103 }
104
105 public void setTackStockDate(Date tackStockDate) {
106 this.tackStockDate = tackStockDate;
107 }
108
109 public String getOperaterName() {
110 return operaterName;
111 }
112
113 public void setOperaterName(String operaterName) {
114 this.operaterName = operaterName;
115 }
116
117 public String getGoodsCode() {
118 return goodsCode;
119 }
120
121 public void setGoodsCode(String goodsCode) {
122 this.goodsCode = goodsCode;
123 }
124
125 public String getGoodsName() {
126 return goodsName;
127 }
128
129 public void setGoodsName(String goodsName) {
130 this.goodsName = goodsName;
131 }
132
133 public String getGoodsSpec() {
134 return goodsSpec;
135 }
136
137 public void setGoodsSpec(String goodsSpec) {
138 this.goodsSpec = goodsSpec;
139 }
140
141 public String getManufacturer() {
142 return manufacturer;
143 }
144
145 public void setManufacturer(String manufacturer) {
146 this.manufacturer = manufacturer;
147 }
148
149 public String getLot() {
150 return lot;
151 }
152
153 public void setLot(String lot) {
154 this.lot = lot;
155 }
156
157 public String getUnit() {
158 return unit;
159 }
160
161 public void setUnit(String unit) {
162 this.unit = unit;
163 }
164
165 public BigDecimal getNumber() {
166 return number;
167 }
168
169 public void setNumber(BigDecimal number) {
170 this.number = number;
171 }
172
173 public BigDecimal getStorckNum() {
174 return storckNum;
175 }
176
177 public void setStorckNum(BigDecimal storckNum) {
178 this.storckNum = storckNum;
179 }
180
181 public BigDecimal getDifferenceNum() {
182 return differenceNum;
183 }
184
185 public void setDifferenceNum(BigDecimal differenceNum) {
186 this.differenceNum = differenceNum;
187 }
188
189 public String getId() {
190 return id;
191 }
192
193 public void setId(String id) {
194 this.id = id;
195 }
196
197 public Date getProductionDate() {
198 return productionDate;
199 }
200
201 public void setProductionDate(Date productionDate) {
202 this.productionDate = productionDate;
203 }
204
205 public Date getExpireDate() {
206 return expireDate;
207 }
208
209 public void setExpireDate(Date expireDate) {
210 this.expireDate = expireDate;
211 }
212
213 }
1 package com.phxl.modules.goods.service.billback;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
6 import org.apache.commons.lang3.StringUtils;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.phxl.common.utils.BaseException;
13 import com.phxl.common.utils.IdUtil;
14 import com.phxl.modules.goods.dao.billback.BillBackDao;
15 import com.phxl.modules.goods.dao.billback.BillBackDetailDao;
16 import com.phxl.modules.goods.entity.billback.BillBack;
17 import com.phxl.modules.goods.entity.billback.BillBackDetail;
18
19
20 @Service
21 public class BillBackService{
22
23 @Autowired
24 private BillBackDao billBackDao;
25
26 @Autowired
27 private BillBackDetailDao billBackDetailDao;
28
29 /**
30 * 日志对象
31 */
32 protected Logger logger = LoggerFactory.getLogger(getClass());
33
34 public boolean batchSave(List<BillBackWithDetail> billBacks) {
35 boolean result = true;
36 try {
37 checkBillBack(billBacks);
38 } catch (Exception e) {
39 throw new BaseException(e.getMessage());
40 }
41 for (BillBackWithDetail backs : billBacks) {
42 BillBack billBack = backs.getTRMedRPI();
43 List<BillBackDetail> details = billBack.getTRMedRPIdetail();
44 billBack.setId(IdUtil.uuid());
45 if(details != null && details.size() != 0){
46 for (BillBackDetail billBackDetail : details) {
47 billBackDetail.setBillNo(billBack.getBillNo());
48 billBackDetail.setId(IdUtil.uuid());
49 }
50 billBackDao.insert(billBack);
51 billBackDetailDao.batchInsert(details);
52 }
53 }
54 return result;
55 }
56
57 private void checkBillBack(List<BillBackWithDetail> billBacks) {
58 if(billBacks == null || billBacks.size() == 0){
59 logger.error("无相应医院退货单据信息");
60 throw new BaseException("无相应医院退货单据信息");
61 }
62 for (BillBackWithDetail backs : billBacks) {
63 String billNo = backs.getTRMedRPI().getBillNo();
64 if (StringUtils.isEmpty(billNo)) {
65 logger.error("医院退货单单据编号不能为空");
66 throw new BaseException("医院退货单单据编号不能为空");
67 }
68 String supplierCode = backs.getTRMedRPI().getSupplierCode();
69 String supplierbName = backs.getTRMedRPI().getSupplierbName();
70 if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(supplierbName)) {
71 logger.error("医院退货单单据编号:"+billNo+"供应商编码以及供应商名称不能为空");
72 throw new BaseException("医院退货单单据编号:"+billNo+"供应商编码以及供应商名称不能为空");
73 }
74 String medCode = backs.getTRMedRPI().getMedCode();
75 if (StringUtils.isEmpty(medCode)) {
76 logger.error("医院退货单单据编号:"+billNo+"医疗机构代码不能为空");
77 throw new BaseException("医院退货单单据编号:"+billNo+"医疗机构代码不能为空");
78 }
79 List<BillBackDetail> details = backs.getTRMedRPI().getTRMedRPIdetail();
80 if(details == null || details.size() == 0){
81 logger.error("医院退货单单据编号:"+billNo+"无相应退货单明细信息");
82 throw new BaseException("医院退货单单据编号:"+billNo+"无相应退货单明细信息");
83 }
84 for (BillBackDetail billBackDetail : details) {
85 String detailBillNo = billBackDetail.getBillNo();
86 if (StringUtils.isEmpty(detailBillNo)) {
87 logger.error("医院退货单单据编号:"+billNo+"退货单据明细单据编号不能为空");
88 throw new BaseException("医院退货单单据编号:"+billNo+"退货单据明细单据编号不能为空");
89 }
90 int rowNo = billBackDetail.getRowNo();
91 if (rowNo == 0) {
92 logger.error("医院退货单单据编号:"+billNo+"退货单据明细行号不能为空");
93 throw new BaseException("医院退货单单据编号:"+billNo+"退货单据明细行号不能为空");
94 }
95 String detailMedMVBillNo = billBackDetail.getMedMVBillNo();
96 if (StringUtils.isEmpty(detailMedMVBillNo)) {
97 logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据编号不能为空");
98 throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据编号不能为空");
99 }
100 Integer detailMedMVRowNo = billBackDetail.getMedMVRowNo();
101 if (detailMedMVRowNo == null) {
102 logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据明细号不能为空");
103 throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据明细不能为空");
104 }
105 String goodsCode = billBackDetail.getGoodsCode();
106 String goodsName = billBackDetail.getGoodsName();
107 if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
108 logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品编码以及商品名称不能为空");
109 throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品编码以及商品名称不能为空");
110 }
111 String goodsSpec = billBackDetail.getGoodsSpec();
112 if (StringUtils.isEmpty(goodsSpec)) {
113 logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品规格不能为空");
114 throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品规格不能为空");
115 }
116 }
117 }
118
119
120 }
121
122 }
1 package com.phxl.common.utils;
2
3 /**
4 * api通用状态返回
5 *
6 * @author Pxie
7 */
8 public class ReturnCode {
9 /**
10 * 未登录
11 */
12 public final static int UNLOGIN = -1;
13 /**
14 * 成功
15 */
16 public final static int SUCCESS = 1;
17 /**
18 * 后端提醒
19 */
20 public final static int WARN = 2;
21 /**
22 * 系统错误
23 */
24 public final static int ERROR = 500;
25 /**
26 * 登录超时
27 */
28 public final static int TOKEN_OUT = 4;
29 /**
30 * 加密签名错误
31 */
32 public final static int SIGN_ERROR = 5;
33
34 public final static String SUCCESSMSG = "success";
35 public final static String FAILMSG = "fail";
36 public final static String PARAMETERERROR = "参数缺少或者不对";
37
38 private Integer ret = 1;
39 private String msg = "success";
40 private Object data;
41
42 public ReturnCode() {
43 }
44
45 public ReturnCode(int ret) {
46 this.ret = ret;
47 }
48
49 public ReturnCode(int ret, Object o) {
50 this.ret = ret;
51 data = o;
52 }
53
54 public ReturnCode(int ret, String msg) {
55 this.ret = ret;
56 this.msg = msg;
57 }
58
59 public ReturnCode(int ret, Object data, int act) {
60 this.ret = ret;
61 this.data = data;
62 }
63
64 public ReturnCode(int ret, int act) {
65 super();
66 this.ret = ret;
67 }
68
69 public ReturnCode(int ret, String msg, Object data) {
70 this.ret = ret;
71 this.msg = msg;
72 this.data = data;
73 }
74
75 public Integer getRet() {
76 return ret;
77 }
78
79 public void setRet(Integer ret) {
80 this.ret = ret;
81 }
82
83 public String getMsg() {
84 return msg;
85 }
86
87 public void setMsg(String msg) {
88 this.msg = msg;
89 }
90
91 public Object getData() {
92 return data;
93 }
94
95 public void setData(Object data) {
96 this.data = data;
97 }
98
99 }
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>送货单打印(手术A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${fOrgName}医用耗材送货单</h3></td>
13 <td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">送货单号:${sendNo}</td>
17 <td width="25%" height="30">订单号:${orderNo}</td>
18 <td width="25%" height="30">医疗机构:${rOrgName}</td>
19 </tr>
20 <tr>
21 <td height="30" colspan="2">收货地址:${tfAddress}</td>
22 <td height="30" >期望到货时间:${expectDate}</td>
23 </tr>
24 <tr>
25 <td height="30">制单人:${sendUsername}</td>
26 <td height="30" colspan="2">制单时间:${sendDate}</td>
27 </tr>
28 <tr>
29
30 </tr>
31 </table>
32 <table width="100%" border="0" cellspacing="0" cellpadding="0">
33 <tr><td height="30" colspan='4'><hr width='100%' color='#65a6be' /></td></tr>
34 <tr>
35 <td width="25%" height="30">就诊号:${treatmentNo}</td>
36 <td width="25%" height="30">患者姓名:${name}</td>
37 <td width="25%" height="30">性别:${gender}</td>
38 <td width="25%" height="30">年龄:${age}</td>
39 </tr>
40 <tr>
41 <td width="25%" height="30">手术名称:${operName}</td>
42 <td width="25%" height="30">手术日期:${operDate}</td>
43 <td width="25%" height="30">品牌:${tfBrand}</td>
44 <td width="25%" height="30">备注:${tfRemark}</td>
45 </tr>
46 </table>
47 </div>
48 <div>
49 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
50 ${tableContent}
51 </table>
52 </div>
53 <div>
54 ${afterTable
55 <table width="100%" border="0" cellspacing="0" cellpadding="0">
56 <tr height="35px;">
57 <td width="20%" align="left">验收人:</td>
58 <td width="20%" align="left">收货人:</td>
59 <td width="15%" align="left">产品总数量:${materailAmount}</td>
60 <td width="15%" align="left">外来植入物总数量:${outerImpAmount}</td>
61 <td width="15%" align="left">灭菌总数量:${sterilizeAmount}</td>
62 <td width="15%" align="left">工具总数量:${toolAmount}</td>
63 </tr>
64 </table>
65 }
66 </div>
67 </div>
68 </body>
69 </html>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.common.util;
2 import java.io.BufferedReader;
3 import java.io.DataOutputStream;
4 import java.io.IOException;
5 import java.io.InputStreamReader;
6 import java.io.OutputStream;
7 import java.net.HttpURLConnection;
8 import java.net.URL;
9 import java.util.Map;
10
11
12
13 public class HttpUtils {
14
15
16
17
18 public static String readContentFromGet(String url) throws IOException {
19 // 拼凑get请求的URL字串,使用URLEncoder.encode对特殊和不可见字符进行编码
20 URL getUrl = new URL(url);
21 // 根据拼凑的URL,打开连接,URL.openConnection函数会根据URL的类型,
22 // 返回不同的URLConnection子类的对象,这里URL是一个http,因此实际返回的是HttpURLConnection
23 HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
24 connection.addRequestProperty("Content-Type","application/xml");
25 // 进行连接,但是实际上get request要在下一句的connection.getInputStream()函数中才会真正发到
26 // 服务器
27 connection.connect();
28 // 取得输入流,并使用Reader读取
29 BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));// 设置编码,否则中文乱码
30 String lines;
31 // while ((lines = reader.readLine()) != null){
32 // //lines = new String(lines.getBytes(), "utf-8");
33 // System.out.println(lines);
34 // }
35 lines = reader.readLine();
36 reader.close();
37 // 断开连接
38 connection.disconnect();
39
40 return lines;
41 }
42
43 public static String readContentFromPost2(String url, String content) throws IOException {
44 // Post请求的url,与get不同的是不需要带参数
45 URL postUrl = new URL(url);
46 // 打开连接
47 HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
48 // Output to the connection. Default is
49 // false, set to true because post
50 // method must write something to the
51 // connection
52 // 设置是否向connection输出,因为这个是post请求,参数要放在
53 // http正文内,因此需要设为true
54 connection.setDoOutput(true);
55 // Read from the connection. Default is true.
56 connection.setDoInput(true);
57 // Set the post method. Default is GET
58 connection.setRequestMethod("POST");
59 // Post cannot use caches
60 // Post 请求不能使用缓存
61 connection.setUseCaches(false);
62
63 // This method takes effects to
64 // every instances of this class.
65 // URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
66 // connection.setFollowRedirects(true);
67
68 // This methods only
69 // takes effacts to this
70 // instance.
71 // URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
72 connection.setInstanceFollowRedirects(true);
73 // Set the content type to urlencoded,
74 // because we will write
75 // some URL-encoded content to the
76 // connection. Settings above must be set before connect!
77 // 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
78 // 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
79 // 进行编码
80 //connection.addRequestProperty("Content-Type","application/xml");
81 //connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
82
83 /* 设置头的信息 */
84
85 connection.setRequestProperty("Content-Type", "text/xml");
86
87
88 // 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
89 // 要注意的是connection.getOutputStream会隐含的进行connect。
90 connection.connect();
91 DataOutputStream out = new DataOutputStream(connection.getOutputStream());
92 // The URL-encoded contend
93 // 正文,正文内容其实跟get的URL中'?'后的参数字符串一致,content
94
95 // DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
96 out.writeBytes(content);
97 out.flush();
98 out.close(); // flush and close
99 BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
100 String line = "";
101 // while ((line = reader.readLine()) != null){
102 // //line = new String(line.getBytes(), "utf-8");
103 // System.out.println(line);
104 // }
105 line = reader.readLine();
106 reader.close();
107 connection.disconnect();
108
109 return line;
110 }
111
112 public static String readContentFromPost(String url, String content) throws IOException {
113 // Post请求的url,与get不同的是不需要带参数
114 URL postUrl = new URL(url);
115 // 打开连接
116 HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
117 // Output to the connection. Default is
118 // false, set to true because post
119 // method must write something to the
120 // connection
121 // 设置是否向connection输出,因为这个是post请求,参数要放在
122 // http正文内,因此需要设为true
123 connection.setDoOutput(true);
124 // Read from the connection. Default is true.
125 connection.setDoInput(true);
126 // Set the post method. Default is GET
127 connection.setRequestMethod("POST");
128 // Post cannot use caches
129 // Post 请求不能使用缓存
130 connection.setUseCaches(false);
131
132 // This method takes effects to
133 // every instances of this class.
134 // URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
135 // connection.setFollowRedirects(true);
136
137 // This methods only
138 // takes effacts to this
139 // instance.
140 // URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
141 connection.setInstanceFollowRedirects(true);
142 // Set the content type to urlencoded,
143 // because we will write
144 // some URL-encoded content to the
145 // connection. Settings above must be set before connect!
146 // 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
147 // 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
148 // 进行编码
149 //connection.addRequestProperty("Content-Type","application/xml");
150 //connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
151
152 /* 设置头的信息 */
153
154 connection.setRequestProperty("Content-Type", "application/xml");
155
156
157 // 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
158 // 要注意的是connection.getOutputStream会隐含的进行connect。
159 connection.connect();
160 DataOutputStream out = new DataOutputStream(connection.getOutputStream());
161 // The URL-encoded contend
162 // 正文,正文内容其实跟get的URL中'?'后的参数字符串一致,content
163
164 // DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
165 out.writeBytes(content);
166 out.flush();
167 out.close(); // flush and close
168 BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
169 String line = "";
170 // while ((line = reader.readLine()) != null){
171 // //line = new String(line.getBytes(), "utf-8");
172 // System.out.println(line);
173 // }
174 line = reader.readLine();
175 reader.close();
176 connection.disconnect();
177
178 return line;
179 }
180
181 public static String readContentFromPost(String url, String content, String contentType) throws IOException {
182 // Post请求的url,与get不同的是不需要带参数
183 URL postUrl = new URL(url);
184 // 打开连接
185 HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
186 // Output to the connection. Default is
187 // false, set to true because post
188 // method must write something to the
189 // connection
190 // 设置是否向connection输出,因为这个是post请求,参数要放在
191 // http正文内,因此需要设为true
192 connection.setDoOutput(true);
193 // Read from the connection. Default is true.
194 connection.setDoInput(true);
195 // Set the post method. Default is GET
196 connection.setRequestMethod("POST");
197 // Post cannot use caches
198 // Post 请求不能使用缓存
199 connection.setUseCaches(false);
200
201 // This method takes effects to
202 // every instances of this class.
203 // URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
204 // connection.setFollowRedirects(true);
205
206 // This methods only
207 // takes effacts to this
208 // instance.
209 // URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
210 connection.setInstanceFollowRedirects(true);
211 // Set the content type to urlencoded,
212 // because we will write
213 // some URL-encoded content to the
214 // connection. Settings above must be set before connect!
215 // 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
216 // 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
217 // 进行编码
218 //connection.addRequestProperty("Content-Type","application/xml");
219 //connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
220
221 /* 设置头的信息 */
222
223 connection.setRequestProperty("Content-Type", contentType);
224
225
226 // 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
227 // 要注意的是connection.getOutputStream会隐含的进行connect。
228 connection.connect();
229 DataOutputStream out = new DataOutputStream(connection.getOutputStream());
230 // The URL-encoded contend
231 // 正文,正文内容其实跟get的URL中'?'后的参数字符串一致,content
232
233 // DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
234 out.writeBytes(content);
235 out.flush();
236 out.close(); // flush and close
237 BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
238 String line = "";
239 // while ((line = reader.readLine()) != null){
240 // //line = new String(line.getBytes(), "utf-8");
241 // System.out.println(line);
242 // }
243 line = reader.readLine();
244 reader.close();
245 connection.disconnect();
246
247 return line;
248 }
249
250 public static void fff(String url,String xml) {
251
252 try{
253 URL postUrl = new URL(url);
254 // 建立http连接
255 HttpURLConnection conn = (HttpURLConnection) postUrl.openConnection();
256 // 设置允许输出
257 conn.setDoOutput(true);
258
259 conn.setDoInput(true);
260
261 // 设置不用缓存
262 conn.setUseCaches(false);
263 // 设置传递方式
264 conn.setRequestMethod("POST");
265 // 设置维持长连接
266 conn.setRequestProperty("Connection", "Keep-Alive");
267 // 设置文件字符集:
268 conn.setRequestProperty("Charset", "UTF-8");
269 //转换为字节数组
270 byte[] data = xml.getBytes();
271 // 设置文件长度
272 conn.setRequestProperty("Content-Length", String.valueOf(data.length));
273 // 设置文件类型:
274 conn.setRequestProperty("contentType", "applicaiton/xml");
275
276 // 设置文件类型:
277 //conn.setRequestProperty("Content-Type","application/json; charset=UTF-8");
278 // 设置接收类型否则返回415错误
279 //conn.setRequestProperty("accept","*/*")此处为暴力方法设置接受所有类型,以此来防范返回415;
280 conn.setRequestProperty("accept","application/xml");
281 // 开始连接请求
282 conn.connect();
283 OutputStream out = conn.getOutputStream();
284 // 写入请求的字符串
285 out.write(data);
286 out.flush();
287 out.close();
288
289 System.out.println(conn.getResponseCode());
290 }catch (Exception e){
291 System.out.println(e);
292 }
293
294 }
295
296 public static void main(String[] args) {
297
298 // String content="&lt;p&gt;测试测试测试测试测试测试测试测试测试测试测试测试&lt;/p&gt;";
299 //String mytext = "act=2005&type=1&limit=30&loginUserId=&start=0&keyword=";
300 String mytext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><id>1</id><name>王森勇</name><author>tiger</author></book>";
301 /*
302 * try { //mytext = "content="+content+
303 * "&custId=0c8469cc950f44ca8728a2ec97db1222&sourceId=1&sourceType=1";
304 * //mytext = "content="+java.net.URLEncoder.encode(content, "utf-8")+
305 * "&custId=0c8469cc950f44ca8728a2ec97db1222&sourceId=1&sourceType=1";
306 * //System.out.println(mytext); //String mytext2 =
307 * java.net.URLDecoder.decode(mytext, "utf-8");
308 * //System.out.println(mytext2); } catch (UnsupportedEncodingException
309 * e) { // TODO Auto-generated catch block e.printStackTrace(); }
310 */
311 try {
312 /* String url = "http://localhost:8080/upload/spd/getxml";
313 String line = HttpUtils.readContentFromGet(url);
314 System.out.println(line);*/
315
316
317 String url = "http://localhost:8080/medicinal-supplier/bookInfo/sendxml";
318 //HttpUtils.initHeaderParam();
319 //fff(url,mytext);
320 String line = HttpUtils.readContentFromPost(url, mytext);
321 System.out.println(line);
322 Map<String, Object> aaa = JsonUtils.fromJson(line, Map.class);
323
324 /*
325 * for (Map.Entry<String, Object> entry : aaa.entrySet()) {
326 * if(entry.getValue() instanceof ArrayList ){
327 * aaa.put(entry.getKey(), (List)entry.getValue()); } }
328 *
329 * bbb = aaa.get("data");
330 */
331 // System.out.println(bbb instanceof ArrayList);
332
333 // List ccc =(List)bbb;
334 /* System.out.println(bbb); */
335 // Object ddd = ccc.get(0);
336 // System.out.println(ccc.get(0).get("clubId"));
337
338 } catch (IOException e) {
339 // TODO Auto-generated catch block
340 e.printStackTrace();
341 }
342 }
343 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.medplan;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.medplan.MedPlanDetail;
6
7 public interface MedPlanDetailDao{
8
9 void batchInsert(List<MedPlanDetail> details);
10
11 }
1 package com.phxl.modules.goods.dao.billsettlement;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail;
6
7 public interface BillSettlementDetailDao{
8
9 void batchInsert(List<BillSettlementDetail> details);
10
11 }
1 package com.phxl.common.util;
2
3 import java.io.BufferedInputStream;
4 import java.io.FileOutputStream;
5 import java.io.IOException;
6 import java.net.HttpURLConnection;
7 import java.net.URL;
8
9
10 public class Tools {
11
12 public static void main(String[] args) throws Exception {
13 String str = "http://yryz-upload.oss-cn-hangzhou.aliyuncs.com/headImage/65b3139c0c730d32e902279a152c6759.jpg";
14 String ext=str.substring(str.lastIndexOf("/")+1);
15 System.out.println(ext);
16 Tools dw = new Tools();
17 dw.saveToFile(str, "F:\\profiles\\" + ext);
18 }
19
20 /**
21 * 根据网络地址保存图片
22 */
23 public void saveToFile(String destUrl, String filePath) {
24 FileOutputStream fos = null;
25 BufferedInputStream bis = null;
26 HttpURLConnection httpUrl = null;
27 URL url = null;
28 int BUFFER_SIZE = 1024;
29 byte[] buf = new byte[BUFFER_SIZE];
30 int size = 0;
31 try {
32 url = new URL(destUrl);
33 httpUrl = (HttpURLConnection) url.openConnection();
34 httpUrl.connect();
35 bis = new BufferedInputStream(httpUrl.getInputStream());
36 fos = new FileOutputStream(filePath);
37 while ((size = bis.read(buf)) != -1) {
38 fos.write(buf, 0, size);
39 }
40 fos.flush();
41 } catch (IOException e) {
42 } catch (ClassCastException e) {
43 } finally {
44 try {
45 fos.close();
46 bis.close();
47 httpUrl.disconnect();
48 } catch (IOException e) {
49 } catch (NullPointerException e) {
50 }
51 }
52 }
53
54 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.medplan;
2
3 import java.math.BigDecimal;
4
5 /**
6 * 补货计划单明细
7 */
8
9 public class MedPlanDetail{
10
11 private String billNo; //单据编号
12 private int rowNo; //行号
13 private String goodsCode; //商品编码
14 private String goodsName; //商品名称
15 private String goodsSpec; //商品规格
16 private String manufacturer; //生产厂商
17 private BigDecimal poQty; //订货数
18 private String unit; //订货单位
19 private BigDecimal taxprice; //商品含税单价
20 private BigDecimal taxsum; //商品含税总金额
21
22 private String id;
23
24 public String getId() {
25 return id;
26 }
27 public void setId(String id) {
28 this.id = id;
29 }
30
31 public String getBillNo() {
32 return billNo;
33 }
34 public void setBillNo(String billNo) {
35 this.billNo = billNo;
36 }
37 public int getRowNo() {
38 return rowNo;
39 }
40 public void setRowNo(int rowNo) {
41 this.rowNo = rowNo;
42 }
43 public String getGoodsCode() {
44 return goodsCode;
45 }
46 public void setGoodsCode(String goodsCode) {
47 this.goodsCode = goodsCode;
48 }
49 public String getGoodsName() {
50 return goodsName;
51 }
52 public void setGoodsName(String goodsName) {
53 this.goodsName = goodsName;
54 }
55 public String getGoodsSpec() {
56 return goodsSpec;
57 }
58 public void setGoodsSpec(String goodsSpec) {
59 this.goodsSpec = goodsSpec;
60 }
61 public String getManufacturer() {
62 return manufacturer;
63 }
64 public void setManufacturer(String manufacturer) {
65 this.manufacturer = manufacturer;
66 }
67 public BigDecimal getPoQty() {
68 return poQty;
69 }
70 public void setPoQty(BigDecimal poQty) {
71 this.poQty = poQty;
72 }
73 public String getUnit() {
74 return unit;
75 }
76 public void setUnit(String unit) {
77 this.unit = unit;
78 }
79 public BigDecimal getTaxprice() {
80 return taxprice;
81 }
82 public void setTaxprice(BigDecimal taxprice) {
83 this.taxprice = taxprice;
84 }
85 public BigDecimal getTaxsum() {
86 return taxsum;
87 }
88 public void setTaxsum(BigDecimal taxsum) {
89 this.taxsum = taxsum;
90 }
91
92 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <classpath>
3 <classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
4 <classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
5 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
6 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
7 <attributes>
8 <attribute name="hide" value="true"/>
9 </attributes>
10 </classpathentry>
11 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
12 <classpathentry kind="output" path=""/>
13 </classpath>
1 package com.phxl.modules.goods.dao.medplan;
2
3 import com.phxl.modules.goods.entity.medplan.MedPlan;
4
5 public interface MedPlanDao{
6
7 void insert(MedPlan medPlan);
8
9 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="producer_name" property="producerName" jdbcType="VARCHAR" />
15 <result column="regist_key" property="registKey" jdbcType="VARCHAR" />
16 <result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
17 <result column="unit" property="unit" jdbcType="VARCHAR" />
18 <result column="settle_price" property="settlePrice" jdbcType="DECIMAL" />
19 <result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
20 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
21 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
22 <result column="invoice_no" property="invoiceNo" jdbcType="VARCHAR" />
23 <result column="invoice_code" property="invoiceCode" jdbcType="VARCHAR" />
24 <result column="invoice_time" property="invoiceTime" jdbcType="DECIMAL" />
25 <result column="invoice_amount" property="invoiceAmount" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,settle_bill_no,row_no,goods_code,goods_name,goods_spec,producer_name,regist_key,settle_qty,unit,settle_price,settle_amount,create_time,update_time,invoice_no,invoice_code,invoice_time,invoice_amount</sql>
30
31 <!--批量插入MedPlanDetail -->
32 <insert id="batchInsert" parameterType="list">
33 insert into med_supplier_invoice_back_detail (id,settle_bill_no,row_no,goods_code,goods_name,goods_spec,producer_name,regist_key,settle_qty,unit,settle_price,settle_amount,create_time,update_time,invoice_no,invoice_code,invoice_time,invoice_amount)
34 values
35 <foreach collection ="list" item="obj" separator =",">
36 <trim prefix=" (" suffix=")" suffixOverrides=",">
37 #{obj.id},
38 #{obj.settleBillNo},
39 #{obj.rowNo},
40 #{obj.goodsCode},
41 #{obj.goodsName},
42 #{obj.goodsSpec},
43 #{obj.producerName},
44 #{obj.registKey},
45 #{obj.settleQty},
46 #{obj.unit},
47 #{obj.settlePrice},
48 #{obj.settleAmount},
49 #{obj.create_time},
50 #{obj.update_time},
51 #{obj.invoiceNo},
52 #{obj.invoiceCode},
53 #{obj.invoiceTime},
54 #{obj.invoiceAmount}
55 </trim>
56 </foreach>
57 </insert>
58
59
60 </mapper>
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
11 <result column="bill_state" property="billState" jdbcType="VARCHAR" />
12 <result column="purchaser_corp_code" property="medCode" jdbcType="VARCHAR" />
13 <result column="purchaser_corp_name" property="medName" jdbcType="VARCHAR" />
14 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
15 <result column="supplier_name" property="supplierName" jdbcType="TIMESTAMP" />
16 <result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
17 <result column="amount" property="amount" jdbcType="DECIMAL" />
18 <result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
19 <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
20 <result column="use_bill_no" property="usebillno" jdbcType="VARCHAR" />
21 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
22 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
23 </resultMap>
24
25 <!--Base_Column_List -->
26 <sql id="Base_Column_List">id,settle_bill_no,settle_date,bill_state,purchaser_corp_code,purchaser_corp_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,use_bill_no,create_time,update_time</sql>
27
28
29 <!-- 新增BillBack-->
30 <insert id="insert" parameterType="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
31 insert into med_bill_settlement (id,settle_bill_no,settle_date,bill_state,purchaser_corp_code,purchaser_corp_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,use_bill_no,create_time,update_time)
32 values (
33 #{id,jdbcType=VARCHAR}
34 ,#{settleBillNo,jdbcType=VARCHAR}
35 ,#{settleDate,jdbcType=TIMESTAMP}
36 ,#{billState,jdbcType=VARCHAR}
37 ,#{medCode,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{supplierCode,jdbcType=VARCHAR}
40 ,#{supplierName,jdbcType=TIMESTAMP}
41 ,#{goodsSum,jdbcType=TINYINT}
42 ,#{amount,jdbcType=DECIMAL}
43 ,#{beginDate,jdbcType=TIMESTAMP}
44 ,#{endDate,jdbcType=TIMESTAMP}
45 ,#{useBillNo,jdbcType=VARCHAR}
46 ,#{create_time,jdbcType=TIMESTAMP}
47 ,#{update_time,jdbcType=TIMESTAMP}
48 )
49 </insert>
50
51 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.entity.ctcareprov;
2
3 import java.util.Date;
4 /**
5 *
6 * @ClassName: CTCareProv
7 * @Description: 医院人员表实体类
8 * @author wangsenyong
9 * @date 2018-08-08 13:37:21
10 *
11 */
12 public class CTCareProv{
13
14 private String mfmedStaffCode; //人员代码
15 private String logonUser; //登录账号
16 private String realName; //真实姓名
17 private String helpCode; //助记码
18 private String sex; //性别
19 private String mobileTel; //手机号
20 private String webChatCode; //微信号
21 private String idcode; //身份证号
22 private String e_mail; //E-MAIL
23 private String hdeptCode; //所属部门
24 private String category; //商品大类
25 private String ishadministrator; //是否管理员
26 private Date update_time; //更新时间
27
28 private String id;
29
30 public String getId() {
31 return id;
32 }
33 public void setId(String id) {
34 this.id = id;
35 }
36 public String getMfmedStaffCode() {
37 return mfmedStaffCode;
38 }
39 public void setMfmedStaffCode(String mfmedStaffCode) {
40 this.mfmedStaffCode = mfmedStaffCode;
41 }
42 public String getLogonUser() {
43 return logonUser;
44 }
45 public void setLogonUser(String logonUser) {
46 this.logonUser = logonUser;
47 }
48 public String getRealName() {
49 return realName;
50 }
51 public void setRealName(String realName) {
52 this.realName = realName;
53 }
54 public String getHelpCode() {
55 return helpCode;
56 }
57 public void setHelpCode(String helpCode) {
58 this.helpCode = helpCode;
59 }
60 public String getSex() {
61 return sex;
62 }
63 public void setSex(String sex) {
64 this.sex = sex;
65 }
66 public String getMobileTel() {
67 return mobileTel;
68 }
69 public void setMobileTel(String mobileTel) {
70 this.mobileTel = mobileTel;
71 }
72 public String getWebChatCode() {
73 return webChatCode;
74 }
75 public void setWebChatCode(String webChatCode) {
76 this.webChatCode = webChatCode;
77 }
78 public String getIdcode() {
79 return idcode;
80 }
81 public void setIdcode(String idcode) {
82 this.idcode = idcode;
83 }
84 public String getE_mail() {
85 return e_mail;
86 }
87 public void setE_mail(String e_mail) {
88 this.e_mail = e_mail;
89 }
90 public String getHdeptCode() {
91 return hdeptCode;
92 }
93 public void setHdeptCode(String hdeptCode) {
94 this.hdeptCode = hdeptCode;
95 }
96 public String getCategory() {
97 return category;
98 }
99 public void setCategory(String category) {
100 this.category = category;
101 }
102 public String getIshadministrator() {
103 return ishadministrator;
104 }
105 public void setIshadministrator(String ishadministrator) {
106 this.ishadministrator = ishadministrator;
107 }
108 public Date getUpdate_time() {
109 return update_time;
110 }
111 public void setUpdate_time(Date update_time) {
112 this.update_time = update_time;
113 }
114
115
116 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.billsettlement;
2
3 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
4
5 public interface BillSettlementDao{
6
7 void insert(BillSettlement billSettlement);
8
9
10 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="med_plan_no" property="medPlanNo" jdbcType="VARCHAR" />
12 <result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
13 <result column="goods_guid" property="goodsGuid" jdbcType="VARCHAR" />
14 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
15 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
16 <result column="unit" property="unit" jdbcType="VARCHAR" />
17 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
18 <result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
19 <result column="amount" property="amount" jdbcType="DECIMAL" />
20 <result column="lot" property="lot" jdbcType="VARCHAR" />
21 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
22 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
23 <result column="poqty" property="poqty" jdbcType="DECIMAL" />
24 <result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
25 <result column="memo" property="memo" jdbcType="VARCHAR" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,row_no,med_plan_no,med_plan_row_no,goods_guid,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,poqty,arrivalqty,memo</sql>
30
31 <!--批量插入MedPlanDetail -->
32 <insert id="batchInsert" parameterType="list">
33 insert into med_supplier_out_store_detail (id,bill_no,row_no,med_plan_no,med_plan_row_no,goods_guid,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,poqty,arrivalqty,memo)
34 values
35 <foreach collection ="list" item="obj" separator =",">
36 <trim prefix=" (" suffix=")" suffixOverrides=",">
37 #{obj.id},
38 #{obj.billNo},
39 #{obj.rowNo},
40 #{obj.medPlanNo},
41 #{obj.medPlanRowNo},
42 #{obj.goodsGuid},
43 #{obj.goodsName},
44 #{obj.goodsSpec},
45 #{obj.unit},
46 #{obj.manufacturer},
47 #{obj.purchaserPrice},
48 #{obj.amount},
49 #{obj.lot},
50 #{obj.productionDate},
51 #{obj.expireDate},
52 #{obj.poqty},
53 #{obj.arrivalqty},
54 #{obj.memo}
55 </trim>
56 </foreach>
57 </insert>
58
59
60 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medstock.MedStockDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medstock.MedStock">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
10 <result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
11 <result column="store_code" property="storeCode" jdbcType="VARCHAR" />
12 <result column="store_name" property="storeName" jdbcType="VARCHAR" />
13 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
14 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
15 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
16 <result column="lot" property="lot" jdbcType="VARCHAR" />
17 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
18 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
19 <result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
20 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
21 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
22 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
23 <result column="med_name" property="medName" jdbcType="VARCHAR" />
24
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name</sql>
29
30 <!--批量插入 -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_stock (id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.medSuppliercode},
38 #{obj.medSuppliername},
39 #{obj.storeCode},
40 #{obj.storeName},
41 #{obj.goodsCode},
42 #{obj.goodsSpec},
43 #{obj.goodsName},
44 #{obj.lot},
45 #{obj.productionDate},
46 #{obj.expireDate},
47 #{obj.stockQty},
48 #{obj.createTime},
49 #{obj.updateTime},
50 #{obj.medCode},
51 #{obj.medName},
52 </trim>
53 </foreach>
54 </insert>
55 <!-- 新增HisSpills-->
56 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medstock.MedStock">
57 insert into med_stock (id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name)
58 values (
59 #{id,jdbcType=VARCHAR}
60 ,#{medSuppliercode,jdbcType=VARCHAR}
61 ,#{medSuppliername,jdbcType=VARCHAR}
62 ,#{storeCode,jdbcType=VARCHAR}
63 ,#{storeName,jdbcType=VARCHAR}
64 ,#{goodsCode,jdbcType=TIMESTAMP}
65 ,#{goodsSpec,jdbcType=VARCHAR}
66 ,#{goodsName,jdbcType=VARCHAR}
67 ,#{lot,jdbcType=VARCHAR}
68 ,#{productionDate,jdbcType=VARCHAR}
69 ,#{expireDate,jdbcType=DECIMAL}
70 ,#{stockQty,jdbcType=DECIMAL}
71 ,#{createTime,jdbcType=DECIMAL}
72 ,#{updateTime,jdbcType=TIMESTAMP}
73 ,#{medCode,jdbcType=VARCHAR}
74 ,#{medName,jdbcType=VARCHAR}
75 )
76 </insert>
77
78 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.service.spills;
2
3
4 import java.math.BigDecimal;
5 import java.util.Date;
6 import java.util.List;
7
8 import org.apache.commons.lang3.StringUtils;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Service;
13
14 import com.phxl.common.util.JsonMapper;
15 import com.phxl.common.utils.BaseException;
16 import com.phxl.common.utils.IdUtil;
17 import com.phxl.modules.goods.dao.spills.HisSpillsDao;
18 import com.phxl.modules.goods.entity.spills.HisSpills;
19 import com.phxl.modules.goods.entity.spills.HisSpillsList;
20
21 @Service
22 public class HisSpillsService {
23
24 @Autowired
25 private HisSpillsDao hisSpillsDao;
26
27 /**
28 * 日志对象
29 */
30 protected Logger logger = LoggerFactory.getLogger(getClass());
31
32
33 public boolean batchSave(List<HisSpillsList> spills) {
34 boolean result = false;
35 if (spills != null && spills.size() != 0) {
36 for (HisSpillsList hisSpillsList : spills) {
37 HisSpills hisSpills = hisSpillsList.getData();
38 try {
39 checkSpills(hisSpills);
40 } catch (Exception e) {
41 String json = JsonMapper.toJsonString(hisSpills);
42 logger.error("同步医院盘点损溢单:" + json + "信息异常");
43 throw new BaseException(e.getMessage());
44 }
45 hisSpills.setId(IdUtil.uuid());
46 hisSpillsDao.insert(hisSpills);
47 }
48
49 result = true;
50 }
51 return result;
52 }
53
54
55 private void checkSpills(HisSpills hisSpills) {
56 // 获取库存信息中供应商信息
57 String medCode = hisSpills.getMedCode();
58 String medName = hisSpills.getMedName();
59 String supplierCode = hisSpills.getSupplierCode();
60 String supplierName = hisSpills.getSupplierName();
61 String stockbillno = hisSpills.getTackStockBillNo();
62 if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
63 logger.error("盘点损溢信息医疗机构编码以及名称不能为空");
64 throw new BaseException("盘点损溢信息医疗机构编码以及名称不能为空");
65 }
66 if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(supplierName)) {
67 logger.error("盘点损溢信息供应商编码以及名称不能为空");
68 throw new BaseException("盘点损溢信息供应商编码以及名称不能为空");
69 }
70 if (StringUtils.isEmpty(stockbillno)) {
71 logger.error("盘点单号不能为空");
72 throw new BaseException("盘点单号不能为空");
73 }
74 Date tackStockDate = hisSpills.getTackStockDate();
75 if (tackStockDate == null) {
76 logger.error("盘点损溢信息报溢时间不能为空");
77 throw new BaseException("盘点损溢信息报溢时间不能为空");
78 }
79 String operaterName = hisSpills.getOperaterName();
80 if (StringUtils.isEmpty(operaterName)) {
81 logger.error("盘点损溢信息审核人不能为空");
82 throw new BaseException("盘点损溢信息审核人不能为空");
83 }
84 String goodsCode = hisSpills.getGoodsCode();
85 if (StringUtils.isEmpty(goodsCode)) {
86 logger.error("盘点损溢信息商品编码不能为空");
87 throw new BaseException("盘点损溢信息商品编码不能为空");
88 }
89 String lot = hisSpills.getLot();
90 if (StringUtils.isEmpty(lot)) {
91 logger.error("盘点损溢信息批号不能为空");
92 throw new BaseException("盘点损溢信息批号不能为空");
93 }
94 BigDecimal number = hisSpills.getNumber();
95 if (number == null) {
96 logger.error("盘点损溢信息库存数量不能为空");
97 throw new BaseException("盘点损溢信息库存数量不能为空");
98 }
99 BigDecimal storckNum = hisSpills.getStorckNum();
100 if (storckNum == null) {
101 logger.error("盘点损溢信息盘点数量不能为空");
102 throw new BaseException("盘点损溢信息盘点数量不能为空");
103 }
104 BigDecimal differenceNum = hisSpills.getDifferenceNum();
105 if (differenceNum == null) {
106 logger.error("盘点损溢信息损溢数量不能为空");
107 throw new BaseException("盘点损溢信息损溢数量不能为空");
108 }
109 }
110
111 }
1 package com.phxl.modules.goods.dao.suoutstore;
2
3 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
4
5 public interface SuOutStoreDao {
6
7 void insert(SuOutStore suOutStore);
8
9 }
1 package com.phxl.modules.goods.entity.billsettlement;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5 import java.util.List;
6
7 /**
8 * 医院结算单信息
9 */
10
11 public class BillSettlement{
12 private String id;
13 private String settleBillNo; //结算单号
14 private Date settleDate; //结算单日期
15 private String medCode;
16 private String medName;
17 private String billState; //单据状态
18 private String supplierCode; //供应商编码
19 private String supplierName; //供应商名称
20 private int goodsSum; //商品数
21 private BigDecimal amount; //结算金额
22 private Date beginDate; //业务开始日期
23 private Date endDate; //业务结束日期
24 private Date create_time; //创建时间
25 private String useBillNo; //发药单据编号
26 private Date update_time; //更新时间
27 private List<BillSettlementDetail> TRSettleDetail; //结算单明细
28
29 public String getId() {
30 return id;
31 }
32
33 public void setId(String id) {
34 this.id = id;
35 }
36
37 public String getSettleBillNo() {
38 return settleBillNo;
39 }
40
41 public void setSettleBillNo(String settleBillNo) {
42 this.settleBillNo = settleBillNo;
43 }
44
45 public Date getSettleDate() {
46 return settleDate;
47 }
48
49 public void setSettleDate(Date settleDate) {
50 this.settleDate = settleDate;
51 }
52
53 public String getMedCode() {
54 return medCode;
55 }
56
57 public void setMedCode(String medCode) {
58 this.medCode = medCode;
59 }
60
61 public String getMedName() {
62 return medName;
63 }
64
65 public void setMedName(String medName) {
66 this.medName = medName;
67 }
68
69 public String getBillState() {
70 return billState;
71 }
72
73 public void setBillState(String billState) {
74 this.billState = billState;
75 }
76
77 public String getSupplierCode() {
78 return supplierCode;
79 }
80
81 public void setSupplierCode(String supplierCode) {
82 this.supplierCode = supplierCode;
83 }
84
85 public String getSupplierName() {
86 return supplierName;
87 }
88
89 public void setSupplierName(String supplierName) {
90 this.supplierName = supplierName;
91 }
92
93 public int getGoodsSum() {
94 return goodsSum;
95 }
96
97 public void setGoodsSum(int goodsSum) {
98 this.goodsSum = goodsSum;
99 }
100
101 public BigDecimal getAmount() {
102 return amount;
103 }
104
105 public void setAmount(BigDecimal amount) {
106 this.amount = amount;
107 }
108
109 public Date getBeginDate() {
110 return beginDate;
111 }
112
113 public void setBeginDate(Date beginDate) {
114 this.beginDate = beginDate;
115 }
116
117 public Date getEndDate() {
118 return endDate;
119 }
120
121 public void setEndDate(Date endDate) {
122 this.endDate = endDate;
123 }
124
125 public Date getCreate_time() {
126 return create_time;
127 }
128
129 public void setCreate_time(Date create_time) {
130 this.create_time = create_time;
131 }
132
133 public Date getUpdate_time() {
134 return update_time;
135 }
136
137 public void setUpdate_time(Date update_time) {
138 this.update_time = update_time;
139 }
140
141 public List<BillSettlementDetail> getTRSettleDetail() {
142 return TRSettleDetail;
143 }
144
145 public void setTRSettleDetail(List<BillSettlementDetail> tRSettleDetail) {
146 TRSettleDetail = tRSettleDetail;
147 }
148
149
150 public String getUseBillNo() {
151 return useBillNo;
152 }
153
154 public void setUseBillNo(String useBillNo) {
155 this.useBillNo = useBillNo;
156 }
157
158 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medinstore.MedInStore">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
11 <result column="med_name" property="medName" jdbcType="VARCHAR" />
12 <result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
13 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
14 <result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
15 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
16 <result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
17 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
18 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
19 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
20 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
21 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
22 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
25 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
30
31 <!-- 新增MedInStore-->
32 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medinstore.MedInStore">
33 insert into med_hli_in_store (id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
34 values (
35 #{id,jdbcType=VARCHAR}
36 ,#{billNo,jdbcType=VARCHAR}
37 ,#{medGuid,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{medDeptGuid,jdbcType=VARCHAR}
40 ,#{medDeptName,jdbcType=VARCHAR}
41 ,#{medStoreGuid,jdbcType=VARCHAR}
42 ,#{medStoreName,jdbcType=VARCHAR}
43 ,#{supplierGuid,jdbcType=VARCHAR}
44 ,#{supplierName,jdbcType=VARCHAR}
45 ,#{billDate,jdbcType=TIMESTAMP}
46 ,#{countSum,jdbcType=TINYINT}
47 ,#{detailSum,jdbcType=DECIMAL}
48 ,#{operaterName,jdbcType=VARCHAR}
49 ,#{inputDate,jdbcType=TIMESTAMP}
50 ,#{memo,jdbcType=VARCHAR}
51 ,#{create_time,jdbcType=TIMESTAMP}
52 ,#{update_time,jdbcType=TIMESTAMP}
53 )
54 </insert>
55
56
57 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.supplygoods;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
6
7 public interface MedSupplyGoodsDao{
8
9 void batchInsert(List<MedSupplyGoods> supplyGoods);
10
11
12 }
1 package com.phxl.common.util;
2
3 import org.apache.http.HttpEntity;
4 import org.apache.http.HttpResponse;
5 import org.apache.http.client.HttpClient;
6 import org.apache.http.client.methods.HttpPost;
7 import org.apache.http.entity.StringEntity;
8 import org.apache.http.impl.client.HttpClients;
9 import org.apache.http.util.EntityUtils;
10
11 public class XMLClient {
12 private static HttpClient client;
13
14 public static void main(String[] args) throws Exception {
15 XMLClient client = new XMLClient();
16 String url = "http://localhost:8080/upload/bookInfo/sendxml5";
17 //发送XML数据到服务
18 String result = client.sendXMLDataByPost(url, client.getXMLString(),"text/xml");
19 System.out.println(result);
20 }
21
22 // 获取XML
23 public String getXMLString() {
24 String XML_HEADER = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
25 StringBuffer sb = new StringBuffer();
26 sb.append(XML_HEADER);
27 sb.append("<a>");
28 sb.append("<b>");
29 sb.append("<c>");
30 sb.append("DWMC");
31 sb.append("</c>");
32 sb.append("<d>");
33 sb.append("id=10");
34 sb.append("</d>");
35 sb.append("</SELECT>");
36 sb.append("</b>");
37 sb.append("</a>");
38
39 String mytext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><id>1</id><name>王森勇</name><author>tiger</author></book>";
40 // 返回String格式
41 return mytext.toString();
42 }
43
44 // 使用POST方法发送XML数据LL
45 public static String sendXMLDataByPost(String url, String xmlData, String contentType) throws Exception {
46 if (client == null){
47 client = HttpClients.createDefault();
48 }
49 HttpPost post = new HttpPost(url);
50 //post.setHeader("Content-Type","text/xml;charset=UTF-8");
51
52 post.setHeader("Content-Type", ""+contentType+";charset=utf-8");
53 // List<BasicNameValuePair> parameters = new ArrayL ist<BasicNameValuePair>();
54 //.add(new BasicNameValuePair("text/xml", xmlData));
55 // post.setEntity(new UrlEncodedFormEntity(parameters,"UTF-8"));
56
57 StringEntity entity1 = new StringEntity(xmlData,"UTF-8");
58 post.setEntity(entity1);
59
60
61 HttpResponse response = client.execute(post);
62 System.out.println(response.toString());
63 HttpEntity entity = response.getEntity();
64 String result = EntityUtils.toString(entity, "UTF-8");
65 return result;
66 }
67
68 }
69
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billback.BillBackDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
12 <result column="medMV_row_no" property="medMVRowNo" jdbcType="TINYINT" />
13 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
14 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
15 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
16 <result column="returns_unit" property="returns_Unit" jdbcType="VARCHAR" />
17 <result column="returns_price" property="returns_Price" jdbcType="DECIMAL" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="rpi_qty" property="rpiQty" jdbcType="DECIMAL" />
20 <result column="amount" property="amount" jdbcType="DECIMAL" />
21 <result column="lot" property="lot" jdbcType="VARCHAR" />
22 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
23 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
24 <result column="memo" property="memo" jdbcType="VARCHAR" />
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,bill_no,row_no,medMV_bill_no,medMV_row_no,goods_code,goods_name,goods_spec,returns_unit,returns_price,manufacturer,rpi_qty,amount,lot,production_date,expire_date,memo</sql>
29
30 <!--批量插入BillBackDetail -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_bill_back_detail (id,bill_no,row_no,medMV_bill_no,medMV_row_no,goods_code,goods_name,goods_spec,returns_unit,returns_price,manufacturer,rpi_qty,amount,lot,production_date,expire_date,memo)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.billNo},
38 #{obj.rowNo},
39 #{obj.medMVBillNo},
40 #{obj.medMVRowNo},
41 #{obj.goodsCode},
42 #{obj.goodsName},
43 #{obj.goodsSpec},
44 #{obj.returns_Unit},
45 #{obj.returns_Price},
46 #{obj.manufacturer},
47 #{obj.rpiQty},
48 #{obj.amount},
49 #{obj.lot},
50 #{obj.productionDate},
51 #{obj.expireDate},
52 #{obj.memo}
53 </trim>
54 </foreach>
55 </insert>
56
57
58 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
10 <result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="producer" property="producer" jdbcType="VARCHAR" />
14 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
15 <result column="unit_style" property="unitStyle" jdbcType="VARCHAR" />
16 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
17 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
18 <result column="price" property="price" jdbcType="DECIMAL" />
19 </resultMap>
20
21 <!--Base_Column_List -->
22 <sql id="Base_Column_List">id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price</sql>
23
24 <!--批量插入 -->
25 <insert id="batchInsert" parameterType="list">
26 insert into med_supply_catalog (id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price)
27 values
28 <foreach collection ="list" item="obj" separator =",">
29 <trim prefix=" (" suffix=")" suffixOverrides=",">
30 #{obj.id},
31 #{obj.medSuppliercode},
32 #{obj.medSuppliername},
33 #{obj.goodsCode},
34 #{obj.goodsName},
35 #{obj.producer},
36 #{obj.goodsSpec},
37 #{obj.unitStyle},
38 #{obj.createTime},
39 #{obj.updateTime},
40 #{obj.price}
41 </trim>
42 </foreach>
43 </insert>
44
45 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>使用登记明细打印(普通A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${jgName}</h3></td>
13 <td width="12%" height="30" rowspan="4">${qrImage}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">使用清单号:${useNo}</td>
17 <td width="25%" height="30">送货单号:${sendNo}</td>
18 <td width="25%" height="30">供应商:${fOrgName}</td>
19 <td></td>
20 </tr>
21 <tr>
22 <td width="25%" height="30">登记科室:${deptName}</td>
23 <td width="25%" height="30">登记人:${createUserName}</td>
24 <td width="25%" height="30">登记时间:${createTime}</td>
25 <td></td>
26 </tr>
27 <tr>
28 <td width="25%" height="30">就诊号:${treatmentNo}</td>
29 <td width="25%" height="30">患者姓名:${hzName}</td>
30 <td width="25%" height="30">手术名称:${operName}</td>
31 <td></td>
32 </tr>
33 <tr>
34
35 </tr>
36 </table>
37 </div>
38 <div>
39 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
40 <tr style="height: 25px;">
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
42 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
43 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
44 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
45 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
46 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
47 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">价格</td>
48 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
49 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">金额</td>
50 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
51 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
52 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;" width="80;">有效期至</td>
53 </tr>
54 ${tableContent}
55 </table>
56 </div>
57 <div>
58 ${afterTable
59 <table width="80%" border="0" cellspacing="0" cellpadding="0">
60 <tr height="35px;">
61 <td width="30%" align="left">医生签字:</td>
62 <td width="20%" align="right">总金额:${zje}</td>
63 </tr>
64 </table>
65 }
66 </div>
67 </div>
68 </body>
69 </html>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.common.util;
2
3 import java.util.Date;
4
5 import com.google.gson.JsonDeserializationContext;
6 import com.google.gson.JsonDeserializer;
7 import com.google.gson.JsonElement;
8 import com.google.gson.JsonParseException;
9
10 public class JsonDateDeserializer implements JsonDeserializer<Date> {
11
12
13 public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context)
14 throws JsonParseException {
15 // TODO Auto-generated method stub
16 String s = json.getAsJsonPrimitive().getAsString();
17 long l = Long.parseLong(s);
18 Date d = new Date(l);
19 return d;
20 }
21 }
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>入库单打印(三联单)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}验收入库单</h3></td>
13 </tr>
14 </table>
15 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
16 <tr>
17 <td width="21%" height="15">供应商:${forgName}</td>
18 <td width="17%" height="15">入库日期:${inTime}</td>
19 <td width="26%" height="15">入库单号:${InNo}</td>
20 </tr>
21 <tr>
22 <td width="21%" height="15">发票号:${invoiceNo}</td>
23 <td width="17%" height="15">送货单号:${Send_Id}</td>
24 <td width="26%" height="15">单位:元</td>
25 </tr>
26 <tr>
27
28 </tr>
29 </table>
30 </div>
31 <div>
32 <table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
33 <tr style="height: 18px;">
34 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
35 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
36 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-right:1px solid #000000;border-top:1px solid #000000;" width="130">财务分类</td>
42 </tr>
43 ${tableContent}
44 </table>
45 </div>
46 <div>
47 ${afterTable
48 <table width="100%" border="0" cellspacing="0" cellpadding="0">
49 <tr height="20px;">
50 <td width="25%" align="left"></td>
51 <td width="25%" align="left"></td>
52 <td width="21%" align="left"></td>
53 <td width="28%" align="left">合计金额:${totalPrice}</td>
54 </tr>
55 <tr height="20px;">
56 <td width="25%" align="left">制单人:${userName}</td>
57 <td width="25%" align="left">会计:</td>
58 <td width="21%" align="left">审核人:</td>
59 <td width="28%" align="left">备注:</td>
60 </tr>
61 </table>
62 }
63 </div>
64 </div>
65 </body>
66 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3 <modelVersion>4.0.0</modelVersion>
4 <groupId>com.phxl</groupId>
5 <artifactId>medicinal-supplier</artifactId>
6 <packaging>war</packaging>
7 <version>1.0</version>
8 <name>medicinal-supplier</name>
9 <url>http://maven.apache.org</url>
10
11 <!-- 属性配置 -->
12 <properties>
13 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14 <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
15 <junit.version>4.8.1</junit.version>
16 <javax.servlet.version>1.2</javax.servlet.version>
17 <javax.servlet.api.version>2.5</javax.servlet.api.version>
18 <spring.version>4.1.1.RELEASE</spring.version>
19
20 <org.apache.commons.version>3.0</org.apache.commons.version>
21 <org.apache.xmlbeans.version>2.6.0</org.apache.xmlbeans.version>
22 <org.apache.poi.version>3.9</org.apache.poi.version>
23 <org.apache.poi.openxml4j.version>1.0-beta</org.apache.poi.openxml4j.version>
24
25 <com.fasterxml.jackson.version>2.8.4</com.fasterxml.jackson.version>
26 <com.itextpdf.version>5.5.7</com.itextpdf.version>
27 <com.itextpdf.itext-asian.version>5.2.0</com.itextpdf.itext-asian.version>
28 <com.aliyun.oss.version>2.2.3</com.aliyun.oss.version>
29 <com.google.gson.version>2.2.2</com.google.gson.version>
30 <com.google.zxing.version>3.2.1</com.google.zxing.version>
31 <com.thoughtworks.xstream.version>1.4.10</com.thoughtworks.xstream.version>
32 <commons-fileupload.version>1.3.1</commons-fileupload.version>
33 <dom4j.version>1.6.1</dom4j.version>
34 <qrcode.version>1.4</qrcode.version>
35 <eu.medsea.mimeutil.version>2.1.3</eu.medsea.mimeutil.version>
36 <mysql.driver.version>5.1.30</mysql.driver.version>
37 <mybatis.version>3.2.8</mybatis.version>
38 <mybatis-spring.version>1.2.3</mybatis-spring.version>
39 <cxf.version>2.2.3</cxf.version>
40
41 <!-- environment setting -->
42 <jdk.version>1.8</jdk.version>
43 <tomcat.version>2.2</tomcat.version>
44 <webserver.port>8888</webserver.port>
45 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46 <downloadSources>true</downloadSources>
47
48 <slf4j.version>1.7.7</slf4j.version>
49 <!-- logback setting -->
50 <ch.qos.logback.version>1.1.7</ch.qos.logback.version>
51 <org.slf4j.version>1.7.7</org.slf4j.version>
52 </properties>
53
54 <!-- 配置环境 -->
55 <profiles>
56 <profile>
57 <id>prod</id>
58 <!-- <activation>
59 <activeByDefault>true</activeByDefault>
60 </activation> -->
61 <properties>
62 <package.environment>prod</package.environment>
63 </properties>
64 </profile>
65 <profile>
66 <id>stg</id>
67 <properties>
68 <package.environment>stg</package.environment>
69 </properties>
70 </profile>
71 <profile>
72 <id>test</id>
73 <properties>
74 <package.environment>test</package.environment>
75 </properties>
76 </profile>
77 </profiles>
78
79 <dependencies>
80 <dependency>
81 <groupId>junit</groupId>
82 <artifactId>junit</artifactId>
83 <version>${junit.version}</version>
84 <scope>test</scope>
85 </dependency>
86
87 <!-- jackson -->
88 <dependency>
89 <groupId>com.fasterxml.jackson.core</groupId>
90 <artifactId>jackson-core</artifactId>
91 <version>${com.fasterxml.jackson.version}</version>
92 </dependency>
93 <dependency>
94 <groupId>com.fasterxml.jackson.core</groupId>
95 <artifactId>jackson-databind</artifactId>
96 <version>${com.fasterxml.jackson.version}</version>
97 </dependency>
98
99 <!-- spring -->
100 <dependency>
101 <groupId>org.springframework</groupId>
102 <artifactId>spring-aop</artifactId>
103 <version>${spring.version}</version>
104 <type>jar</type>
105 <scope>compile</scope>
106 </dependency>
107 <dependency>
108 <groupId>org.springframework</groupId>
109 <artifactId>spring-aspects</artifactId>
110 <version>${spring.version}</version>
111 <type>jar</type>
112 <scope>compile</scope>
113 </dependency>
114 <dependency>
115 <groupId>org.springframework</groupId>
116 <artifactId>spring-beans</artifactId>
117 <version>${spring.version}</version>
118 <type>jar</type>
119 <scope>compile</scope>
120 </dependency>
121 <dependency>
122 <groupId>org.springframework</groupId>
123 <artifactId>spring-context</artifactId>
124 <version>${spring.version}</version>
125 <type>jar</type>
126 <scope>compile</scope>
127 </dependency>
128 <dependency>
129 <groupId>org.springframework</groupId>
130 <artifactId>spring-context-support</artifactId>
131 <version>${spring.version}</version>
132 <type>jar</type>
133 <scope>compile</scope>
134 </dependency>
135 <dependency>
136 <groupId>org.springframework</groupId>
137 <artifactId>spring-core</artifactId>
138 <version>${spring.version}</version>
139 <type>jar</type>
140 <scope>compile</scope>
141 </dependency>
142 <dependency>
143 <groupId>org.springframework</groupId>
144 <artifactId>spring-expression</artifactId>
145 <version>${spring.version}</version>
146 <type>jar</type>
147 <scope>compile</scope>
148 </dependency>
149 <dependency>
150 <groupId>org.springframework</groupId>
151 <artifactId>spring-jdbc</artifactId>
152 <version>${spring.version}</version>
153 <type>jar</type>
154 <scope>compile</scope>
155 </dependency>
156 <dependency>
157 <groupId>org.springframework</groupId>
158 <artifactId>spring-jms</artifactId>
159 <version>${spring.version}</version>
160 <type>jar</type>
161 <scope>compile</scope>
162 </dependency>
163 <dependency>
164 <groupId>org.springframework</groupId>
165 <artifactId>spring-orm</artifactId>
166 <version>${spring.version}</version>
167 <type>jar</type>
168 <scope>compile</scope>
169 </dependency>
170 <dependency>
171 <groupId>org.springframework</groupId>
172 <artifactId>spring-oxm</artifactId>
173 <version>${spring.version}</version>
174 <type>jar</type>
175 <scope>compile</scope>
176 </dependency>
177 <dependency>
178 <groupId>org.springframework</groupId>
179 <artifactId>spring-tx</artifactId>
180 <version>${spring.version}</version>
181 <type>jar</type>
182 <scope>compile</scope>
183 </dependency>
184 <dependency>
185 <groupId>org.springframework</groupId>
186 <artifactId>spring-web</artifactId>
187 <version>${spring.version}</version>
188 <type>jar</type>
189 <scope>compile</scope>
190 </dependency>
191 <dependency>
192 <groupId>org.springframework</groupId>
193 <artifactId>spring-webmvc</artifactId>
194 <version>${spring.version}</version>
195 <type>jar</type>
196 <scope>compile</scope>
197 </dependency>
198 <dependency>
199 <groupId>org.springframework</groupId>
200 <artifactId>spring-test</artifactId>
201 <version>${spring.version}</version>
202 <type>jar</type>
203 <scope>compile</scope>
204 </dependency>
205
206 <dependency>
207 <groupId>javax.servlet</groupId>
208 <artifactId>jstl</artifactId>
209 <version>${javax.servlet.version}</version>
210 <type>jar</type>
211 <scope>compile</scope>
212 </dependency>
213
214 <dependency>
215 <groupId>com.aliyun.oss</groupId>
216 <artifactId>aliyun-sdk-oss</artifactId>
217 <version>${com.aliyun.oss.version}</version>
218 </dependency>
219
220 <dependency>
221 <groupId>javax.servlet</groupId>
222 <artifactId>servlet-api</artifactId>
223 <version>${javax.servlet.api.version}</version>
224 <scope>provided</scope>
225 </dependency>
226
227 <dependency>
228 <groupId>commons-fileupload</groupId>
229 <artifactId>commons-fileupload</artifactId>
230 <version>${commons-fileupload.version}</version>
231 </dependency>
232
233 <dependency>
234 <groupId>com.alibaba</groupId>
235 <artifactId>fastjson</artifactId>
236 <version>1.2.33</version>
237 </dependency>
238
239 <dependency>
240 <groupId>org.apache.commons</groupId>
241 <artifactId>commons-lang3</artifactId>
242 <version>${org.apache.commons.version}</version>
243 </dependency>
244
245 <dependency>
246 <groupId>eu.medsea.mimeutil</groupId>
247 <artifactId>mime-util</artifactId>
248 <version>${eu.medsea.mimeutil.version}</version>
249 </dependency>
250 <dependency>
251 <groupId>com.google.code.gson</groupId>
252 <artifactId>gson</artifactId>
253 <version>${com.google.gson.version}</version>
254 </dependency>
255
256
257 <!-- <dependency>
258 <groupId>javabuilder</groupId>
259 <artifactId>javabuilder_rt</artifactId>
260 <version>2.0</version>
261 <scope>system</scope>
262 <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/rt.jar</systemPath>
263 </dependency>
264
265
266 <dependency>
267 <groupId>javabuilder</groupId>
268 <artifactId>javabuilder11_jce</artifactId>
269 <version>0.0.1-SNAPSHOT</version>
270 <scope>system</scope>
271 <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jce.jar</systemPath>
272 </dependency> -->
273
274 <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
275 <dependency>
276 <groupId>com.thoughtworks.xstream</groupId>
277 <artifactId>xstream</artifactId>
278 <version>${com.thoughtworks.xstream.version}</version>
279 </dependency>
280
281 <!-- LOGGING begin -->
282 <dependency>
283 <groupId>org.slf4j</groupId>
284 <artifactId>slf4j-api</artifactId>
285 <version>${slf4j.version}</version>
286 </dependency>
287 <dependency>
288 <groupId>org.slf4j</groupId>
289 <artifactId>slf4j-log4j12</artifactId>
290 <version>${slf4j.version}</version>
291 </dependency>
292
293 <!-- logback -->
294 <dependency>
295 <groupId>org.slf4j</groupId>
296 <artifactId>slf4j-api</artifactId>
297 <version>${org.slf4j.version}</version>
298 </dependency>
299
300 <dependency>
301 <groupId>ch.qos.logback</groupId>
302 <artifactId>logback-core</artifactId>
303 <version>${ch.qos.logback.version}</version>
304 </dependency>
305 <dependency>
306 <groupId>ch.qos.logback</groupId>
307 <artifactId>logback-access</artifactId>
308 <version>${ch.qos.logback.version}</version>
309 </dependency>
310 <dependency>
311 <groupId>ch.qos.logback</groupId>
312 <artifactId>logback-classic</artifactId>
313 <version>${ch.qos.logback.version}</version>
314 </dependency>
315
316 <!-- Apache POI: start -->
317 <dependency>
318 <groupId>org.apache.poi</groupId>
319 <artifactId>poi</artifactId>
320 <version>${org.apache.poi.version}</version>
321 </dependency>
322
323 <dependency>
324 <groupId>org.apache.poi</groupId>
325 <artifactId>poi-ooxml</artifactId>
326 <version>${org.apache.poi.version}</version>
327 </dependency>
328 <dependency>
329 <groupId>org.apache.poi</groupId>
330 <artifactId>poi-excelant</artifactId>
331 <version>${org.apache.poi.version}</version>
332 </dependency>
333 <dependency>
334 <groupId>org.apache.poi</groupId>
335 <artifactId>poi-examples</artifactId>
336 <version>${org.apache.poi.version}</version>
337 </dependency>
338 <dependency>
339 <groupId>org.apache.poi</groupId>
340 <artifactId>poi-scratchpad</artifactId>
341 <version>${org.apache.poi.version}</version>
342 </dependency>
343 <dependency>
344 <groupId>org.apache.xmlbeans</groupId>
345 <artifactId>xmlbeans</artifactId>
346 <version>${org.apache.xmlbeans.version}</version>
347 </dependency>
348 <dependency>
349 <groupId>org.apache.poi</groupId>
350 <artifactId>openxml4j</artifactId>
351 <version>${org.apache.poi.openxml4j.version}</version>
352 </dependency>
353
354
355 <!-- itextpdf -->
356 <dependency>
357 <groupId>com.itextpdf</groupId>
358 <artifactId>itextpdf</artifactId>
359 <version>${com.itextpdf.version}</version>
360 </dependency>
361 <dependency>
362 <groupId>com.itextpdf</groupId>
363 <artifactId>itext-asian</artifactId>
364 <version>${com.itextpdf.itext-asian.version}</version>
365 </dependency>
366 <!-- Zxing -->
367 <dependency>
368 <groupId>com.google.zxing</groupId>
369 <artifactId>javase</artifactId>
370 <version>${com.google.zxing.version}</version>
371 </dependency>
372 <dependency>
373 <groupId>dom4j</groupId>
374 <artifactId>dom4j</artifactId>
375 <version>${dom4j.version}</version>
376 </dependency>
377
378 <!-- QRCode -->
379 <dependency>
380 <groupId>net.glxn</groupId>
381 <artifactId>qrgen</artifactId>
382 <version>${qrcode.version}</version>
383 </dependency>
384
385 <dependency>
386 <groupId>mysql</groupId>
387 <artifactId>mysql-connector-java</artifactId>
388 <version>${mysql.driver.version}</version>
389 <scope>runtime</scope>
390 </dependency>
391
392 <!-- MyBatis -->
393 <dependency>
394 <groupId>org.mybatis</groupId>
395 <artifactId>mybatis</artifactId>
396 <version>${mybatis.version}</version>
397 </dependency>
398 <dependency>
399 <groupId>org.mybatis</groupId>
400 <artifactId>mybatis-spring</artifactId>
401 <version>${mybatis-spring.version}</version>
402 </dependency>
403
404
405
406 <dependency>
407 <groupId>junit</groupId>
408 <artifactId>junit</artifactId>
409 <version>4.7</version>
410 </dependency>
411
412 </dependencies>
413
414
415 <!--构建设置 -->
416 <build>
417 <finalName>${project.artifactId}</finalName>
418 <resources>
419 <resource>
420 <directory>src/main/resources</directory>
421 <filtering>true</filtering>
422 <includes>
423 <include>**/*.*</include>
424 </includes>
425 </resource>
426 <resource>
427 <directory>src/main/java</directory>
428 <includes>
429 <include>**/*.xml</include>
430 </includes>
431 <filtering>true</filtering>
432 </resource>
433 <resource>
434 <directory>conf/${package.environment}</directory>
435 <filtering>true</filtering>
436 <includes>
437 <include>*.*</include>
438 </includes>
439 </resource>
440 </resources>
441 <plugins>
442
443 <!-- insert jetty class(compiler) -->
444 <!-- 指定war包的执行入口-->
445 <plugin>
446 <groupId>org.apache.maven.plugins</groupId>
447 <artifactId>maven-war-plugin</artifactId>
448 <version>2.3</version>
449 <configuration>
450 <archive>
451 <manifest>
452 <mainClass>Runner</mainClass>
453 </manifest>
454 </archive>
455 </configuration>
456 </plugin>
457 <plugin>
458 <groupId>org.apache.maven.plugins</groupId>
459 <artifactId>maven-war-plugin</artifactId>
460 <configuration>
461 <failOnMissingWebXml>false</failOnMissingWebXml>
462 </configuration>
463 </plugin>
464 <!-- 将Runner移动到Meta-info下面-->
465 <plugin>
466 <groupId>org.apache.maven.plugins</groupId>
467 <artifactId>maven-antrun-plugin</artifactId>
468 <version>1.7</version>
469 <executions>
470 <execution>
471 <id>main-class-placement</id>
472 <phase>prepare-package</phase>
473 <configuration>
474 <target>
475 <move todir="${project.build.directory}/${project.artifactId}-${project.version}-${package.environment}/">
476 <fileset dir="${project.build.directory}/classes/">
477 <include name="Runner.class" />
478 </fileset>
479 </move>
480 </target>
481 </configuration>
482 <goals>
483 <goal>run</goal>
484 </goals>
485 </execution>
486 </executions>
487 </plugin>
488
489
490 <plugin>
491 <groupId>org.apache.maven.plugins</groupId>
492 <artifactId>maven-compiler-plugin</artifactId>
493 <configuration>
494 <source>1.6</source>
495 <target>1.6</target>
496 <encoding>UTF-8</encoding>
497 <compilerArguments>
498 <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
499 </compilerArguments>
500 </configuration>
501 </plugin>
502
503 <!-- <plugin>
504 <artifactId>maven-compiler-plugin</artifactId>
505 <version>2.3.2</version>
506 <configuration>
507 <source>1.6</source>
508 <target>1.6</target>
509 <encoding>UTF-8</encoding>
510 <optimize>true</optimize>
511 <debug>true</debug>
512 <showDeprecation>true</showDeprecation>
513 <showWarnings>false</showWarnings>
514 <compilerArguments>
515 <verbose />
516 <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
517 </compilerArguments>
518 </configuration>
519 </plugin> -->
520
521 <!-- tomcat7插件 -->
522 <plugin>
523 <groupId>org.apache.tomcat.maven</groupId>
524 <artifactId>tomcat7-maven-plugin</artifactId>
525 <version>${tomcat.version}</version>
526 <configuration>
527 <port>${webserver.port}</port>
528 <path>/${project.artifactId}</path>
529 <uriEncoding>${project.build.sourceEncoding}</uriEncoding>
530 </configuration>
531 </plugin>
532 </plugins>
533 </build>
534 </project>
1 package com.phxl.modules.goods.dao.medinstore;
2
3 import java.util.List;
4
5 import com.phxl.modules.goods.entity.medinstore.MedInStoreDetail;
6
7 public interface MedInStoreDetailDao {
8
9 void batchInsert(List<MedInStoreDetail> details);
10
11 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <projectDescription>
3 <name>medicinal-supplier</name>
4 <comment></comment>
5 <projects>
6 </projects>
7 <buildSpec>
8 <buildCommand>
9 <name>org.eclipse.jdt.core.javabuilder</name>
10 <arguments>
11 </arguments>
12 </buildCommand>
13 <buildCommand>
14 <name>org.eclipse.wst.common.project.facet.core.builder</name>
15 <arguments>
16 </arguments>
17 </buildCommand>
18 <buildCommand>
19 <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments>
21 </arguments>
22 </buildCommand>
23 <buildCommand>
24 <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments>
26 </arguments>
27 </buildCommand>
28 </buildSpec>
29 <natures>
30 <nature>org.eclipse.jdt.core.javanature</nature>
31 <nature>org.eclipse.m2e.core.maven2Nature</nature>
32 <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
33 <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
34 </natures>
35 </projectDescription>
1 package com.phxl.modules.goods.service.suoutstore;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5 import java.util.List;
6
7 import org.apache.commons.lang3.StringUtils;
8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service;
12
13 import com.phxl.common.utils.BaseException;
14 import com.phxl.common.utils.IdUtil;
15 import com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao;
16 import com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao;
17 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
18 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail;
19 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
20
21 @Service
22 public class SuOutStoreService {
23
24 @Autowired
25 private SuOutStoreDao suOutStoreDao;
26
27 @Autowired
28 private SuOutStoreDetailDao suOutStoreDetailDao;
29
30 /**
31 * 日志对象
32 */
33 protected Logger logger = LoggerFactory.getLogger(getClass());
34
35
36 public boolean batchSave(List<SuOutStoreWithDetail> suOutStoreWithDetailList) {
37 boolean result = true;
38 try {
39 checkSuOutStore(suOutStoreWithDetailList);
40 } catch (Exception e) {
41 throw new BaseException("前置机:"+e.getMessage());
42 }
43 for (SuOutStoreWithDetail suOutStore : suOutStoreWithDetailList) {
44 List<SuOutStoreDetail> details = suOutStore.getBill().getBilldetaillist();
45 String id = IdUtil.uuid();
46 SuOutStore su = suOutStore.getBill();
47 su.setId(id);
48 if(details != null && details.size() != 0){
49 for (SuOutStoreDetail suOutStoreDetail : details) {
50 suOutStoreDetail.setBillNo(suOutStore.getBill().getBillNo());
51 suOutStoreDetail.setId(id);
52 }
53 suOutStoreDao.insert(su);
54 suOutStoreDetailDao.batchInsert(details);
55 }
56 }
57 return result;
58 }
59
60
61 private void checkSuOutStore(List<SuOutStoreWithDetail> suOutStoreWithDetailsList) {
62 if(suOutStoreWithDetailsList == null || suOutStoreWithDetailsList.size() == 0){
63 logger.error("前置机:无相应供应商出库单据信息");
64 throw new BaseException("前置机:无相应供应商出库单据信息");
65 }
66 for (SuOutStoreWithDetail suOutStoreWithDetails : suOutStoreWithDetailsList) {
67 String billNo = suOutStoreWithDetails.getBill().getBillNo();
68 if (StringUtils.isEmpty(billNo)) {
69 logger.error("前置机:供应商出库单单据编号不能为空");
70 throw new BaseException("前置机:供应商出库单单据编号不能为空");
71 }
72 String medGuid = suOutStoreWithDetails.getBill().getMedGuid();
73 String medName = suOutStoreWithDetails.getBill().getMedName();
74 if (StringUtils.isEmpty(medGuid) || StringUtils.isEmpty(medName)) {
75 logger.error("前置机:供应商出库单单据编号:"+billNo+"医疗机构代码以及医疗机构名称不能为空");
76 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"医疗机构代码以及医疗机构名称不能为空");
77 }
78 List<SuOutStoreDetail> details = suOutStoreWithDetails.getBill().getBilldetaillist();
79 if(details == null || details.size() == 0){
80 logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细不能为空");
81 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细不能为空");
82 }
83 for (SuOutStoreDetail suOutStoreDetail : details) {
84 String detailBillNo = suOutStoreDetail.getBillNo();
85 if (StringUtils.isEmpty(detailBillNo)) {
86 logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细单据编号不能为空");
87 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细单据编号不能为空");
88 }
89 int rowNo = suOutStoreDetail.getRowNo();
90 if (rowNo == 0) {
91 logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细行号不能为空");
92 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细行号不能为空");
93 }
94 int medPlanRowNo = suOutStoreDetail.getMedPlanRowNo();
95 if (medPlanRowNo == 0) {
96 logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细补货计划单据原行号不能为空");
97 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细补货计划单据原行号不能为空");
98 }
99 String goodsGuid = suOutStoreDetail.getGoodsGuid();
100 String goodsName = suOutStoreDetail.getGoodsName();
101 if (StringUtils.isEmpty(goodsGuid) || StringUtils.isEmpty(goodsName)) {
102 logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品编码以及商品名称不能为空");
103 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品编码以及商品名称不能为空");
104 }
105 String goodsSpec = suOutStoreDetail.getGoodsSpec();
106 if (StringUtils.isEmpty(goodsSpec)) {
107 logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品规格不能为空");
108 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品规格不能为空");
109 }
110 String lot = suOutStoreDetail.getLot();
111 if (StringUtils.isEmpty(lot)) {
112 logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细批号不能为空");
113 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细批号不能为空");
114 }
115 Date productionDate = suOutStoreDetail.getProductionDate();
116 Date expireDate = suOutStoreDetail.getExpireDate();
117 if (productionDate == null || expireDate == null) {
118 logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细生产日期以及有效期不能为空");
119 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细生产日期以及有效期不能为空");
120 }
121 BigDecimal arrivalqty = suOutStoreDetail.getArrivalqty();
122 if (arrivalqty == null) {
123 logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细出库数不能为空");
124 throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细出库数不能为空");
125 }
126 }
127
128 }
129
130 }
131
132 }
1 package com.phxl.modules.goods.service.invoiceback;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5 import java.util.List;
6
7 import org.apache.commons.lang3.StringUtils;
8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Service;
12
13 import com.phxl.common.utils.BaseException;
14 import com.phxl.common.utils.IdUtil;
15 import com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao;
16 import com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao;
17 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
18 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail;
19 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
20
21 @Service
22 public class SuInvoiceBackService {
23
24 @Autowired
25 private SuInvoiceBackDao invoiceBackDao;
26
27 @Autowired
28 private SuInvoiceBackDetailDao invoiceBackDetailDao;
29
30 /**
31 * 日志对象
32 */
33 protected Logger logger = LoggerFactory.getLogger(getClass());
34
35
36 public boolean batchSaveOrUpdate(List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList) {
37 boolean result = true;
38 try {
39 checkSuInvoiceBack(suInvoiceBackWithDetailList);
40 } catch (Exception e) {
41 throw new BaseException(e.getMessage());
42 }
43 for (SuInvoiceBackWithDetail suInvoiceBackWithDetail : suInvoiceBackWithDetailList) {
44 SuInvoiceBack suInvoiceBack = suInvoiceBackWithDetail.getBill();
45 List<SuInvoiceBackDetail> backDetails = suInvoiceBack.getBilldetaillist();
46 String id = IdUtil.uuid();
47 suInvoiceBack.setId(id);
48 if(backDetails != null &&backDetails.size() != 0){
49 for (SuInvoiceBackDetail suInvoiceBackDetail : backDetails) {
50 suInvoiceBackDetail.setSettleBillNo(suInvoiceBack.getSettleBillNo());
51 suInvoiceBackDetail.setId(id);
52 }
53 invoiceBackDao.insert(suInvoiceBack);
54 invoiceBackDetailDao.batchInsert(backDetails);
55 }
56 }
57 return result;
58 }
59
60 private void checkSuInvoiceBack(List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList) {
61 if(suInvoiceBackWithDetailList == null || suInvoiceBackWithDetailList.size() == 0){
62 logger.error("无相应供应商回传发票信息");
63 throw new BaseException("无相应供应商回传发票信息");
64 }
65 for (SuInvoiceBackWithDetail suInvoiceBackWithDetail : suInvoiceBackWithDetailList) {
66 SuInvoiceBack suInvoiceBack = suInvoiceBackWithDetail.getBill();
67 String settleBillNo = suInvoiceBack.getSettleBillNo();
68 if (StringUtils.isEmpty(settleBillNo)) {
69 logger.error("供应商回传发票结算单号不能为空");
70 throw new BaseException("供应商回传发票结算单号不能为空");
71 }
72 Date settleDate = suInvoiceBack.getSettleDate();
73 if (settleDate == null) {
74 logger.error("供应商回传发票结算单号:"+settleBillNo+"结算单日期不能为空");
75 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"结算单日期不能为空");
76 }
77 List<SuInvoiceBackDetail> backDetails = suInvoiceBack.getBilldetaillist();
78 if(backDetails == null || backDetails.size() == 0){
79 logger.error("供应商回传发票结算单号:"+settleBillNo+"回传发票明细不能为空");
80 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细不能为空");
81 }
82 for (SuInvoiceBackDetail suInvoiceBackDetail : backDetails) {
83 String detailSettleBillNo = suInvoiceBackDetail.getSettleBillNo();
84 if (StringUtils.isEmpty(detailSettleBillNo)) {
85 logger.error("供应商回传发票结算单号:"+settleBillNo+"回传发票明细结算单号不能为空");
86 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细结算单号不能为空");
87 }
88 int rowNo = suInvoiceBackDetail.getRowNo();
89 if (rowNo == 0) {
90 logger.error("供应商回传发票结算单号:"+settleBillNo+"回传发票明细行号不能为空");
91 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细行号不能为空");
92 }
93 String goodsCode = suInvoiceBackDetail.getGoodsCode();
94 if (StringUtils.isEmpty(goodsCode)) {
95 logger.error("供应商回传发票结算单号:"+settleBillNo+",行号:"+rowNo+"回传发票明细商品编码不能为空");
96 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细商品编码不能为空");
97 }
98 String unit = suInvoiceBackDetail.getUnit();
99 if (StringUtils.isEmpty(unit)) {
100 logger.error("供应商回传发票结算单号:"+settleBillNo+",行号:"+rowNo+"回传发票明细包装单位不能为空");
101 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细包装单位不能为空");
102 }
103 BigDecimal settleQty = suInvoiceBackDetail.getSettleQty();
104 if (settleQty == null) {
105 logger.error("供应商回传发票结算单号:"+settleBillNo+",行号:"+rowNo+"回传发票明细结算数量不能为空");
106 throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细结算数量不能为空");
107 }
108 }
109 }
110
111 }
112
113 }
1 package com.phxl.common.filter;
2
3 import java.io.IOException;
4
5 import javax.servlet.Filter;
6 import javax.servlet.FilterChain;
7 import javax.servlet.FilterConfig;
8 import javax.servlet.ServletException;
9 import javax.servlet.ServletRequest;
10 import javax.servlet.ServletResponse;
11 import javax.servlet.http.HttpServletResponse;
12
13 public class SimpleCORSFilter implements Filter {
14
15 public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
16 HttpServletResponse response = (HttpServletResponse) res;
17 response.setHeader("Access-Control-Allow-Origin", "*");
18 response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
19 response.setHeader("Access-Control-Max-Age", "3600");
20 response.setHeader("Access-Control-Allow-Headers", "x-requested-with");
21 chain.doFilter(req, res);
22 }
23 public void init(FilterConfig filterConfig) {}
24 public void destroy() {}
25 }
26
1 package com.phxl.modules.goods.entity.supplygoods;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 /**
7 * 医院采购目录
8 */
9
10 public class MedSupplyGoods{
11
12 private String medSuppliercode; //供应商代码
13 public BigDecimal getPrice() {
14 return price;
15 }
16 public void setPrice(BigDecimal price) {
17 this.price = price;
18 }
19 private String medSuppliername; //供应商名称
20 private String goodsCode; //HIS商品编码
21 private String goodsName; //商品名称
22 private String producer; //生产厂商
23 private String goodsSpec; //规格
24 private String unitStyle; //计量单位
25 private Date createTime; //创建时间
26 private Date updateTime; //更新时间
27 private BigDecimal price; //采购价
28
29 private String id;
30
31 public String getId() {
32 return id;
33 }
34 public void setId(String id) {
35 this.id = id;
36 }
37
38 public String getMedSuppliercode() {
39 return medSuppliercode;
40 }
41 public void setMedSuppliercode(String medSuppliercode) {
42 this.medSuppliercode = medSuppliercode;
43 }
44 public String getMedSuppliername() {
45 return medSuppliername;
46 }
47 public void setMedSuppliername(String medSuppliername) {
48 this.medSuppliername = medSuppliername;
49 }
50 public String getGoodsCode() {
51 return goodsCode;
52 }
53 public void setGoodsCode(String goodsCode) {
54 this.goodsCode = goodsCode;
55 }
56 public String getGoodsName() {
57 return goodsName;
58 }
59 public void setGoodsName(String goodsName) {
60 this.goodsName = goodsName;
61 }
62 public String getProducer() {
63 return producer;
64 }
65 public void setProducer(String producer) {
66 this.producer = producer;
67 }
68 public String getGoodsSpec() {
69 return goodsSpec;
70 }
71 public void setGoodsSpec(String goodsSpec) {
72 this.goodsSpec = goodsSpec;
73 }
74 public String getUnitStyle() {
75 return unitStyle;
76 }
77 public void setUnitStyle(String unitStyle) {
78 this.unitStyle = unitStyle;
79 }
80 public Date getCreateTime() {
81 return createTime;
82 }
83 public void setCreateTime(Date createTime) {
84 this.createTime = createTime;
85 }
86 public Date getUpdateTime() {
87 return updateTime;
88 }
89 public void setUpdateTime(Date updateTime) {
90 this.updateTime = updateTime;
91 }
92
93 }
1 /**
2 * Copyright (c) 2005-2011 springside.org.cn
3 *
4 * $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
5 */
6 package com.phxl.common.util;
7
8 import java.io.IOException;
9 import java.io.InputStream;
10 import java.util.NoSuchElementException;
11 import java.util.Properties;
12
13 import org.apache.commons.io.IOUtils;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16 import org.springframework.core.io.DefaultResourceLoader;
17 import org.springframework.core.io.Resource;
18 import org.springframework.core.io.ResourceLoader;
19
20 /**
21 * Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
22 * @author calvin
23 * @version 2013-05-15
24 */
25 public class PropertiesLoader {
26
27 private static Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
28
29 private static ResourceLoader resourceLoader = new DefaultResourceLoader();
30
31 private final Properties properties;
32
33 public PropertiesLoader(String... resourcesPaths) {
34 properties = loadProperties(resourcesPaths);
35 }
36
37 public Properties getProperties() {
38 return properties;
39 }
40
41 /**
42 * 取出Property,但以System的Property优先,取不到返回空字符串.
43 */
44 private String getValue(String key) {
45 String systemProperty = System.getProperty(key);
46 if (systemProperty != null) {
47 return systemProperty;
48 }
49 if (properties.containsKey(key)) {
50 return properties.getProperty(key);
51 }
52 return "";
53 }
54
55 /**
56 * 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
57 */
58 public String getProperty(String key) {
59 String value = getValue(key);
60 if (value == null) {
61 throw new NoSuchElementException();
62 }
63 return value;
64 }
65
66 /**
67 * 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
68 */
69 public String getProperty(String key, String defaultValue) {
70 String value = getValue(key);
71 return value != null ? value : defaultValue;
72 }
73
74 /**
75 * 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
76 */
77 public Integer getInteger(String key) {
78 String value = getValue(key);
79 if (value == null) {
80 throw new NoSuchElementException();
81 }
82 return Integer.valueOf(value);
83 }
84
85 /**
86 * 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
87 */
88 public Integer getInteger(String key, Integer defaultValue) {
89 String value = getValue(key);
90 return value != null ? Integer.valueOf(value) : defaultValue;
91 }
92
93 /**
94 * 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
95 */
96 public Double getDouble(String key) {
97 String value = getValue(key);
98 if (value == null) {
99 throw new NoSuchElementException();
100 }
101 return Double.valueOf(value);
102 }
103
104 /**
105 * 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
106 */
107 public Double getDouble(String key, Integer defaultValue) {
108 String value = getValue(key);
109 return value != null ? Double.valueOf(value) : defaultValue;
110 }
111
112 /**
113 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/false则返回false.
114 */
115 public Boolean getBoolean(String key) {
116 String value = getValue(key);
117 if (value == null) {
118 throw new NoSuchElementException();
119 }
120 return Boolean.valueOf(value);
121 }
122
123 /**
124 * 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/false则返回false.
125 */
126 public Boolean getBoolean(String key, boolean defaultValue) {
127 String value = getValue(key);
128 return value != null ? Boolean.valueOf(value) : defaultValue;
129 }
130
131 /**
132 * 载入多个文件, 文件路径使用Spring Resource格式.
133 */
134 private Properties loadProperties(String... resourcesPaths) {
135 Properties props = new Properties();
136
137 for (String location : resourcesPaths) {
138
139 // logger.debug("Loading properties file from:" + location);
140
141 InputStream is = null;
142 try {
143 Resource resource = resourceLoader.getResource(location);
144 is = resource.getInputStream();
145 props.load(is);
146 } catch (IOException ex) {
147 logger.info("Could not load properties from path:" + location + ", " + ex.getMessage());
148 } finally {
149 IOUtils.closeQuietly(is);
150 }
151 }
152 return props;
153 }
154 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.supplierstock.SupplierStockDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="supplier_code" property="suppliercode" jdbcType="VARCHAR" />
10 <result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
15 <result column="lot" property="lot" jdbcType="VARCHAR" />
16 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
17 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
18 <result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
19 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
20 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
21 </resultMap>
22
23 <!--Base_Column_List -->
24 <sql id="Base_Column_List">id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time</sql>
25
26
27 <!--批量插入 -->
28 <insert id="batchInsert" parameterType="list">
29 insert into med_supplier_stock (id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time)
30 values
31 <foreach collection ="list" item="obj" separator =",">
32 <trim prefix=" (" suffix=")" suffixOverrides=",">
33 #{obj.id},
34 #{obj.suppliercode},
35 #{obj.suppliername},
36 #{obj.goodsCode},
37 #{obj.goodsName},
38 #{obj.goodsSpec},
39 #{obj.manufacturer},
40 #{obj.lot},
41 #{obj.productionDate},
42 #{obj.expireDate},
43 #{obj.stockQty},
44 #{obj.createTime},
45 #{obj.updateTime}
46 </trim>
47 </foreach>
48 </insert>
49 <!-- 新增SupplierStock-->
50 <insert id="insert" parameterType="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
51 insert into med_supplier_stock (id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time)
52 values (
53 #{id,jdbcType=VARCHAR}
54 ,#{suppliercode,jdbcType=VARCHAR}
55 ,#{suppliername,jdbcType=VARCHAR}
56 ,#{goodsCode,jdbcType=VARCHAR}
57 ,#{goodsName,jdbcType=VARCHAR}
58 ,#{goodsSpec,jdbcType=TIMESTAMP}
59 ,#{manufacturer,jdbcType=VARCHAR}
60 ,#{lot,jdbcType=VARCHAR}
61 ,#{productionDate,jdbcType=TIMESTAMP}
62 ,#{expireDate,jdbcType=TIMESTAMP}
63 ,#{stockQty,jdbcType=DECIMAL}
64 ,#{createTime,jdbcType=TIMESTAMP}
65 ,#{updateTime,jdbcType=TIMESTAMP}
66 )
67 </insert>
68
69 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 jdbc.type=mysql
2 jdbc.driver=com.mysql.jdbc.Driver
3 jdbc.url=jdbc:mysql://10.146.8.221:3306/medicinal-supplier-T?useUnicode=true&characterEncoding=utf-8
4 jdbc.username=root
5 jdbc.password=Test190326
6
7 spd_service_url = http://10.146.8.221:9002/medicinal-web/a/spdrecvsupplier/
8
9 huarun_service_url = http://61.190.54.189:8005/huarun/spd/syn/
1 package com.phxl.common.util;
2
3 import java.text.ParseException;
4 import java.text.SimpleDateFormat;
5 import java.util.Calendar;
6 import java.util.Date;
7 import java.util.Locale;
8
9 import org.apache.commons.lang.StringUtils;
10
11 public class DateUtils {
12
13 public static Calendar cal = Calendar.getInstance();
14 public static final String DATE_FORMAT = "yyyy-MM-dd";
15 public static final String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
16
17 /**
18 * 返回指定格式的字符串日期
19 *
20 * @param date
21 * 日期 允许NULL,为NULL时返回空字符
22 * @param format
23 * 返回的字符串日期格式
24 * @return
25 */
26 public static String DateToStr(Date date, String format) {
27 String dateStr = null;
28 if (date != null) {
29 SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
30 dateStr = simpleDateFormat.format(date);
31 }
32 return dateStr;
33 }
34
35 /**
36 * 日期转换为时间
37 *
38 * @param date
39 * @return
40 */
41 public static Long toLong(Date date) {
42 String dateStr = DateToStr(date, "yyyyMMdd");
43 return new Long(dateStr);
44 }
45
46 public static Integer toInteger(Date date) {
47 String dateStr = DateToStr(date, "yyyyMMdd");
48 return new Integer(dateStr);
49 }
50
51 public static String IntegerToStr(Integer dateInteger, String oldFormat,
52 String newFormat) {
53 String dateStr = null;
54 try {
55 Date date = convertDate(dateInteger.toString(), oldFormat);
56 dateStr = DateToStr(date, newFormat);
57 } catch (ParseException e) {
58 e.printStackTrace();
59 }
60 return dateStr;
61 }
62
63 public static Integer strDateToIntegerDate(String start, String oldFormat,
64 String newFormat) {
65 String dateStr = null;
66 try {
67 Date date = convertDate(start, oldFormat);
68 dateStr = DateToStr(date, newFormat);
69 } catch (ParseException e) {
70
71 e.printStackTrace();
72 }
73 return new Integer(dateStr);
74 }
75
76 /**
77 * 将英文格式的时间字符串转换为中文格式
78 *
79 * @param enDateStr
80 * @param format
81 * @return
82 */
83 public static String enDateStrToZhDateStr(String enDateStr, String format) {
84 SimpleDateFormat sdf = new SimpleDateFormat(
85 "EEE MMM d HH:mm:ss Z SSS yyyy", Locale.US);
86 Date date = null;
87 try {
88 date = sdf.parse(enDateStr);
89 } catch (ParseException e) {
90 e.printStackTrace();
91 }
92 String dateStr = DateUtils.DateToStr(date, format);
93 return dateStr;
94 }
95
96 /**
97 * 根据字符串返回指定格式的日期
98 *
99 * @param dateStr
100 * 日期(字符串)
101 * @param format
102 * 日期格式
103 * @return 日期(Date)
104 * @throws ParseException
105 */
106 public static Date convertDate(String dateStr, String format)
107 throws ParseException {
108 java.util.Date date = null;
109 SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
110 date = simpleDateFormat.parse(dateStr);
111 return date;
112 }
113
114 public static String format(String dateStr, String format)
115 throws ParseException {
116 Date date = convertDate(dateStr, format);
117 return DateToStr(date, format);
118 }
119
120 /**
121 * 小时的变动
122 *
123 * @param hour
124 * @return
125 */
126 public static Date minuteChange(Date date, Integer minute) {
127 java.util.Calendar calendar = java.util.Calendar.getInstance();
128 calendar.setTime(date);
129 calendar.add(java.util.Calendar.MINUTE, minute);
130 return calendar.getTime();
131 }
132
133 /**
134 * 小时的变动
135 *
136 * @param hour
137 * @return
138 */
139 public static Date hourChange(Date date, Integer hour) {
140 java.util.Calendar calendar = java.util.Calendar.getInstance();
141 calendar.setTime(date);
142 calendar.add(java.util.Calendar.HOUR_OF_DAY, hour);
143 return calendar.getTime();
144 }
145
146 /**
147 * 天的变动
148 *
149 * @param hour
150 * @return
151 */
152 public static Date dayChange(Date date, Integer day) {
153 java.util.Calendar calendar = java.util.Calendar.getInstance();
154 calendar.setTime(date);
155 calendar.add(java.util.Calendar.DAY_OF_WEEK, day);
156 return calendar.getTime();
157 }
158
159 /**
160 * 月的变动
161 *
162 * @param hour
163 * @return
164 */
165 public static Date monthChange(Date date, Integer month) {
166 java.util.Calendar calendar = java.util.Calendar.getInstance();
167 calendar.setTime(date);
168 calendar.add(java.util.Calendar.MONTH, month);
169 return calendar.getTime();
170 }
171
172 /**
173 * 年的变动
174 *
175 * @param hour
176 * @return
177 */
178 public static Date yearChange(Date date, Integer year) {
179 java.util.Calendar calendar = java.util.Calendar.getInstance();
180 calendar.setTime(date);
181 calendar.add(java.util.Calendar.YEAR, year);
182 return calendar.getTime();
183 }
184
185 /**
186 * 获取年
187 *
188 * @param date
189 * @return
190 */
191 public static Integer getYear(Date date) {
192 if (null == date) {
193 return null;
194 }
195 java.util.Calendar calendar = java.util.Calendar.getInstance();
196 calendar.setTime(date);
197 return calendar.get(Calendar.YEAR);
198 }
199
200 /**
201 * 获取月
202 *
203 * @param date
204 * @return
205 */
206 public static Integer getMonth(Date date) {
207 if (null == date) {
208 return null;
209 }
210 java.util.Calendar calendar = java.util.Calendar.getInstance();
211 calendar.setTime(date);
212 return calendar.get(Calendar.MONTH) + 1;
213 }
214
215 /**
216 * 获取日
217 *
218 * @param date
219 * @return
220 */
221 public static Integer getDay(Date date) {
222 if (null == date) {
223 return null;
224 }
225 java.util.Calendar calendar = java.util.Calendar.getInstance();
226 calendar.setTime(date);
227 return calendar.get(Calendar.DATE);
228 }
229
230 /**
231 * 设置日
232 *
233 * @param date
234 * @return
235 */
236 public static Date setDay(Date date, Integer day) {
237 if (null == date) {
238 return null;
239 }
240 cal.setTime(date);
241 cal.set(Calendar.DATE, day);
242 return cal.getTime();
243 }
244
245 /**
246 * @param date1
247 * 需要比较的时间 不能为空(null),需要正确的日期格式
248 * @param date2
249 * 被比较的时间 为空(null)则为当前时间
250 * @param stype
251 * 返回值类型 0为多少天,1为多少个月,2为多少年
252 * @return
253 */
254 public static Integer compareDate(String date1, String date2, int stype) {
255 if (null == date1) {
256 return null;
257 }
258 date2 = date2 == null ? DateUtils.getCurrentDate() : date2;
259 int n = 0;
260 Calendar c1 = Calendar.getInstance();
261 Calendar c2 = Calendar.getInstance();
262 try {
263 c1.setTime(DateUtils.convertDate(date1, DATE_FORMAT));
264 c2.setTime(DateUtils.convertDate(date2, DATE_FORMAT));
265 } catch (Exception e) {
266 e.printStackTrace();
267 }
268 while (!c1.after(c2)) { // 循环对比,直到相等,n 就是所要的结果
269 n++;
270 if (stype == 1) {
271 c1.add(Calendar.MONTH, 1); // 比较月份,月份+1
272 } else {
273 c1.add(Calendar.DATE, 1); // 比较天数,日期+1
274 }
275 }
276
277 n = n - 1;
278
279 if (stype == 2) {
280 n = n / 365;
281 }
282 return n;
283 }
284
285 /**
286 * 得到当前日期
287 *
288 * @return
289 */
290 public static String getCurrentDate() {
291 Calendar c = Calendar.getInstance();
292 Date date = c.getTime();
293 SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd");
294 return simple.format(date);
295
296 }
297
298 /**
299 * 取得两个时间之间相差的天数
300 *
301 * @param d1
302 * @param d2
303 * @return
304 */
305 public static int getIntervalDays(Date d1, Date d2) {
306 Calendar c1 = Calendar.getInstance();
307 Calendar c2 = Calendar.getInstance();
308 c1.setTime(d1);
309 c2.setTime(d2);
310 if (c1.after(c2)) {
311 Calendar cal = c1;
312 c1 = c2;
313 c2 = cal;
314 }
315 long sl = c1.getTimeInMillis();
316 long el = c2.getTimeInMillis();
317 long ei = el - sl;
318 return (int) (ei / (1000 * 60 * 60 * 24));
319 }
320
321 /**
322 * 取得两个时间之间相差的年数
323 *
324 * @param d1
325 * @param d2
326 * @return
327 */
328 public static Double getIntervalYears(Date d1, Date d2) {
329 Calendar c1 = Calendar.getInstance();
330 Calendar c2 = Calendar.getInstance();
331 c1.setTime(d1);
332 c2.setTime(d2);
333 if (c1.after(c2)) {
334 Calendar cal = c1;
335 c1 = c2;
336 c2 = cal;
337 }
338 long sl = c1.getTimeInMillis();
339 long el = c2.getTimeInMillis();
340 long ei = el - sl;
341 return (ei / (1000 * 60 * 60 * 24 * 365 * 1.0));
342 }
343
344 /**
345 * 转换字符串为日期类型(固定格式) eg: 2011-7-7(2009-11-20)
346 *
347 * @param dateStr
348 */
349 public static Date coalitionDateStr2(String dateStr, String fgf) {
350 String aaa = dateStr;
351 if (StringUtils.isNotBlank(dateStr)) {
352 String[] mry = dateStr.split(fgf);
353 String y = mry[0];
354 String m = mry[1];
355 String d = mry[2];
356 if (Integer.parseInt(m) < 10) {
357 m = "0" + m;
358 }
359 if (Integer.parseInt(d) < 10) {
360 d = "0" + d;
361 }
362 aaa = y + m + d;
363 }
364 java.util.Date date = null;
365 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
366 try {
367 date = simpleDateFormat.parse(aaa);
368 } catch (ParseException e) {
369 // TODO Auto-generated catch block
370 e.printStackTrace();
371 }
372 // System.out.println(date.toString());
373 return date;
374 }
375
376 /**
377 * 转换字符串为日期类型(固定格式) eg: 01-1月 -00 12.00.00.000000000 上午(01-11月-00
378 * 12.00.00.000000000 上午)
379 *
380 * @param dateStr
381 */
382 public static Date coalitionDateStr(String dateStr) {
383 String aaa = dateStr;
384 if (StringUtils.isNotBlank(dateStr)) {
385 String[] muStr = dateStr.split(" ");
386 if (muStr.length > 3) {
387 muStr[0] = muStr[0] + muStr[1];
388 muStr[1] = muStr[2];
389 muStr[2] = muStr[3];
390 }
391 String[] mry = muStr[0].split("-");
392 String d = mry[0];
393 String m = mry[1];
394 String y = mry[2];
395 String[] hfm = muStr[1].split("\\.");
396 String h = hfm[0];
397 if ("下午".equals(muStr[2])) {
398 int ah = Integer.parseInt(h) + 12;
399 h = ah + "";
400 }
401 String f = hfm[1];
402 String miao = hfm[2];
403 String hm = hfm[3];
404 if (m.contains("月")) {
405 m = m.replaceAll("月", "");
406 }
407 if (Integer.parseInt(m) < 10 && m.length() < 2) {
408 m = "0" + m;
409 }
410 aaa = y + m + d + " " + h + ":" + f + ":" + miao + ":" + hm;
411 }
412 java.util.Date date = null;
413 SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
414 "yyMMdd hh:mm:ss:SS");
415 try {
416 date = simpleDateFormat.parse(aaa);
417 } catch (ParseException e) {
418 // TODO Auto-generated catch block
419 e.printStackTrace();
420 }
421 return date;
422 }
423
424 /**
425 * 时间大小比较
426 *
427 * @param t1
428 * @param t2
429 * @return
430 */
431 public static Integer timeCompare(Date t1, Date t2) {
432 if (t1 != null && t2 != null) {
433 Calendar c1 = Calendar.getInstance();
434 Calendar c2 = Calendar.getInstance();
435 c1.setTime(t1);
436 c2.setTime(t2);
437 int result = c1.compareTo(c2);
438 return result;
439 }
440 return null;
441 }
442
443 /**
444 * 日期四舍五入
445 *
446 * @param date
447 * @return
448 */
449 public static Date changeAverage(Date date, Integer num) {
450 if (null == date) {
451 return null;
452 }
453 Integer day = DateUtils.getDay(date);
454 date = DateUtils.dayChange(date, -(day - 1));
455 if (day > 15) {
456 date = DateUtils.monthChange(date, 1);
457 }
458 if (null != num) {
459 date = DateUtils.dayChange(date, num);
460 }
461 return date;
462 }
463
464 /**
465 * 日期格式化字符串
466 * @author 黄文君
467 * @date 2016年7月18日 下午3:56:12
468 *
469 * @param date
470 * @return String
471 */
472 public static String format(Date date) {
473 return date!=null ? new SimpleDateFormat(TIME_FORMAT).format(date) : null;
474 }
475
476 /**
477 * 日期格式化字符串
478 * @author 黄文君
479 * @date 2016年7月18日 下午3:56:29
480 *
481 * @param date
482 * @param datePattern
483 * @return String
484 */
485 public static String format(Date date, String datePattern) {
486 return date!=null ? new SimpleDateFormat(datePattern).format(date) : null;
487 }
488
489 /**
490 * 日期格式化字符串
491 * @author 黄文君
492 * @date 2016年7月18日 下午3:56:29
493 *
494 * @param date
495 * @param datePattern
496 * @return String
497 */
498 public static String format(Date date, String datePattern, String defaultValue) {
499 String value = format(date, datePattern);
500 return value==null||value.trim().isEmpty() ? defaultValue : value;
501 }
502
503 /**
504 * 日期字符串解析成日期对象
505 * @author 黄文君
506 * @date 2016年7月18日 下午3:56:43
507 *
508 * @param dateString
509 * @throws ParseException
510 * @return Date
511 */
512 public static Date parse(String dateString) throws ParseException {
513 return dateString!=null && !"".equals(dateString.trim()) ? new SimpleDateFormat(TIME_FORMAT).parse(dateString) : null;
514 }
515
516 /**
517 * 日期字符串解析成日期对象
518 * @author 黄文君
519 * @date 2016年7月18日 下午3:56:58
520 *
521 * @param dateString
522 * @param datePattern
523 * @throws ParseException
524 * @return Date
525 */
526 public static Date parse(String dateString, String datePattern) throws ParseException {
527 return dateString!=null && !"".equals(dateString.trim()) ? new SimpleDateFormat(datePattern).parse(dateString) : null;
528 }
529
530 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
3 <configuration>
4
5
6 </configuration>
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.spills.HisSpillsDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.spills.HisSpills">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
10 <result column="med_name" property="medName" jdbcType="VARCHAR" />
11 <result column="depot_code" property="depotCode" jdbcType="VARCHAR" />
12 <result column="depot_name" property="depotName" jdbcType="VARCHAR" />
13 <result column="tack_stockdate" property="tackStockDate" jdbcType="TIMESTAMP" />
14 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
15 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
16 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
17 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="lot" property="lot" jdbcType="VARCHAR" />
20 <result column="unit" property="unit" jdbcType="VARCHAR" />
21 <result column="number" property="number" jdbcType="DECIMAL" />
22 <result column="storck_num" property="storckNum" jdbcType="DECIMAL" />
23 <result column="difference_num" property="differenceNum" jdbcType="DECIMAL" />
24 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
25 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
26 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
27 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
28 <result column="tackstock_billno" property="tackStockBillNo" jdbcType="VARCHAR" />
29 <result column="price" property="price" jdbcType="DECIMAL" />
30
31 </resultMap>
32
33 <!--Base_Column_List -->
34 <sql id="Base_Column_List">id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price</sql>
35
36 <!--批量插入 -->
37 <insert id="batchInsert" parameterType="list">
38 insert into med_hli_spills (id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price)
39 values
40 <foreach collection ="list" item="obj" separator =",">
41 <trim prefix=" (" suffix=")" suffixOverrides=",">
42 #{obj.id},
43 #{obj.medCode},
44 #{obj.medName},
45 #{obj.depotCode},
46 #{obj.depotName},
47 #{obj.tackStockDate},
48 #{obj.operaterName},
49 #{obj.goodsCode},
50 #{obj.goodsName},
51 #{obj.goodsSpec},
52 #{obj.manufacturer},
53 #{obj.lot},
54 #{obj.unit},
55 #{obj.number},
56 #{obj.storckNum},
57 #{obj.differenceNum},
58 #{obj.productionDate},
59 #{obj.expireDate},
60 #{obj.supplierCode},
61 #{obj.supplierName},
62 #{obj.tackStockBillNo},
63 #{obj.price}
64 </trim>
65 </foreach>
66 </insert>
67
68 <!-- 新增HisSpills-->
69 <insert id="insert" parameterType="com.phxl.modules.goods.entity.spills.HisSpills">
70 insert into med_hli_spills (id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price)
71 values (
72 #{id,jdbcType=VARCHAR}
73 ,#{medCode,jdbcType=VARCHAR}
74 ,#{medName,jdbcType=VARCHAR}
75 ,#{depotCode,jdbcType=VARCHAR}
76 ,#{depotName,jdbcType=VARCHAR}
77 ,#{tackStockDate,jdbcType=TIMESTAMP}
78 ,#{operaterName,jdbcType=VARCHAR}
79 ,#{goodsCode,jdbcType=VARCHAR}
80 ,#{goodsName,jdbcType=VARCHAR}
81 ,#{goodsSpec,jdbcType=VARCHAR}
82 ,#{manufacturer,jdbcType=VARCHAR}
83 ,#{lot,jdbcType=VARCHAR}
84 ,#{unit,jdbcType=VARCHAR}
85 ,#{number,jdbcType=DECIMAL}
86 ,#{storckNum,jdbcType=DECIMAL}
87 ,#{differenceNum,jdbcType=DECIMAL}
88 ,#{productionDate,jdbcType=TIMESTAMP}
89 ,#{expireDate,jdbcType=TIMESTAMP}
90 ,#{supplierCode,jdbcType=VARCHAR}
91 ,#{supplierName,jdbcType=VARCHAR}
92 ,#{tackStockBillNo,jdbcType=VARCHAR}
93 ,#{price,jdbcType=DECIMAL}
94 )
95 </insert>
96
97 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.supplierstock;
2
3 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
4
5 public interface SupplierStockDao{
6
7 void insert(SupplierStock SupplierStock);
8
9 }
1 package com.phxl.modules.goods.entity.suoutstore;
2
3 import java.math.BigDecimal;
4 import java.util.Date;
5
6 /**
7 * 供应商出库单信息
8 */
9
10 public class SuOutStoreDetail {
11
12 private String billNo; //单据编号
13 private int rowNo; //行号
14 private String medPlanNo; //医院补货计划单据号
15 private int medPlanRowNo; //补货计划单据原行号
16 private String goodsGuid; //商品编码
17 private String goodsName; //商品名称
18 private String goodsSpec; //商品规格
19 private String unit; //包装单位
20 private String manufacturer; //生产厂商
21 private BigDecimal purchaserPrice; //采购价格
22 private BigDecimal amount; //金额
23 private String lot; //批号
24 private Date productionDate; //生产日期
25 private Date expireDate; //有效期至
26 private BigDecimal poqty; //补货计划数
27 private BigDecimal arrivalqty; //出库数
28 private String memo; //备注
29
30 private String id;
31
32 public String getBillNo() {
33 return billNo;
34 }
35
36 public void setBillNo(String billNo) {
37 this.billNo = billNo;
38 }
39
40 public int getRowNo() {
41 return rowNo;
42 }
43
44 public void setRowNo(int rowNo) {
45 this.rowNo = rowNo;
46 }
47
48 public String getMedPlanNo() {
49 return medPlanNo;
50 }
51
52 public void setMedPlanNo(String medPlanNo) {
53 this.medPlanNo = medPlanNo;
54 }
55
56 public int getMedPlanRowNo() {
57 return medPlanRowNo;
58 }
59
60 public void setMedPlanRowNo(int medPlanRowNo) {
61 this.medPlanRowNo = medPlanRowNo;
62 }
63
64 public String getGoodsGuid() {
65 return goodsGuid;
66 }
67
68 public void setGoodsGuid(String goodsGuid) {
69 this.goodsGuid = goodsGuid;
70 }
71
72 public String getGoodsName() {
73 return goodsName;
74 }
75
76 public void setGoodsName(String goodsName) {
77 this.goodsName = goodsName;
78 }
79
80 public String getGoodsSpec() {
81 return goodsSpec;
82 }
83
84 public void setGoodsSpec(String goodsSpec) {
85 this.goodsSpec = goodsSpec;
86 }
87
88 public String getUnit() {
89 return unit;
90 }
91
92 public void setUnit(String unit) {
93 this.unit = unit;
94 }
95
96 public String getManufacturer() {
97 return manufacturer;
98 }
99
100 public void setManufacturer(String manufacturer) {
101 this.manufacturer = manufacturer;
102 }
103
104 public BigDecimal getPurchaserPrice() {
105 return purchaserPrice;
106 }
107
108 public void setPurchaserPrice(BigDecimal purchaserPrice) {
109 this.purchaserPrice = purchaserPrice;
110 }
111
112 public BigDecimal getAmount() {
113 return amount;
114 }
115
116 public void setAmount(BigDecimal amount) {
117 this.amount = amount;
118 }
119
120 public String getLot() {
121 return lot;
122 }
123
124 public void setLot(String lot) {
125 this.lot = lot;
126 }
127
128 public Date getProductionDate() {
129 return productionDate;
130 }
131
132 public void setProductionDate(Date productionDate) {
133 this.productionDate = productionDate;
134 }
135
136 public Date getExpireDate() {
137 return expireDate;
138 }
139
140 public void setExpireDate(Date expireDate) {
141 this.expireDate = expireDate;
142 }
143
144 public BigDecimal getPoqty() {
145 return poqty;
146 }
147
148 public void setPoqty(BigDecimal poqty) {
149 this.poqty = poqty;
150 }
151
152 public BigDecimal getArrivalqty() {
153 return arrivalqty;
154 }
155
156 public void setArrivalqty(BigDecimal arrivalqty) {
157 this.arrivalqty = arrivalqty;
158 }
159
160 public String getMemo() {
161 return memo;
162 }
163
164 public void setMemo(String memo) {
165 this.memo = memo;
166 }
167
168 public String getId() {
169 return id;
170 }
171
172 public void setId(String id) {
173 this.id = id;
174 }
175
176 }
1 package com.phxl.modules.goods.entity.spills;
2
3 public class HisSpillsList {
4 public HisSpills getData() {
5 return data;
6 }
7
8 public void setData(HisSpills data) {
9 this.data = data;
10 }
11
12 private HisSpills data;
13 }
1 package com.phxl.modules.goods.web.spd;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.servlet.http.HttpServletRequest;
8
9 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
10
11 import org.apache.commons.fileupload.disk.DiskFileItem;
12 import org.apache.http.HttpEntity;
13 import org.apache.http.HttpResponse;
14 import org.apache.http.client.HttpClient;
15 import org.apache.http.client.methods.HttpPost;
16 import org.apache.http.entity.mime.MultipartEntityBuilder;
17 import org.apache.http.entity.mime.content.FileBody;
18 import org.apache.http.impl.client.HttpClients;
19 import org.apache.http.util.EntityUtils;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.stereotype.Controller;
24 import org.springframework.web.bind.annotation.RequestBody;
25 import org.springframework.web.bind.annotation.RequestMapping;
26 import org.springframework.web.bind.annotation.RequestMethod;
27 import org.springframework.web.bind.annotation.RequestParam;
28 import org.springframework.web.bind.annotation.ResponseBody;
29 import org.springframework.web.multipart.MultipartFile;
30 import org.springframework.web.multipart.commons.CommonsMultipartFile;
31
32 import com.alibaba.fastjson.JSON;
33 import com.alibaba.fastjson.JSONObject;
34 import com.alibaba.fastjson.serializer.SerializerFeature;
35 import com.fasterxml.jackson.annotation.JsonFormat;
36 import com.phxl.common.constants.PlatformConstant;
37 import com.phxl.common.response.PlatFormResponse;
38 import com.phxl.common.response.PlatFormResponseConstant;
39 import com.phxl.common.util.HTTPClient;
40 import com.phxl.common.util.JsonMapper;
41 import com.phxl.common.utils.IdUtil;
42 import com.phxl.modules.goods.entity.billback.BillBack;
43 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
44 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
45 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
46 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
47 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
48 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
49 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
50 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
51 import com.phxl.modules.goods.entity.medplan.MedPlan;
52 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
53 import com.phxl.modules.goods.entity.medstock.MedStock;
54 import com.phxl.modules.goods.entity.medstock.MedStockList;
55 import com.phxl.modules.goods.entity.spills.HisSpills;
56 import com.phxl.modules.goods.entity.spills.HisSpillsList;
57 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
58 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
59 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
60 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
61 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
62 import com.phxl.modules.goods.service.billback.BillBackService;
63 import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
64 import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
65 import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
66 import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
67 import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
68 import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
69 import com.phxl.modules.goods.service.medinstore.MedInStoreService;
70 import com.phxl.modules.goods.service.medplan.MedPlanService;
71 import com.phxl.modules.goods.service.medstock.MedStockService;
72 import com.phxl.modules.goods.service.spills.HisSpillsService;
73 import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
74 import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
75 import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
76
77 @Controller
78 @RequestMapping(value = "/Api")
79 public class SpdControlller {
80
81 /**
82 * 日志对象
83 */
84 protected Logger logger = LoggerFactory.getLogger(getClass());
85
86 @Autowired
87 private HisCtMedicineMaterialService ctMedicineMaterialService;
88
89 @Autowired
90 private InterfaceLogService interfaceLogService;
91
92 @Autowired
93 private HisCtDeptService hisCtDeptService;
94
95 @Autowired
96 private CTCareProvService cTCareProvService;
97
98 @Autowired
99 private MedSupplyGoodsService supplyGoodsService;
100
101 @Autowired
102 private MedStockService stockService;
103
104 @Autowired
105 private MedPlanService medPlanService;
106
107 @Autowired
108 private MedInStoreService medInStoreService;
109
110 @Autowired
111 private BillBackService backService;
112
113 @Autowired
114 private BillSettlementService billSettlementService;
115
116 @Autowired
117 private SupplierStockService supplierStockService;
118
119 @Autowired
120 private SuOutStoreService suOutStoreService;
121
122 @Autowired
123 private HisSpillsService hisSpillsService;
124
125 @Autowired
126 private SuInvoiceBackService suInvoiceBackService;
127
128
129 @RequestMapping(value="/setMFMedGoods")
130 @ResponseBody
131 public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
132 logger.debug("药品目录接口请求参数:{}",medgoodsList);
133 String result = "";
134 String logId = IdUtil.uuid();
135 String exception = "";
136 interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
137 PlatFormResponse response = new PlatFormResponse();
138 List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
139 try {
140 materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
141 for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
142 ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
143 }
144 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
145 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
146 result = JSON.toJSONString(response);
147 //medgoodsList = ctMedicineMaterialService.createRequest();
148 //供应商服务请求:
149 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
150 } catch (Exception e) {
151 logger.error(e.getMessage());
152 exception = e.getMessage();
153 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
154 response.setMsg(e.getMessage());
155 result = JSON.toJSONString(response);
156 }
157 interfaceLogService.setResultLog(response, logId, exception);
158 return result;
159 }
160
161 @RequestMapping(value="/setHDept")
162 @ResponseBody
163 public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
164 logger.debug("医院科室资料接口请求参数:{}",params);
165 String result = "";
166 String logId = IdUtil.uuid();
167 String exception = "";
168 interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
169 PlatFormResponse response = new PlatFormResponse();
170 List<HisCtDept> depts = new ArrayList<HisCtDept>();
171 try {
172 depts = JSONObject.parseArray(params, HisCtDept.class);
173 int end = hisCtDeptService.batchSaveOrUpdate(depts);
174 if(end==1){
175 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
176 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
177 }else{
178 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
179 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
180 }
181 result = JSON.toJSONString(response);
182 //供应商服务请求:
183 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
184 } catch (Exception e) {
185 logger.error(e.getMessage());
186 exception = e.getMessage();
187 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
188 response.setMsg(e.getMessage());
189 result = JSON.toJSONString(response);
190 }
191 interfaceLogService.setResultLog(response, logId, exception);
192 return result;
193 }
194
195 /**
196 * 医院人员资料接口
197 * @param request
198 * @param params
199 * @return
200 */
201 @RequestMapping("/setMedStaff")
202 @ResponseBody
203 public String setMedStaff(HttpServletRequest request, @RequestBody String params){
204 logger.debug("医院人员资料接口请求参数:{}",params);
205 String result = "";
206 String logId = IdUtil.uuid();
207 String exception = "";
208 interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
209 PlatFormResponse response = new PlatFormResponse();
210 List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
211 boolean end = false;
212 try {
213 careProvs = JSONObject.parseArray(params, CTCareProv.class);
214 end = cTCareProvService.batchSaveOrUpdate(careProvs);
215 if(end){
216 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
217 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
218 }else{
219 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
220 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
221 }
222 result = JSON.toJSONString(response);
223 //供应商服务请求:
224 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
225 } catch (Exception e) {
226 logger.error(e.getMessage());
227 exception = e.getMessage();
228 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
229 response.setMsg(e.getMessage());
230 result = JSON.toJSONString(response);
231 }
232 interfaceLogService.setResultLog(response, logId, exception);
233 return result;
234 }
235
236
237 /**
238 * 医院采购目录接口
239 * @param request
240 * @param params
241 * @return
242 */
243 @RequestMapping("/setMFSupplyGoods")
244 @ResponseBody
245 public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
246 logger.debug("医院采购目录接口请求参数:{}",params);
247 String result = "";
248 String logId = IdUtil.uuid();
249 String exception = "";
250 interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
251 PlatFormResponse response = new PlatFormResponse();
252 List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
253 boolean end = false;
254 try {
255 supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
256 end = supplyGoodsService.batchSave(supplyGoods);
257 if(end){
258 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
259 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
260 }else{
261 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
262 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
263 }
264 result = JSON.toJSONString(response);
265 //供应商服务请求:
266 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
267 } catch (Exception e) {
268 logger.error(e.getMessage());
269 exception = e.getMessage();
270 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
271 response.setMsg(e.getMessage());
272 result = JSON.toJSONString(response);
273 }
274 interfaceLogService.setResultLog(response, logId, exception);
275 return result;
276 }
277
278
279 /**
280 * 医院库存接口
281 * @param request
282 * @param params
283 * @return
284 */
285 @ResponseBody
286 @RequestMapping(value="/setMedStock",method = RequestMethod.POST)
287 public String setMedStock(HttpServletRequest request, @RequestBody String params){
288 logger.debug("HLI同步医院库存数据请求参数:{}",params);
289 String result = "";
290 String logId = IdUtil.uuid();
291 String exception = "";
292 interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
293 PlatFormResponse response = new PlatFormResponse();
294 List<MedStockList> stocks = new ArrayList<MedStockList>();
295 boolean end = false;
296 try {
297 stocks = JSONObject.parseArray(params, MedStockList.class);
298 end = stockService.batchSave(stocks);
299 if(end){
300 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
301 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
302 }else{
303 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
304 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
305 }
306 result = JSON.toJSONString(response);
307 //供应商服务请求:
308 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
309 } catch (Exception e) {
310 logger.error(e.getMessage());
311 exception = e.getMessage();
312 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
313 response.setMsg(e.getMessage());
314 result = JSON.toJSONString(response);
315 }
316 interfaceLogService.setResultLog(response, logId, exception);
317 return result;
318 }
319
320
321 /**
322 * 医院补货计划接口
323 * @param request
324 * @param params
325 * @return
326 */
327 @RequestMapping("/setMedPlan")
328 @ResponseBody
329 public String setMedPlan(HttpServletRequest request, @RequestBody String params){
330 logger.debug("补货计划接口请求参数:{}",params);
331 String result = "";
332 String logId = IdUtil.uuid();
333 String exception = "";
334 interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
335 PlatFormResponse response = new PlatFormResponse();
336 List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
337 boolean end = false;
338 try {
339 //改成批量的操作
340 medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
341 end = medPlanService.batchSave(medPlans);
342 if(end){
343 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
344 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
345 }else{
346 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
347 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
348 }
349 result = JSON.toJSONString(response);
350 //供应商服务请求:
351 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
352 } catch (Exception e) {
353 logger.error(e.getMessage());
354 exception = e.getMessage();
355 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
356 response.setMsg(e.getMessage());
357 result = JSON.toJSONString(response);
358 }
359 interfaceLogService.setResultLog(response, logId, exception);
360 return result;
361 }
362
363
364 /**
365 * 医院退货接口
366 * @param request
367 * @param params
368 * @return
369 */
370 @RequestMapping("/setTRMedRPI")
371 @ResponseBody
372 public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
373 logger.debug("医院退货计划接口请求参数:{}",params);
374 String result = "";
375 String logId = IdUtil.uuid();
376 String exception = "";
377 interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
378 PlatFormResponse response = new PlatFormResponse();
379 List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
380 boolean end = false;
381 try {
382 billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
383 end = backService.batchSave(billBacks);
384 if(end){
385 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
386 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
387 }else{
388 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
389 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
390 }
391 result = JSON.toJSONString(response);
392 //供应商服务请求:
393 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
394 } catch (Exception e) {
395 logger.error(e.getMessage());
396 exception = e.getMessage();
397 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
398 response.setMsg(e.getMessage());
399 result = JSON.toJSONString(response);
400 }
401 interfaceLogService.setResultLog(response, logId, exception);
402 return result;
403 }
404
405 /**
406 * 结算单接口
407 * @param request
408 * @param params
409 * @return
410 */
411 @RequestMapping("/setTRSettle")
412 @ResponseBody
413 public String setTRSettle(HttpServletRequest request, @RequestBody String params){
414 logger.debug("同步医院结算单请求参数:{}",params);
415 String result = "";
416 String logId = IdUtil.uuid();
417 String exception = "";
418 interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
419 PlatFormResponse response = new PlatFormResponse();
420 List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
421 boolean end = false;
422 try {
423 settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
424 end = billSettlementService.batchSave(settlementWithDetails);
425 if(end){
426 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
427 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
428 }else{
429 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
430 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
431 }
432 result = JSON.toJSONString(response);
433 //供应商服务请求:
434 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
435 } catch (Exception e) {
436 logger.error(e.getMessage());
437 exception = e.getMessage();
438 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
439 response.setMsg(e.getMessage());
440 result = JSON.toJSONString(response);
441 }
442 interfaceLogService.setResultLog(response, logId, exception);
443 return result;
444 }
445
446
447 /**
448 * 供应商库存接口
449 * @param request
450 * @param params
451 * @return
452 */
453 @RequestMapping("/setStock")
454 @ResponseBody
455 public String setStock(HttpServletRequest request, @RequestBody String params){
456 logger.debug("供应商同步库存数据请求参数:{}",params);
457 String result = "";
458 String logId = IdUtil.uuid();
459 String exception = "";
460 interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
461 PlatFormResponse response = new PlatFormResponse();
462 List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
463 boolean end = false;
464 try {
465 supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
466 end = supplierStockService.batchSave(supplierStocks);
467 if(end){
468 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
469 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
470 }else{
471 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
472 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
473 }
474 result = JSON.toJSONString(response);
475 try
476 {
477 //SPD服务请求:
478 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
479 response = JSONObject.parseObject(result,PlatFormResponse.class);
480 response.setMsg("SPD:"+response.getMsg());
481 }
482 catch(Exception ex){
483 logger.error("SPD:"+ex.getMessage());
484 exception = "SPD:"+ex.getMessage();
485 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
486 response.setMsg("SPD:"+ex.getMessage());
487 result = JSON.toJSONString(response);
488 }
489
490 } catch (Exception e) {
491 logger.error("前置机:"+e.getMessage());
492 exception = "前置机:"+e.getMessage();
493 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
494 response.setMsg("前置机:"+e.getMessage());
495 result = JSON.toJSONString(response);
496 }
497 interfaceLogService.setResultLog(response, logId, exception);
498 return result;
499 }
500
501
502 /**
503 * 供应商出库单接口
504 * @param request
505 * @param params
506 * @return
507 */
508 @RequestMapping("/setTrmedwv")
509 @ResponseBody
510 public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
511 logger.debug("同步供应商出库单请求参数:{}",params);
512 String result = "";
513 String logId = IdUtil.uuid();
514 String exception = "";
515 interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
516 PlatFormResponse response = new PlatFormResponse();
517 List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
518 boolean end = false;
519 try {
520 suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
521 end = suOutStoreService.batchSave(suOutStores);
522 if(end){
523 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
524 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
525 }else{
526 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
527 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
528 }
529 result = JSON.toJSONString(response);
530 try
531 {
532 //SPD服务请求:
533 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
534 response = JSONObject.parseObject(result,PlatFormResponse.class);
535 response.setMsg("SPD:"+response.getMsg());
536 }
537 catch(Exception ex){
538 logger.error("SPD:"+ex.getMessage());
539 exception = "SPD:"+ex.getMessage();
540 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
541 response.setMsg("SPD:"+ex.getMessage());
542 result = JSON.toJSONString(response);
543 }
544
545 } catch (Exception e) {
546 logger.error("前置机:"+e.getMessage());
547 exception = "前置机:"+e.getMessage();
548 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
549 response.setMsg("前置机:"+e.getMessage());
550 result = JSON.toJSONString(response);
551 }
552 interfaceLogService.setResultLog(response, logId, exception);
553 return result;
554 }
555
556 /**
557 * 医院盘点损溢接口
558 * @param request
559 * @param params
560 * @return
561 */
562 @RequestMapping(value="/setTrDiff")
563 @ResponseBody
564 public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
565 logger.debug("医院盘点损溢接口请求参数:{}",params);
566 String result = "";
567 String logId = IdUtil.uuid();
568 String exception = "";
569 interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
570 PlatFormResponse response = new PlatFormResponse();
571 List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
572 boolean end = false;
573 try {
574 spills = JSONObject.parseArray(params, HisSpillsList.class);
575 end = hisSpillsService.batchSave(spills);
576 if(end){
577 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
578 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
579 }else{
580 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
581 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
582 }
583 result = JSON.toJSONString(response);
584 //供应商服务请求:
585 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
586 } catch (Exception e) {
587 logger.error(e.getMessage());
588 exception = e.getMessage();
589 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
590 response.setMsg(e.getMessage());
591 result = JSON.toJSONString(response);
592 }
593 interfaceLogService.setResultLog(response, logId, exception);
594 return result;
595 }
596
597
598 /**
599 * 供应商发票回传接口
600 * @param request
601 * @param params
602 * @return
603 */
604 @RequestMapping("/setInvoice")
605 @ResponseBody
606 public String setInvoice(HttpServletRequest request, @RequestBody String params){
607 logger.debug("供应商发票回传接口请求参数:{}",params);
608 String result = "";
609 String logId = IdUtil.uuid();
610 String exception = "";
611 interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
612 PlatFormResponse response = new PlatFormResponse();
613 List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
614 boolean end = false;
615 try {
616 suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
617 end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
618 if(end){
619 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
620 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
621 }else{
622 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
623 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
624 }
625 result = JSON.toJSONString(response);
626 try
627 {
628 //SPD服务请求:
629 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
630 response = JSONObject.parseObject(result,PlatFormResponse.class);
631 response.setMsg("SPD:"+response.getMsg());
632 }
633 catch(Exception ex){
634 logger.error("SPD:"+ex.getMessage());
635 exception = "SPD:"+ex.getMessage();
636 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
637 response.setMsg("SPD:"+ex.getMessage());
638 result = JSON.toJSONString(response);
639 }
640
641 } catch (Exception e) {
642 logger.error("前置机:"+e.getMessage());
643 exception = "前置机:"+e.getMessage();
644 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
645 response.setMsg("前置机:"+e.getMessage());
646 result = JSON.toJSONString(response);
647 }
648 interfaceLogService.setResultLog(response, logId, exception);
649 return result;
650 }
651
652 /*
653 * 医院入库单回传接口
654 * @param request
655 * @param params
656 * @return
657 */
658 @RequestMapping("/setMedInStore")
659 @ResponseBody
660 public String setMedInStore(HttpServletRequest request, @RequestBody String params){
661 logger.debug("医院入库单回传接口请求参数:{}",params);
662 String result = "";
663 String logId = IdUtil.uuid();
664 String exception = "";
665 interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
666 PlatFormResponse response = new PlatFormResponse();
667 List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
668 boolean end = false;
669 try {
670 //改成批量的操作
671 medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
672 end = medInStoreService.batchSave(medInStores);
673 if(end){
674 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
675 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
676 }else{
677 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
678 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
679 }
680 result = JSON.toJSONString(response);
681 //供应商服务请求:
682 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
683 } catch (Exception e) {
684 logger.error(e.getMessage());
685 exception = e.getMessage();
686 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
687 response.setMsg(e.getMessage());
688 result = JSON.toJSONString(response);
689 }
690 interfaceLogService.setResultLog(response, logId, exception);
691 return result;
692 }
693
694 /***
695 * 推送对账数据到平台
696 * @param params
697 * @return
698 */
699 @RequestMapping("/pushBalance")
700 @ResponseBody
701 public String pushBalance(@RequestBody String params) {
702 logger.debug("推送对账数据:{}", params);
703 String result = "";
704 String logId = IdUtil.uuid();
705 String exception = "";
706 interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
707 PlatFormResponse response = new PlatFormResponse();
708 try {
709 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
710 JSONObject jsonObject = JSONObject.parseObject(result);
711 if(jsonObject.getIntValue("errorCode") != 0){
712 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
713 }else {
714 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
715 }
716 response.setMsg(jsonObject.getString("message"));
717 } catch (Exception e) {
718 logger.error(e.getMessage());
719 exception = e.getMessage();
720 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
721 response.setMsg("发送对账数据给平台错误:" + e.getMessage());
722 result = JSON.toJSONString(response);
723 }
724 interfaceLogService.setResultLog(response, logId, exception);
725 return result;
726
727 }
728
729
730 /**
731 * 推送发药数据到平台
732 * @param params
733 * @return
734 */
735 @RequestMapping("/pushDispensing")
736 @ResponseBody
737 public String pushDispensing(@RequestBody String params){
738 logger.debug("推送发药数据:{}", params);
739 String result = "";
740 String logId = IdUtil.uuid();
741 String exception = "";
742 interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
743 PlatFormResponse response = new PlatFormResponse();
744 try {
745 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
746 JSONObject jsonObject = JSONObject.parseObject(result);
747 if(jsonObject.getIntValue("errorCode") != 0){
748 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
749 }else {
750 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
751 }
752 response.setMsg(jsonObject.getString("message"));
753 } catch (Exception e) {
754 logger.error(e.getMessage());
755 exception = e.getMessage();
756 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
757 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
758 result = JSON.toJSONString(response);
759 }
760 interfaceLogService.setResultLog(response, logId, exception);
761 return result;
762 }
763
764
765 /**
766 * 推送库存数据到平台
767 * @param params
768 * @return
769 */
770 @RequestMapping("/pushStock")
771 @ResponseBody
772 public String pushStock(@RequestBody String params){
773 logger.debug("推送库存数据:{}", params);
774 String result = "";
775 String logId = IdUtil.uuid();
776 String exception = "";
777 interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
778 PlatFormResponse response = new PlatFormResponse();
779 try {
780 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
781 JSONObject jsonObject = JSONObject.parseObject(result);
782 if(jsonObject.getIntValue("errorCode") != 0){
783 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
784 }else {
785 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
786 }
787 response.setMsg(jsonObject.getString("message"));
788 } catch (Exception e) {
789 logger.error(e.getMessage());
790 exception = e.getMessage();
791 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
792 response.setMsg("发送库存数据给平台错误:" + e.getMessage());
793 result = JSON.toJSONString(response);
794 }
795 interfaceLogService.setResultLog(response, logId, exception);
796 return result;
797 }
798
799 /**
800 * 推送证照数据到平台
801 * @param params
802 * @return
803 */
804 @RequestMapping("/pushlicinfo")
805 @ResponseBody
806 public String pushlicinfo(@RequestBody String params){
807 logger.debug("证照数据:{}", params);
808 String result = "";
809 String logId = IdUtil.uuid();
810 String exception = "";
811 interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
812 PlatFormResponse response = new PlatFormResponse();
813 try {
814 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
815 JSONObject jsonObject = JSONObject.parseObject(result);
816 if(jsonObject.getIntValue("errorCode") != 0){
817 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
818 }else {
819 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
820 }
821 response.setMsg(jsonObject.getString("message"));
822 } catch (Exception e) {
823 logger.error(e.getMessage());
824 exception = e.getMessage();
825 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
826 response.setMsg("发送证照数据给平台错误:" + e.getMessage());
827 result = JSON.toJSONString(response);
828 }
829 interfaceLogService.setResultLog(response, logId, exception);
830 return result;
831 }
832
833
834 /**
835 * 推送证照图片数据到平台
836 * @param params
837 * @return
838 */
839 @RequestMapping("/pushlicpicinfo")
840 @ResponseBody
841 public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
842 String result = "";
843 String logId = IdUtil.uuid();
844 String exception = "";
845 PlatFormResponse response = new PlatFormResponse();
846 interfaceLogService.saveLog("pushDispensing:(推送证照数据)","filename////"+file.getOriginalFilename(), logId);
847 try {
848 if (file!=null) {
849 HttpClient client = HttpClients.createDefault();
850 HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
851 File newfile = new File("/usr/local/img/"+file.getOriginalFilename());
852 file.transferTo(newfile);
853 FileBody bin = new FileBody(newfile);
854 HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
855 post.setEntity(reqEntity);
856 HttpResponse htppresponse = client.execute(post);
857 HttpEntity resEntity = htppresponse.getEntity();
858 result = EntityUtils.toString(resEntity, "UTF-8");
859 JSONObject jsonObject = JSONObject.parseObject(result);
860 if(!"Y".equals(jsonObject.getString("FLAG"))){
861 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
862 }else {
863 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
864 }
865 response.setMsg(jsonObject.toJSONString());
866 if (newfile.exists()) {
867 newfile.delete();
868 }
869 }
870
871 } catch (Exception e) {
872 logger.error(e.getMessage());
873 exception = e.getMessage();
874 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
875 response.setMsg("发送证照图片数据给平台错误:" + e.getMessage());
876 result = JSON.toJSONString(response);
877 }
878 interfaceLogService.setResultLog(response, logId, exception);
879 return result;
880 }
881 }
1 package com.phxl.modules.goods.service.medplan;
2
3 import java.math.BigDecimal;
4 import java.util.List;
5
6 import org.apache.commons.lang3.StringUtils;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.phxl.common.utils.BaseException;
13 import com.phxl.common.utils.IdUtil;
14 import com.phxl.modules.goods.dao.medplan.MedPlanDao;
15 import com.phxl.modules.goods.dao.medplan.MedPlanDetailDao;
16 import com.phxl.modules.goods.entity.medplan.MedPlan;
17 import com.phxl.modules.goods.entity.medplan.MedPlanDetail;
18 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
19
20
21 @Service
22 public class MedPlanService{
23
24 @Autowired
25 private MedPlanDao planDao;
26
27 @Autowired
28 private MedPlanDetailDao planDetailDao;
29
30 /**
31 * 日志对象
32 */
33 protected Logger logger = LoggerFactory.getLogger(getClass());
34
35
36 private void checkMedPlan(List<MedPlanWithDetail> plans) {
37 if(plans == null || plans.size() == 0){
38 logger.error("无相应补货计划单据信息");
39 throw new BaseException("无相应补货计划单据信息");
40 }
41 for (MedPlanWithDetail medPlans : plans) {
42 String medCode = medPlans.getTrmedPlan().getMedCode();
43 String medName = medPlans.getTrmedPlan().getMedName();
44 if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
45 logger.error("补货计划医疗机构编码以及医疗机构名称不能为空");
46 throw new BaseException("补货计划医疗机构编码以及医疗机构名称不能为空");
47 }
48 String supplierCode = medPlans.getTrmedPlan().getSupplierCode();
49 String suppliername = medPlans.getTrmedPlan().getSuppliername();
50 if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(suppliername)) {
51 logger.error("补货计划平台供应商代码以及平台供应商名称不能为空");
52 throw new BaseException("补货计划平台供应商代码以及平台供应商名称不能为空");
53 }
54 String billNo = medPlans.getTrmedPlan().getBillNo();
55 if (StringUtils.isEmpty(billNo)) {
56 logger.error("补货计划单据编号不能为空");
57 throw new BaseException("补货计划单据编号不能为空");
58 }
59 String billType = medPlans.getTrmedPlan().getBillType();
60 if (StringUtils.isEmpty(billType)) {
61 logger.error("补货计划单据类型不能为空");
62 throw new BaseException("补货计划单据类型不能为空");
63 }
64 List<MedPlanDetail> details = medPlans.getTrmedPlan().getTrmedplandetails();
65 if(details == null || details.size() == 0){
66 logger.error("补货计划单据编号:"+billNo+"订单明细不能为空");
67 throw new BaseException("补货计划单据编号:"+billNo+"订单明细不能为空");
68 }
69 for (MedPlanDetail medPlanDetail : details) {
70 String detailBillNo = medPlanDetail.getBillNo();
71 if (StringUtils.isEmpty(detailBillNo)) {
72 logger.error("补货计划单据编号:"+billNo+"订单明细单据编号不能为空");
73 throw new BaseException("补货计划单据编号:"+billNo+"订单明细单据编号不能为空");
74 }
75 String goodsCode = medPlanDetail.getGoodsCode();
76 String goodsName = medPlanDetail.getGoodsName();
77 if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
78 logger.error("补货计划单据编号:"+billNo+"订单明细商品编码以及商品名称不能为空");
79 throw new BaseException("补货计划单据编号:"+billNo+"订单明细商品编码以及商品名称不能为空");
80 }
81 BigDecimal poQty = medPlanDetail.getPoQty();
82 if (poQty == null) {
83 logger.error("补货计划单据编号:"+billNo+"订单明细订货数不能为空");
84 throw new BaseException("补货计划单据编号:"+billNo+"订单明细订货数不能为空");
85 }
86 BigDecimal taxpriceoQty = medPlanDetail.getTaxprice();
87 if (taxpriceoQty == null) {
88 logger.error("补货计划单据编号:"+billNo+"订单明细商品含税单价不能为空");
89 throw new BaseException("补货计划单据编号:"+billNo+"订单明细商品含税单价不能为空");
90 }
91 BigDecimal taxsum = medPlanDetail.getTaxsum();
92 if (taxsum == null) {
93 logger.error("补货计划单据编号:"+billNo+"订单明细商品含税总金额不能为空");
94 throw new BaseException("补货计划单据编号:"+billNo+"订单明细商品含税总金额不能为空");
95 }
96 String unit = medPlanDetail.getUnit();
97 if (StringUtils.isEmpty(unit)) {
98 logger.error("补货计划单据编号:"+billNo+"订单明细订货单位不能为空");
99 throw new BaseException("补货计划单据编号:"+billNo+"订单明细订货单位不能为空");
100 }
101
102 }
103 }
104
105
106 }
107
108
109 public boolean batchSave(List<MedPlanWithDetail> medPlans) {
110
111 boolean result = true;
112 try {
113 checkMedPlan(medPlans);
114 } catch (Exception e) {
115 throw new BaseException(e.getMessage());
116 }
117 for (MedPlanWithDetail medPlanWithDetail : medPlans) {
118 MedPlan medPlan = medPlanWithDetail.getTrmedPlan();
119 List<MedPlanDetail> details = medPlan.getTrmedplandetails();
120 String id = IdUtil.uuid();
121
122 medPlanWithDetail.getTrmedPlan().setId(id);
123 if(details != null && details.size() != 0){
124 for (MedPlanDetail medPlanDetail : details) {
125 medPlanDetail.setBillNo(medPlanWithDetail.getTrmedPlan().getBillNo());
126 medPlanDetail.setId(id);
127 }
128 planDao.insert(medPlan);
129 planDetailDao.batchInsert(details);
130 }
131 }
132 return result;
133 }
134
135 }
1 <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2 <wb-module deploy-name="medicinal-supplier">
3 <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
4 <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
5 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
6 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
7 <wb-resource deploy-path="/WEB-INF/classes" source-path="/conf/test"/>
8 <property name="java-output-path" value="/medicinal-supplier/target/classes"/>
9 <property name="context-root" value="medicinal-supplier"/>
10 </wb-module>
11 </project-modules>
1 package com.phxl.common.utils;
2
3 import java.util.UUID;
4
5 /**
6 * id生成
7 */
8
9 public class IdUtil {
10
11 public static String uuid() {
12 return UUID.randomUUID().toString().replaceAll("-", "");
13 }
14
15 }
1 package com.phxl.common.util;
2
3 import java.io.StringReader;
4 import java.io.StringWriter;
5
6 import javax.xml.bind.JAXBContext;
7 import javax.xml.bind.Marshaller;
8 import javax.xml.bind.Unmarshaller;
9
10 /**
11 * JaxbUtil工具类
12 */
13 public class JaxbUtil {
14
15 /**
16 * JavaBean转换成xml
17 * 默认编码UTF-8
18 * @param obj
19 * @return
20 */
21 public static String convertToXml(Object obj) {
22 return convertToXml(obj, "UTF-8");
23 }
24
25 /**
26 * JavaBean转换成xml
27 * @param obj
28 * @param encoding
29 * @return
30 */
31 public static String convertToXml(Object obj, String encoding) {
32 String result = null;
33 try {
34 JAXBContext context = JAXBContext.newInstance(obj.getClass());
35 Marshaller marshaller = context.createMarshaller();
36 marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
37 marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
38
39 StringWriter writer = new StringWriter();
40 marshaller.marshal(obj, writer);
41 result = writer.toString();
42 } catch (Exception e) {
43 e.printStackTrace();
44 }
45
46 return result;
47 }
48
49 /**
50 * xml转换成JavaBean
51 * @param xml
52 * @param c
53 * @return
54 */
55 @SuppressWarnings("unchecked")
56 public static <T> T converyToJavaBean(String xml, Class<T> c) {
57 T t = null;
58 try {
59 JAXBContext context = JAXBContext.newInstance(c);
60 Unmarshaller unmarshaller = context.createUnmarshaller();
61 t = (T) unmarshaller.unmarshal(new StringReader(xml));
62 } catch (Exception e) {
63 e.printStackTrace();
64 }
65
66 return t;
67 }
68 }
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3 <modelVersion>4.0.0</modelVersion>
4 <groupId>com.phxl</groupId>
5 <artifactId>medicinal-supplier</artifactId>
6 <packaging>war</packaging>
7 <version>1.0</version>
8 <name>medicinal-supplier</name>
9 <url>http://maven.apache.org</url>
10
11 <!-- 属性配置 -->
12 <properties>
13 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14 <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
15 <junit.version>4.8.1</junit.version>
16 <javax.servlet.version>1.2</javax.servlet.version>
17 <javax.servlet.api.version>2.5</javax.servlet.api.version>
18 <spring.version>4.1.1.RELEASE</spring.version>
19
20 <org.apache.commons.version>3.0</org.apache.commons.version>
21 <org.apache.xmlbeans.version>2.6.0</org.apache.xmlbeans.version>
22 <org.apache.poi.version>3.9</org.apache.poi.version>
23 <org.apache.poi.openxml4j.version>1.0-beta</org.apache.poi.openxml4j.version>
24
25 <com.fasterxml.jackson.version>2.8.4</com.fasterxml.jackson.version>
26 <com.itextpdf.version>5.5.7</com.itextpdf.version>
27 <com.itextpdf.itext-asian.version>5.2.0</com.itextpdf.itext-asian.version>
28 <com.aliyun.oss.version>2.2.3</com.aliyun.oss.version>
29 <com.google.gson.version>2.2.2</com.google.gson.version>
30 <com.google.zxing.version>3.2.1</com.google.zxing.version>
31 <com.thoughtworks.xstream.version>1.4.10</com.thoughtworks.xstream.version>
32 <commons-fileupload.version>1.3.1</commons-fileupload.version>
33 <dom4j.version>1.6.1</dom4j.version>
34 <qrcode.version>1.4</qrcode.version>
35 <eu.medsea.mimeutil.version>2.1.3</eu.medsea.mimeutil.version>
36 <mysql.driver.version>5.1.30</mysql.driver.version>
37 <mybatis.version>3.2.8</mybatis.version>
38 <mybatis-spring.version>1.2.3</mybatis-spring.version>
39 <cxf.version>2.2.3</cxf.version>
40
41 <!-- environment setting -->
42 <jdk.version>1.8</jdk.version>
43 <tomcat.version>2.2</tomcat.version>
44 <webserver.port>8888</webserver.port>
45 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46 <downloadSources>true</downloadSources>
47
48 <slf4j.version>1.7.7</slf4j.version>
49 <!-- logback setting -->
50 <ch.qos.logback.version>1.1.7</ch.qos.logback.version>
51 <org.slf4j.version>1.7.7</org.slf4j.version>
52 </properties>
53
54 <!-- 配置环境 -->
55 <profiles>
56 <profile>
57 <id>prod</id>
58 <!-- <activation>
59 <activeByDefault>true</activeByDefault>
60 </activation> -->
61 <properties>
62 <package.environment>prod</package.environment>
63 </properties>
64 </profile>
65 <profile>
66 <id>stg</id>
67 <properties>
68 <package.environment>stg</package.environment>
69 </properties>
70 </profile>
71 <profile>
72 <id>test</id>
73 <properties>
74 <package.environment>test</package.environment>
75 </properties>
76 </profile>
77 </profiles>
78
79 <dependencies>
80 <dependency>
81 <groupId>junit</groupId>
82 <artifactId>junit</artifactId>
83 <version>${junit.version}</version>
84 <scope>test</scope>
85 </dependency>
86
87 <!-- jackson -->
88 <dependency>
89 <groupId>com.fasterxml.jackson.core</groupId>
90 <artifactId>jackson-core</artifactId>
91 <version>${com.fasterxml.jackson.version}</version>
92 </dependency>
93 <dependency>
94 <groupId>com.fasterxml.jackson.core</groupId>
95 <artifactId>jackson-databind</artifactId>
96 <version>${com.fasterxml.jackson.version}</version>
97 </dependency>
98
99 <!-- spring -->
100 <dependency>
101 <groupId>org.springframework</groupId>
102 <artifactId>spring-aop</artifactId>
103 <version>${spring.version}</version>
104 <type>jar</type>
105 <scope>compile</scope>
106 </dependency>
107 <dependency>
108 <groupId>org.springframework</groupId>
109 <artifactId>spring-aspects</artifactId>
110 <version>${spring.version}</version>
111 <type>jar</type>
112 <scope>compile</scope>
113 </dependency>
114 <dependency>
115 <groupId>org.springframework</groupId>
116 <artifactId>spring-beans</artifactId>
117 <version>${spring.version}</version>
118 <type>jar</type>
119 <scope>compile</scope>
120 </dependency>
121 <dependency>
122 <groupId>org.springframework</groupId>
123 <artifactId>spring-context</artifactId>
124 <version>${spring.version}</version>
125 <type>jar</type>
126 <scope>compile</scope>
127 </dependency>
128 <dependency>
129 <groupId>org.springframework</groupId>
130 <artifactId>spring-context-support</artifactId>
131 <version>${spring.version}</version>
132 <type>jar</type>
133 <scope>compile</scope>
134 </dependency>
135 <dependency>
136 <groupId>org.springframework</groupId>
137 <artifactId>spring-core</artifactId>
138 <version>${spring.version}</version>
139 <type>jar</type>
140 <scope>compile</scope>
141 </dependency>
142 <dependency>
143 <groupId>org.springframework</groupId>
144 <artifactId>spring-expression</artifactId>
145 <version>${spring.version}</version>
146 <type>jar</type>
147 <scope>compile</scope>
148 </dependency>
149 <dependency>
150 <groupId>org.springframework</groupId>
151 <artifactId>spring-jdbc</artifactId>
152 <version>${spring.version}</version>
153 <type>jar</type>
154 <scope>compile</scope>
155 </dependency>
156 <dependency>
157 <groupId>org.springframework</groupId>
158 <artifactId>spring-jms</artifactId>
159 <version>${spring.version}</version>
160 <type>jar</type>
161 <scope>compile</scope>
162 </dependency>
163 <dependency>
164 <groupId>org.springframework</groupId>
165 <artifactId>spring-orm</artifactId>
166 <version>${spring.version}</version>
167 <type>jar</type>
168 <scope>compile</scope>
169 </dependency>
170 <dependency>
171 <groupId>org.springframework</groupId>
172 <artifactId>spring-oxm</artifactId>
173 <version>${spring.version}</version>
174 <type>jar</type>
175 <scope>compile</scope>
176 </dependency>
177 <dependency>
178 <groupId>org.springframework</groupId>
179 <artifactId>spring-tx</artifactId>
180 <version>${spring.version}</version>
181 <type>jar</type>
182 <scope>compile</scope>
183 </dependency>
184 <dependency>
185 <groupId>org.springframework</groupId>
186 <artifactId>spring-web</artifactId>
187 <version>${spring.version}</version>
188 <type>jar</type>
189 <scope>compile</scope>
190 </dependency>
191 <dependency>
192 <groupId>org.springframework</groupId>
193 <artifactId>spring-webmvc</artifactId>
194 <version>${spring.version}</version>
195 <type>jar</type>
196 <scope>compile</scope>
197 </dependency>
198 <dependency>
199 <groupId>org.springframework</groupId>
200 <artifactId>spring-test</artifactId>
201 <version>${spring.version}</version>
202 <type>jar</type>
203 <scope>compile</scope>
204 </dependency>
205
206 <dependency>
207 <groupId>javax.servlet</groupId>
208 <artifactId>jstl</artifactId>
209 <version>${javax.servlet.version}</version>
210 <type>jar</type>
211 <scope>compile</scope>
212 </dependency>
213
214 <dependency>
215 <groupId>com.aliyun.oss</groupId>
216 <artifactId>aliyun-sdk-oss</artifactId>
217 <version>${com.aliyun.oss.version}</version>
218 </dependency>
219
220 <dependency>
221 <groupId>javax.servlet</groupId>
222 <artifactId>servlet-api</artifactId>
223 <version>${javax.servlet.api.version}</version>
224 <scope>provided</scope>
225 </dependency>
226
227 <dependency>
228 <groupId>commons-fileupload</groupId>
229 <artifactId>commons-fileupload</artifactId>
230 <version>${commons-fileupload.version}</version>
231 </dependency>
232
233 <dependency>
234 <groupId>com.alibaba</groupId>
235 <artifactId>fastjson</artifactId>
236 <version>1.2.33</version>
237 </dependency>
238
239 <dependency>
240 <groupId>org.apache.commons</groupId>
241 <artifactId>commons-lang3</artifactId>
242 <version>${org.apache.commons.version}</version>
243 </dependency>
244
245 <dependency>
246 <groupId>eu.medsea.mimeutil</groupId>
247 <artifactId>mime-util</artifactId>
248 <version>${eu.medsea.mimeutil.version}</version>
249 </dependency>
250 <dependency>
251 <groupId>com.google.code.gson</groupId>
252 <artifactId>gson</artifactId>
253 <version>${com.google.gson.version}</version>
254 </dependency>
255
256
257 <!-- <dependency>
258 <groupId>javabuilder</groupId>
259 <artifactId>javabuilder_rt</artifactId>
260 <version>2.0</version>
261 <scope>system</scope>
262 <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/rt.jar</systemPath>
263 </dependency>
264
265
266 <dependency>
267 <groupId>javabuilder</groupId>
268 <artifactId>javabuilder11_jce</artifactId>
269 <version>0.0.1-SNAPSHOT</version>
270 <scope>system</scope>
271 <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jce.jar</systemPath>
272 </dependency> -->
273
274 <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
275 <dependency>
276 <groupId>com.thoughtworks.xstream</groupId>
277 <artifactId>xstream</artifactId>
278 <version>${com.thoughtworks.xstream.version}</version>
279 </dependency>
280
281 <!-- LOGGING begin -->
282 <dependency>
283 <groupId>org.slf4j</groupId>
284 <artifactId>slf4j-api</artifactId>
285 <version>${slf4j.version}</version>
286 </dependency>
287 <dependency>
288 <groupId>org.slf4j</groupId>
289 <artifactId>slf4j-log4j12</artifactId>
290 <version>${slf4j.version}</version>
291 </dependency>
292
293 <!-- logback -->
294 <dependency>
295 <groupId>org.slf4j</groupId>
296 <artifactId>slf4j-api</artifactId>
297 <version>${org.slf4j.version}</version>
298 </dependency>
299
300 <dependency>
301 <groupId>ch.qos.logback</groupId>
302 <artifactId>logback-core</artifactId>
303 <version>${ch.qos.logback.version}</version>
304 </dependency>
305 <dependency>
306 <groupId>ch.qos.logback</groupId>
307 <artifactId>logback-access</artifactId>
308 <version>${ch.qos.logback.version}</version>
309 </dependency>
310 <dependency>
311 <groupId>ch.qos.logback</groupId>
312 <artifactId>logback-classic</artifactId>
313 <version>${ch.qos.logback.version}</version>
314 </dependency>
315
316 <!-- Apache POI: start -->
317 <dependency>
318 <groupId>org.apache.poi</groupId>
319 <artifactId>poi</artifactId>
320 <version>${org.apache.poi.version}</version>
321 </dependency>
322
323 <dependency>
324 <groupId>org.apache.poi</groupId>
325 <artifactId>poi-ooxml</artifactId>
326 <version>${org.apache.poi.version}</version>
327 </dependency>
328 <dependency>
329 <groupId>org.apache.poi</groupId>
330 <artifactId>poi-excelant</artifactId>
331 <version>${org.apache.poi.version}</version>
332 </dependency>
333 <dependency>
334 <groupId>org.apache.poi</groupId>
335 <artifactId>poi-examples</artifactId>
336 <version>${org.apache.poi.version}</version>
337 </dependency>
338 <dependency>
339 <groupId>org.apache.poi</groupId>
340 <artifactId>poi-scratchpad</artifactId>
341 <version>${org.apache.poi.version}</version>
342 </dependency>
343 <dependency>
344 <groupId>org.apache.xmlbeans</groupId>
345 <artifactId>xmlbeans</artifactId>
346 <version>${org.apache.xmlbeans.version}</version>
347 </dependency>
348 <dependency>
349 <groupId>org.apache.poi</groupId>
350 <artifactId>openxml4j</artifactId>
351 <version>${org.apache.poi.openxml4j.version}</version>
352 </dependency>
353
354
355 <!-- itextpdf -->
356 <dependency>
357 <groupId>com.itextpdf</groupId>
358 <artifactId>itextpdf</artifactId>
359 <version>${com.itextpdf.version}</version>
360 </dependency>
361 <dependency>
362 <groupId>com.itextpdf</groupId>
363 <artifactId>itext-asian</artifactId>
364 <version>${com.itextpdf.itext-asian.version}</version>
365 </dependency>
366 <!-- Zxing -->
367 <dependency>
368 <groupId>com.google.zxing</groupId>
369 <artifactId>javase</artifactId>
370 <version>${com.google.zxing.version}</version>
371 </dependency>
372 <dependency>
373 <groupId>dom4j</groupId>
374 <artifactId>dom4j</artifactId>
375 <version>${dom4j.version}</version>
376 </dependency>
377
378 <!-- QRCode -->
379 <dependency>
380 <groupId>net.glxn</groupId>
381 <artifactId>qrgen</artifactId>
382 <version>${qrcode.version}</version>
383 </dependency>
384
385 <dependency>
386 <groupId>mysql</groupId>
387 <artifactId>mysql-connector-java</artifactId>
388 <version>${mysql.driver.version}</version>
389 <scope>runtime</scope>
390 </dependency>
391
392 <!-- MyBatis -->
393 <dependency>
394 <groupId>org.mybatis</groupId>
395 <artifactId>mybatis</artifactId>
396 <version>${mybatis.version}</version>
397 </dependency>
398 <dependency>
399 <groupId>org.mybatis</groupId>
400 <artifactId>mybatis-spring</artifactId>
401 <version>${mybatis-spring.version}</version>
402 </dependency>
403
404 <dependency>
405 <groupId>org.apache.httpcomponents</groupId>
406 <artifactId>httpmime</artifactId>
407 <version>4.5.2</version>
408 </dependency>
409
410 <dependency>
411 <groupId>junit</groupId>
412 <artifactId>junit</artifactId>
413 <version>4.7</version>
414 </dependency>
415
416 </dependencies>
417
418
419 <!--构建设置 -->
420 <build>
421 <finalName>${project.artifactId}</finalName>
422 <resources>
423 <resource>
424 <directory>src/main/resources</directory>
425 <filtering>true</filtering>
426 <includes>
427 <include>**/*.*</include>
428 </includes>
429 </resource>
430 <resource>
431 <directory>src/main/java</directory>
432 <includes>
433 <include>**/*.xml</include>
434 </includes>
435 <filtering>true</filtering>
436 </resource>
437 <resource>
438 <directory>conf/${package.environment}</directory>
439 <filtering>true</filtering>
440 <includes>
441 <include>*.*</include>
442 </includes>
443 </resource>
444 </resources>
445 <plugins>
446
447 <!-- insert jetty class(compiler) -->
448 <!-- 指定war包的执行入口-->
449 <plugin>
450 <groupId>org.apache.maven.plugins</groupId>
451 <artifactId>maven-war-plugin</artifactId>
452 <version>2.3</version>
453 <configuration>
454 <archive>
455 <manifest>
456 <mainClass>Runner</mainClass>
457 </manifest>
458 </archive>
459 </configuration>
460 </plugin>
461 <plugin>
462 <groupId>org.apache.maven.plugins</groupId>
463 <artifactId>maven-war-plugin</artifactId>
464 <configuration>
465 <failOnMissingWebXml>false</failOnMissingWebXml>
466 </configuration>
467 </plugin>
468 <!-- 将Runner移动到Meta-info下面-->
469 <plugin>
470 <groupId>org.apache.maven.plugins</groupId>
471 <artifactId>maven-antrun-plugin</artifactId>
472 <version>1.7</version>
473 <executions>
474 <execution>
475 <id>main-class-placement</id>
476 <phase>prepare-package</phase>
477 <configuration>
478 <target>
479 <move todir="${project.build.directory}/${project.artifactId}-${project.version}-${package.environment}/">
480 <fileset dir="${project.build.directory}/classes/">
481 <include name="Runner.class" />
482 </fileset>
483 </move>
484 </target>
485 </configuration>
486 <goals>
487 <goal>run</goal>
488 </goals>
489 </execution>
490 </executions>
491 </plugin>
492
493
494 <plugin>
495 <groupId>org.apache.maven.plugins</groupId>
496 <artifactId>maven-compiler-plugin</artifactId>
497 <configuration>
498 <source>1.6</source>
499 <target>1.6</target>
500 <encoding>UTF-8</encoding>
501 <compilerArguments>
502 <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
503 </compilerArguments>
504 </configuration>
505 </plugin>
506
507 <!-- <plugin>
508 <artifactId>maven-compiler-plugin</artifactId>
509 <version>2.3.2</version>
510 <configuration>
511 <source>1.6</source>
512 <target>1.6</target>
513 <encoding>UTF-8</encoding>
514 <optimize>true</optimize>
515 <debug>true</debug>
516 <showDeprecation>true</showDeprecation>
517 <showWarnings>false</showWarnings>
518 <compilerArguments>
519 <verbose />
520 <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
521 </compilerArguments>
522 </configuration>
523 </plugin> -->
524
525 <!-- tomcat7插件 -->
526 <plugin>
527 <groupId>org.apache.tomcat.maven</groupId>
528 <artifactId>tomcat7-maven-plugin</artifactId>
529 <version>${tomcat.version}</version>
530 <configuration>
531 <port>${webserver.port}</port>
532 <path>/${project.artifactId}</path>
533 <uriEncoding>${project.build.sourceEncoding}</uriEncoding>
534 </configuration>
535 </plugin>
536 </plugins>
537 </build>
538 </project>
1 package com.phxl.modules.goods.dao.ctcareprov;
2
3 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
4
5 import java.util.List;
6 import java.util.Map;
7
8 /**
9 *
10 * @ClassName: CTCareProvDao
11 * @Description: CTCareProv数据访问接口
12 * @author wangsenyong
13 * @date 2018-08-08 13:37:21
14 *
15 */
16 public interface CTCareProvDao{
17
18 /**
19 * 过滤已添加的用户
20 * @return
21 */
22 List<CTCareProv> getFilterCarProv();
23
24 List<CTCareProv> batchSelect(Map<String, Object> map);
25
26 void batchUpdate(List<CTCareProv> updateList);
27
28 void batchInsert(List<CTCareProv> insertList);
29
30
31 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.common.util;
2
3 import org.apache.http.HttpEntity;
4 import org.apache.http.HttpResponse;
5 import org.apache.http.client.HttpClient;
6 import org.apache.http.client.methods.HttpPost;
7 import org.apache.http.entity.StringEntity;
8 import org.apache.http.impl.client.HttpClients;
9 import org.apache.http.util.EntityUtils;
10
11 import com.alibaba.fastjson.JSON;
12 import com.phxl.common.response.PlatFormResponse;
13 import com.phxl.common.response.PlatFormResponseConstant;
14
15 public class HTTPClient {
16
17 private static HttpClient client;
18
19 //使用POST方法发送JSON数据
20 public static String sendJsonDataByPost(String url, String jsonData) throws Exception {
21 String result = "";
22 PlatFormResponse platFormResponse = new PlatFormResponse();
23 if (client == null){
24 client = HttpClients.createDefault();
25 }
26 try {
27 HttpPost post = new HttpPost(url);
28 post.setHeader("Content-Type", "application/json");
29 StringEntity entity1 = new StringEntity(jsonData,"UTF-8");
30 post.setEntity(entity1);
31 HttpResponse response = client.execute(post);
32 HttpEntity entity = response.getEntity();
33 result = EntityUtils.toString(entity, "UTF-8");
34 } catch (Exception e) {
35 platFormResponse.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
36 platFormResponse.setMsg(e.getMessage());
37 result = JSON.toJSONString(platFormResponse);
38 }
39 return result;
40 }
41
42
43
44 }
45
1 package com.phxl.modules.goods.web.spd;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.servlet.http.HttpServletRequest;
8
9 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
10
11 import org.apache.http.HttpEntity;
12 import org.apache.http.HttpResponse;
13 import org.apache.http.client.HttpClient;
14 import org.apache.http.client.methods.HttpPost;
15 import org.apache.http.impl.client.HttpClients;
16 import org.apache.http.util.EntityUtils;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
19 import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.stereotype.Controller;
21 import org.springframework.web.bind.annotation.RequestBody;
22 import org.springframework.web.bind.annotation.RequestMapping;
23 import org.springframework.web.bind.annotation.RequestMethod;
24 import org.springframework.web.bind.annotation.RequestParam;
25 import org.springframework.web.bind.annotation.ResponseBody;
26 import org.springframework.web.multipart.MultipartFile;
27
28 import com.alibaba.fastjson.JSON;
29 import com.alibaba.fastjson.JSONObject;
30 import com.alibaba.fastjson.serializer.SerializerFeature;
31 import com.fasterxml.jackson.annotation.JsonFormat;
32 import com.phxl.common.constants.PlatformConstant;
33 import com.phxl.common.response.PlatFormResponse;
34 import com.phxl.common.response.PlatFormResponseConstant;
35 import com.phxl.common.util.HTTPClient;
36 import com.phxl.common.util.JsonMapper;
37 import com.phxl.common.utils.IdUtil;
38 import com.phxl.modules.goods.entity.billback.BillBack;
39 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
40 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
41 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
42 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
43 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
44 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
45 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
46 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
47 import com.phxl.modules.goods.entity.medplan.MedPlan;
48 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
49 import com.phxl.modules.goods.entity.medstock.MedStock;
50 import com.phxl.modules.goods.entity.medstock.MedStockList;
51 import com.phxl.modules.goods.entity.spills.HisSpills;
52 import com.phxl.modules.goods.entity.spills.HisSpillsList;
53 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
54 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
55 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
56 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
57 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
58 import com.phxl.modules.goods.service.billback.BillBackService;
59 import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
60 import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
61 import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
62 import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
63 import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
64 import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
65 import com.phxl.modules.goods.service.medinstore.MedInStoreService;
66 import com.phxl.modules.goods.service.medplan.MedPlanService;
67 import com.phxl.modules.goods.service.medstock.MedStockService;
68 import com.phxl.modules.goods.service.spills.HisSpillsService;
69 import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
70 import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
71 import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
72
73 @Controller
74 @RequestMapping(value = "/Api")
75 public class SpdControlller {
76
77 /**
78 * 日志对象
79 */
80 protected Logger logger = LoggerFactory.getLogger(getClass());
81
82 @Autowired
83 private HisCtMedicineMaterialService ctMedicineMaterialService;
84
85 @Autowired
86 private InterfaceLogService interfaceLogService;
87
88 @Autowired
89 private HisCtDeptService hisCtDeptService;
90
91 @Autowired
92 private CTCareProvService cTCareProvService;
93
94 @Autowired
95 private MedSupplyGoodsService supplyGoodsService;
96
97 @Autowired
98 private MedStockService stockService;
99
100 @Autowired
101 private MedPlanService medPlanService;
102
103 @Autowired
104 private MedInStoreService medInStoreService;
105
106 @Autowired
107 private BillBackService backService;
108
109 @Autowired
110 private BillSettlementService billSettlementService;
111
112 @Autowired
113 private SupplierStockService supplierStockService;
114
115 @Autowired
116 private SuOutStoreService suOutStoreService;
117
118 @Autowired
119 private HisSpillsService hisSpillsService;
120
121 @Autowired
122 private SuInvoiceBackService suInvoiceBackService;
123
124
125 @RequestMapping(value="/setMFMedGoods")
126 @ResponseBody
127 public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
128 logger.debug("药品目录接口请求参数:{}",medgoodsList);
129 String result = "";
130 String logId = IdUtil.uuid();
131 String exception = "";
132 interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
133 PlatFormResponse response = new PlatFormResponse();
134 List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
135 try {
136 materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
137 for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
138 ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
139 }
140 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
141 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
142 result = JSON.toJSONString(response);
143 //medgoodsList = ctMedicineMaterialService.createRequest();
144 //供应商服务请求:
145 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
146 } catch (Exception e) {
147 logger.error(e.getMessage());
148 exception = e.getMessage();
149 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
150 response.setMsg(e.getMessage());
151 result = JSON.toJSONString(response);
152 }
153 interfaceLogService.setResultLog(response, logId, exception);
154 return result;
155 }
156
157 @RequestMapping(value="/setHDept")
158 @ResponseBody
159 public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
160 logger.debug("医院科室资料接口请求参数:{}",params);
161 String result = "";
162 String logId = IdUtil.uuid();
163 String exception = "";
164 interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
165 PlatFormResponse response = new PlatFormResponse();
166 List<HisCtDept> depts = new ArrayList<HisCtDept>();
167 try {
168 depts = JSONObject.parseArray(params, HisCtDept.class);
169 int end = hisCtDeptService.batchSaveOrUpdate(depts);
170 if(end==1){
171 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
172 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
173 }else{
174 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
175 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
176 }
177 result = JSON.toJSONString(response);
178 //供应商服务请求:
179 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
180 } catch (Exception e) {
181 logger.error(e.getMessage());
182 exception = e.getMessage();
183 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
184 response.setMsg(e.getMessage());
185 result = JSON.toJSONString(response);
186 }
187 interfaceLogService.setResultLog(response, logId, exception);
188 return result;
189 }
190
191 /**
192 * 医院人员资料接口
193 * @param request
194 * @param params
195 * @return
196 */
197 @RequestMapping("/setMedStaff")
198 @ResponseBody
199 public String setMedStaff(HttpServletRequest request, @RequestBody String params){
200 logger.debug("医院人员资料接口请求参数:{}",params);
201 String result = "";
202 String logId = IdUtil.uuid();
203 String exception = "";
204 interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
205 PlatFormResponse response = new PlatFormResponse();
206 List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
207 boolean end = false;
208 try {
209 careProvs = JSONObject.parseArray(params, CTCareProv.class);
210 end = cTCareProvService.batchSaveOrUpdate(careProvs);
211 if(end){
212 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
213 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
214 }else{
215 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
216 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
217 }
218 result = JSON.toJSONString(response);
219 //供应商服务请求:
220 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
221 } catch (Exception e) {
222 logger.error(e.getMessage());
223 exception = e.getMessage();
224 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
225 response.setMsg(e.getMessage());
226 result = JSON.toJSONString(response);
227 }
228 interfaceLogService.setResultLog(response, logId, exception);
229 return result;
230 }
231
232
233 /**
234 * 医院采购目录接口
235 * @param request
236 * @param params
237 * @return
238 */
239 @RequestMapping("/setMFSupplyGoods")
240 @ResponseBody
241 public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
242 logger.debug("医院采购目录接口请求参数:{}",params);
243 String result = "";
244 String logId = IdUtil.uuid();
245 String exception = "";
246 interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
247 PlatFormResponse response = new PlatFormResponse();
248 List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
249 boolean end = false;
250 try {
251 supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
252 end = supplyGoodsService.batchSave(supplyGoods);
253 if(end){
254 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
255 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
256 }else{
257 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
258 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
259 }
260 result = JSON.toJSONString(response);
261 //供应商服务请求:
262 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
263 } catch (Exception e) {
264 logger.error(e.getMessage());
265 exception = e.getMessage();
266 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
267 response.setMsg(e.getMessage());
268 result = JSON.toJSONString(response);
269 }
270 interfaceLogService.setResultLog(response, logId, exception);
271 return result;
272 }
273
274
275 /**
276 * 医院库存接口
277 * @param request
278 * @param params
279 * @return
280 */
281 @ResponseBody
282 @RequestMapping(value="/setMedStock",method = RequestMethod.POST)
283 public String setMedStock(HttpServletRequest request, @RequestBody String params){
284 logger.debug("HLI同步医院库存数据请求参数:{}",params);
285 String result = "";
286 String logId = IdUtil.uuid();
287 String exception = "";
288 interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
289 PlatFormResponse response = new PlatFormResponse();
290 List<MedStockList> stocks = new ArrayList<MedStockList>();
291 boolean end = false;
292 try {
293 stocks = JSONObject.parseArray(params, MedStockList.class);
294 end = stockService.batchSave(stocks);
295 if(end){
296 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
297 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
298 }else{
299 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
300 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
301 }
302 result = JSON.toJSONString(response);
303 //供应商服务请求:
304 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
305 } catch (Exception e) {
306 logger.error(e.getMessage());
307 exception = e.getMessage();
308 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
309 response.setMsg(e.getMessage());
310 result = JSON.toJSONString(response);
311 }
312 interfaceLogService.setResultLog(response, logId, exception);
313 return result;
314 }
315
316
317 /**
318 * 医院补货计划接口
319 * @param request
320 * @param params
321 * @return
322 */
323 @RequestMapping("/setMedPlan")
324 @ResponseBody
325 public String setMedPlan(HttpServletRequest request, @RequestBody String params){
326 logger.debug("补货计划接口请求参数:{}",params);
327 String result = "";
328 String logId = IdUtil.uuid();
329 String exception = "";
330 interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
331 PlatFormResponse response = new PlatFormResponse();
332 List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
333 boolean end = false;
334 try {
335 //改成批量的操作
336 medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
337 end = medPlanService.batchSave(medPlans);
338 if(end){
339 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
340 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
341 }else{
342 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
343 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
344 }
345 result = JSON.toJSONString(response);
346 //供应商服务请求:
347 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
348 } catch (Exception e) {
349 logger.error(e.getMessage());
350 exception = e.getMessage();
351 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
352 response.setMsg(e.getMessage());
353 result = JSON.toJSONString(response);
354 }
355 interfaceLogService.setResultLog(response, logId, exception);
356 return result;
357 }
358
359
360 /**
361 * 医院退货接口
362 * @param request
363 * @param params
364 * @return
365 */
366 @RequestMapping("/setTRMedRPI")
367 @ResponseBody
368 public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
369 logger.debug("医院退货计划接口请求参数:{}",params);
370 String result = "";
371 String logId = IdUtil.uuid();
372 String exception = "";
373 interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
374 PlatFormResponse response = new PlatFormResponse();
375 List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
376 boolean end = false;
377 try {
378 billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
379 end = backService.batchSave(billBacks);
380 if(end){
381 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
382 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
383 }else{
384 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
385 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
386 }
387 result = JSON.toJSONString(response);
388 //供应商服务请求:
389 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
390 } catch (Exception e) {
391 logger.error(e.getMessage());
392 exception = e.getMessage();
393 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
394 response.setMsg(e.getMessage());
395 result = JSON.toJSONString(response);
396 }
397 interfaceLogService.setResultLog(response, logId, exception);
398 return result;
399 }
400
401 /**
402 * 结算单接口
403 * @param request
404 * @param params
405 * @return
406 */
407 @RequestMapping("/setTRSettle")
408 @ResponseBody
409 public String setTRSettle(HttpServletRequest request, @RequestBody String params){
410 logger.debug("同步医院结算单请求参数:{}",params);
411 String result = "";
412 String logId = IdUtil.uuid();
413 String exception = "";
414 interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
415 PlatFormResponse response = new PlatFormResponse();
416 List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
417 boolean end = false;
418 try {
419 settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
420 end = billSettlementService.batchSave(settlementWithDetails);
421 if(end){
422 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
423 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
424 }else{
425 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
426 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
427 }
428 result = JSON.toJSONString(response);
429 //供应商服务请求:
430 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
431 } catch (Exception e) {
432 logger.error(e.getMessage());
433 exception = e.getMessage();
434 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
435 response.setMsg(e.getMessage());
436 result = JSON.toJSONString(response);
437 }
438 interfaceLogService.setResultLog(response, logId, exception);
439 return result;
440 }
441
442
443 /**
444 * 供应商库存接口
445 * @param request
446 * @param params
447 * @return
448 */
449 @RequestMapping("/setStock")
450 @ResponseBody
451 public String setStock(HttpServletRequest request, @RequestBody String params){
452 logger.debug("供应商同步库存数据请求参数:{}",params);
453 String result = "";
454 String logId = IdUtil.uuid();
455 String exception = "";
456 interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
457 PlatFormResponse response = new PlatFormResponse();
458 List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
459 boolean end = false;
460 try {
461 supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
462 end = supplierStockService.batchSave(supplierStocks);
463 if(end){
464 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
465 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
466 }else{
467 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
468 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
469 }
470 result = JSON.toJSONString(response);
471 try
472 {
473 //SPD服务请求:
474 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
475 response = JSONObject.parseObject(result,PlatFormResponse.class);
476 response.setMsg("SPD:"+response.getMsg());
477 }
478 catch(Exception ex){
479 logger.error("SPD:"+ex.getMessage());
480 exception = "SPD:"+ex.getMessage();
481 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
482 response.setMsg("SPD:"+ex.getMessage());
483 result = JSON.toJSONString(response);
484 }
485
486 } catch (Exception e) {
487 logger.error("前置机:"+e.getMessage());
488 exception = "前置机:"+e.getMessage();
489 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
490 response.setMsg("前置机:"+e.getMessage());
491 result = JSON.toJSONString(response);
492 }
493 interfaceLogService.setResultLog(response, logId, exception);
494 return result;
495 }
496
497
498 /**
499 * 供应商出库单接口
500 * @param request
501 * @param params
502 * @return
503 */
504 @RequestMapping("/setTrmedwv")
505 @ResponseBody
506 public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
507 logger.debug("同步供应商出库单请求参数:{}",params);
508 String result = "";
509 String logId = IdUtil.uuid();
510 String exception = "";
511 interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
512 PlatFormResponse response = new PlatFormResponse();
513 List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
514 boolean end = false;
515 try {
516 suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
517 end = suOutStoreService.batchSave(suOutStores);
518 if(end){
519 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
520 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
521 }else{
522 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
523 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
524 }
525 result = JSON.toJSONString(response);
526 try
527 {
528 //SPD服务请求:
529 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
530 response = JSONObject.parseObject(result,PlatFormResponse.class);
531 response.setMsg("SPD:"+response.getMsg());
532 }
533 catch(Exception ex){
534 logger.error("SPD:"+ex.getMessage());
535 exception = "SPD:"+ex.getMessage();
536 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
537 response.setMsg("SPD:"+ex.getMessage());
538 result = JSON.toJSONString(response);
539 }
540
541 } catch (Exception e) {
542 logger.error("前置机:"+e.getMessage());
543 exception = "前置机:"+e.getMessage();
544 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
545 response.setMsg("前置机:"+e.getMessage());
546 result = JSON.toJSONString(response);
547 }
548 interfaceLogService.setResultLog(response, logId, exception);
549 return result;
550 }
551
552 /**
553 * 医院盘点损溢接口
554 * @param request
555 * @param params
556 * @return
557 */
558 @RequestMapping(value="/setTrDiff")
559 @ResponseBody
560 public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
561 logger.debug("医院盘点损溢接口请求参数:{}",params);
562 String result = "";
563 String logId = IdUtil.uuid();
564 String exception = "";
565 interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
566 PlatFormResponse response = new PlatFormResponse();
567 List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
568 boolean end = false;
569 try {
570 spills = JSONObject.parseArray(params, HisSpillsList.class);
571 end = hisSpillsService.batchSave(spills);
572 if(end){
573 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
574 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
575 }else{
576 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
577 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
578 }
579 result = JSON.toJSONString(response);
580 //供应商服务请求:
581 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
582 } catch (Exception e) {
583 logger.error(e.getMessage());
584 exception = e.getMessage();
585 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
586 response.setMsg(e.getMessage());
587 result = JSON.toJSONString(response);
588 }
589 interfaceLogService.setResultLog(response, logId, exception);
590 return result;
591 }
592
593
594 /**
595 * 供应商发票回传接口
596 * @param request
597 * @param params
598 * @return
599 */
600 @RequestMapping("/setInvoice")
601 @ResponseBody
602 public String setInvoice(HttpServletRequest request, @RequestBody String params){
603 logger.debug("供应商发票回传接口请求参数:{}",params);
604 String result = "";
605 String logId = IdUtil.uuid();
606 String exception = "";
607 interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
608 PlatFormResponse response = new PlatFormResponse();
609 List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
610 boolean end = false;
611 try {
612 suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
613 end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
614 if(end){
615 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
616 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
617 }else{
618 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
619 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
620 }
621 result = JSON.toJSONString(response);
622 try
623 {
624 //SPD服务请求:
625 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
626 response = JSONObject.parseObject(result,PlatFormResponse.class);
627 response.setMsg("SPD:"+response.getMsg());
628 }
629 catch(Exception ex){
630 logger.error("SPD:"+ex.getMessage());
631 exception = "SPD:"+ex.getMessage();
632 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
633 response.setMsg("SPD:"+ex.getMessage());
634 result = JSON.toJSONString(response);
635 }
636
637 } catch (Exception e) {
638 logger.error("前置机:"+e.getMessage());
639 exception = "前置机:"+e.getMessage();
640 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
641 response.setMsg("前置机:"+e.getMessage());
642 result = JSON.toJSONString(response);
643 }
644 interfaceLogService.setResultLog(response, logId, exception);
645 return result;
646 }
647
648 /*
649 * 医院入库单回传接口
650 * @param request
651 * @param params
652 * @return
653 */
654 @RequestMapping("/setMedInStore")
655 @ResponseBody
656 public String setMedInStore(HttpServletRequest request, @RequestBody String params){
657 logger.debug("医院入库单回传接口请求参数:{}",params);
658 String result = "";
659 String logId = IdUtil.uuid();
660 String exception = "";
661 interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
662 PlatFormResponse response = new PlatFormResponse();
663 List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
664 boolean end = false;
665 try {
666 //改成批量的操作
667 medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
668 end = medInStoreService.batchSave(medInStores);
669 if(end){
670 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
671 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
672 }else{
673 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
674 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
675 }
676 result = JSON.toJSONString(response);
677 //供应商服务请求:
678 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
679 } catch (Exception e) {
680 logger.error(e.getMessage());
681 exception = e.getMessage();
682 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
683 response.setMsg(e.getMessage());
684 result = JSON.toJSONString(response);
685 }
686 interfaceLogService.setResultLog(response, logId, exception);
687 return result;
688 }
689
690 /***
691 * 推送对账数据到平台
692 * @param params
693 * @return
694 */
695 @RequestMapping("/pushBalance")
696 @ResponseBody
697 public String pushBalance(@RequestBody String params) {
698 logger.debug("推送对账数据:{}", params);
699 String result = "";
700 String logId = IdUtil.uuid();
701 String exception = "";
702 interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
703 PlatFormResponse response = new PlatFormResponse();
704 try {
705 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
706 JSONObject jsonObject = JSONObject.parseObject(result);
707 if(jsonObject.getIntValue("errorCode") != 0){
708 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
709 }else {
710 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
711 }
712 response.setMsg(jsonObject.getString("message"));
713 } catch (Exception e) {
714 logger.error(e.getMessage());
715 exception = e.getMessage();
716 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
717 response.setMsg("发送对账数据给平台错误:" + e.getMessage());
718 result = JSON.toJSONString(response);
719 }
720 interfaceLogService.setResultLog(response, logId, exception);
721 return result;
722
723 }
724
725
726 /**
727 * 推送发药数据到平台
728 * @param params
729 * @return
730 */
731 @RequestMapping("/pushDispensing")
732 @ResponseBody
733 public String pushDispensing(@RequestBody String params){
734 logger.debug("推送发药数据:{}", params);
735 String result = "";
736 String logId = IdUtil.uuid();
737 String exception = "";
738 interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
739 PlatFormResponse response = new PlatFormResponse();
740 try {
741 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
742 JSONObject jsonObject = JSONObject.parseObject(result);
743 if(jsonObject.getIntValue("errorCode") != 0){
744 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
745 }else {
746 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
747 }
748 response.setMsg(jsonObject.getString("message"));
749 } catch (Exception e) {
750 logger.error(e.getMessage());
751 exception = e.getMessage();
752 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
753 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
754 result = JSON.toJSONString(response);
755 }
756 interfaceLogService.setResultLog(response, logId, exception);
757 return result;
758 }
759
760
761 /**
762 * 推送库存数据到平台
763 * @param params
764 * @return
765 */
766 @RequestMapping("/pushStock")
767 @ResponseBody
768 public String pushStock(@RequestBody String params){
769 logger.debug("推送库存数据:{}", params);
770 String result = "";
771 String logId = IdUtil.uuid();
772 String exception = "";
773 interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
774 PlatFormResponse response = new PlatFormResponse();
775 try {
776 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
777 JSONObject jsonObject = JSONObject.parseObject(result);
778 if(jsonObject.getIntValue("errorCode") != 0){
779 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
780 }else {
781 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
782 }
783 response.setMsg(jsonObject.getString("message"));
784 } catch (Exception e) {
785 logger.error(e.getMessage());
786 exception = e.getMessage();
787 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
788 response.setMsg("发送库存数据给平台错误:" + e.getMessage());
789 result = JSON.toJSONString(response);
790 }
791 interfaceLogService.setResultLog(response, logId, exception);
792 return result;
793 }
794
795 /**
796 * 推送证照数据到平台
797 * @param params
798 * @return
799 */
800 @RequestMapping("/pushlicinfo")
801 @ResponseBody
802 public String pushlicinfo(@RequestBody String params){
803 logger.debug("证照数据:{}", params);
804 String result = "";
805 String logId = IdUtil.uuid();
806 String exception = "";
807 interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
808 PlatFormResponse response = new PlatFormResponse();
809 try {
810 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
811 JSONObject jsonObject = JSONObject.parseObject(result);
812 if(jsonObject.getIntValue("errorCode") != 0){
813 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
814 }else {
815 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
816 }
817 response.setMsg(jsonObject.getString("message"));
818 } catch (Exception e) {
819 logger.error(e.getMessage());
820 exception = e.getMessage();
821 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
822 response.setMsg("发送证照数据给平台错误:" + e.getMessage());
823 result = JSON.toJSONString(response);
824 }
825 interfaceLogService.setResultLog(response, logId, exception);
826 return result;
827 }
828
829
830 /**
831 * 推送证照图片数据到平台
832 * @param params
833 * @return
834 */
835 @RequestMapping("/pushlicpicinfo")
836 @ResponseBody
837 public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
838 String result = "";
839 String logId = IdUtil.uuid();
840 String exception = "";
841 PlatFormResponse response = new PlatFormResponse();
842 try {
843 if (file!=null) {
844 HttpClient client = HttpClients.createDefault();
845 HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
846 HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", file).build();
847 post.setEntity(reqEntity);
848 HttpResponse htppresponse = client.execute(post);
849 HttpEntity resEntity = htppresponse.getEntity();
850 result = EntityUtils.toString(resEntity, "UTF-8");
851 JSONObject jsonObject = JSONObject.parseObject(result);
852 if(jsonObject.getIntValue("errorCode") != 0){
853 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
854 }else {
855 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
856 }
857 response.setMsg(jsonObject.getString("message"));
858 }else{
859 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
860 response.setMsg("发送发药数据给平台错误:参数为空");
861 }
862
863 } catch (Exception e) {
864 logger.error(e.getMessage());
865 exception = e.getMessage();
866 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
867 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
868 result = JSON.toJSONString(response);
869 }
870 interfaceLogService.setResultLog(response, logId, exception);
871 return result;
872 }
873 }
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>出库单打印(三联单)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}物资出库单</h3></td>
13 </tr>
14 </table>
15 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
16 <tr>
17 <td width="21%" height="15">领用科室:${deptName}</td>
18 <td width="17%" height="15">出库日期:${outTime}</td>
19 <td width="27%" height="15">出库单号:${outNo}</td>
20 </tr>
21 <tr>
22 <td width="21%" height="15">拣货单号:${pickNo}</td>
23 <td width="17%" height="15">送货单号:${sendNo}</td>
24 <td width="27%" height="15">单位:元</td>
25 </tr>
26 <tr>
27
28 </tr>
29 </table>
30 </div>
31 <div>
32 <table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
33 <tr style="height: 18px;">
34 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
35 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
36 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-right:1px solid #000000;border-top:1px solid #000000;" width="130">财务分类</td>
42 </tr>
43 ${tableContent}
44 </table>
45 </div>
46 <div>
47 ${afterTable
48 <table width="100%" border="0" cellspacing="0" cellpadding="0">
49 <tr height="20px;">
50 <td width="25%" align="left"></td>
51 <td width="25%" align="left"></td>
52 <td width="21%" align="left"></td>
53 <td width="28%" align="left">合计金额:${totalPrice}</td>
54 </tr>
55 <tr height="20px;">
56 <td width="25%" align="left">制单人:${userName}</td>
57 <td width="25%" align="left">会计:</td>
58 <td width="21%" align="left">保管:</td>
59 <td width="28%" align="left">经办人:</td>
60 </tr>
61 </table>
62 }
63 </div>
64 </div>
65 </body>
66 </html>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.common.util;
2
3 import java.io.FileNotFoundException;
4 import java.io.IOException;
5 import java.io.InputStream;
6 import java.io.OutputStream;
7 import java.lang.reflect.Field;
8 import java.lang.reflect.Method;
9 import java.text.DateFormat;
10 import java.text.DecimalFormat;
11 import java.text.SimpleDateFormat;
12 import java.util.ArrayList;
13 import java.util.Date;
14 import java.util.HashMap;
15 import java.util.List;
16 import java.util.Locale;
17 import java.util.Map;
18
19 import javax.servlet.http.HttpServletResponse;
20
21 import org.apache.commons.collections.CollectionUtils;
22 import org.apache.commons.collections.MapUtils;
23 import org.apache.commons.lang.StringUtils;
24 import org.apache.poi.hssf.usermodel.HSSFCell;
25 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
26 import org.apache.poi.hssf.usermodel.HSSFFont;
27 import org.apache.poi.hssf.usermodel.HSSFRow;
28 import org.apache.poi.hssf.usermodel.HSSFSheet;
29 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
30 import org.apache.poi.hssf.util.HSSFColor;
31 import org.apache.poi.ss.usermodel.Cell;
32 import org.apache.poi.ss.usermodel.DateUtil;
33 import org.apache.poi.ss.usermodel.Row;
34 import org.apache.poi.ss.usermodel.Sheet;
35 import org.apache.poi.ss.usermodel.Workbook;
36 import org.apache.poi.ss.util.CellRangeAddress;
37 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory;
40 import org.springframework.web.multipart.MultipartFile;
41
42
43 /**
44 * 常用数据视图导出导入工具
45 * @version 1.0
46 */
47 public class ExportUtil<T> {
48
49 public final static Logger logger = LoggerFactory.getLogger(ExportUtil.class);
50 //导入excel版本
51 private final static String XLS = "xls";
52 private final static String XLSX = "xlsx";
53 /**
54 * 根据给定数据源,导出EXCEL文档
55 * @param response HttpServletResponse
56 * @param fieldName excel每一列的表头.
57 * @param dataList excel数据,其中的key和表头中的值对应,value为数据
58 * @param title 表格标题,在表格最上面
59 * @param before 表格页眉(比如制单时间,科室之类的数据),紧跟标题,list中的值由逗号(英文)分隔数据(单元格),每一个String为一排
60 * @param after 表格页尾(比如制单时间,科室之类的数据),在表格末尾,list中的值由逗号(英文)分隔数据(单元格),每一个String为一排
61 * @param formatMap 数据格式,其中的key和表头中的key对应,value是格式编码。(如果为日期,则传日期格式yyyy-MM-dd之类的,
62 * 如果是数字,想保留小数位数,保留1位小数传0.0,保留2位小数传0.00,以此类推)
63 * @param excelName
64 * @throws Exception
65 */
66 public static void exportExcel(HttpServletResponse response, List<String> fieldName,
67 List<Map<String, Object>> dataList, Map<String, String> formatMap, String title, List<String> before,
68 List<String> after, String excelName) throws Exception {
69 HSSFWorkbook workbook = new HSSFWorkbook();
70 HSSFSheet sheet = workbook.createSheet(title);
71
72 /**样式定义*/
73 //居中样式
74 HSSFCellStyle centerStyle = workbook.createCellStyle();//设置格式
75 centerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//居中
76 centerStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
77 //居中样式
78 HSSFCellStyle rightStyle = workbook.createCellStyle();//设置格式
79 rightStyle.setAlignment(HSSFCellStyle.ALIGN_RIGHT);//右对齐
80 rightStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
81 //创建顶部标题样式
82 HSSFCellStyle cellTitleStyle = workbook.createCellStyle();
83 cellTitleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
84 cellTitleStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
85 //创建顶部标题字体
86 HSSFFont fontTitle = workbook.createFont();
87 //fontTitle.setFontName("宋体");
88 fontTitle.setFontHeightInPoints((short) 16);
89 fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
90 cellTitleStyle.setFont(fontTitle);
91 //表头列名样式
92 HSSFCellStyle colNameStype = workbook.createCellStyle();
93 colNameStype.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
94 colNameStype.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
95 colNameStype.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);//灰色25
96 colNameStype.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);//填充
97
98 /**表名(大标题)*/
99 for (int i=0; i<fieldName.size(); i++) {
100 sheet.setDefaultColumnStyle(i, centerStyle);
101 sheet.setColumnWidth(i, 4500);
102 }
103
104 /**创建标题*/
105 int rowNum = 0;//第一行
106 HSSFRow rowTitle = sheet.createRow(rowNum++);
107 rowTitle.setHeightInPoints(40);
108 HSSFCell cellTitle = rowTitle.createCell(0);//表名单元格
109 cellTitle.setCellValue(title);
110 cellTitle.setCellStyle(cellTitleStyle);
111 sheet.addMergedRegion(new CellRangeAddress(0, (short) 0, 0, (short) (fieldName.size()-1)));
112
113 if (CollectionUtils.isNotEmpty(before)) {
114 //创建页眉
115 for (String item : before) {
116 HSSFRow rowHeader = sheet.createRow(rowNum++);
117 rowHeader.setHeightInPoints(18);
118 if (StringUtils.isEmpty(item)) {
119 continue;
120 }
121 String[] strs = item.split(",");
122 for (int i = 0; i < strs.length; i++) {
123 HSSFCell cell = rowHeader.createCell(i);//创建单元格
124 cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
125 cell.setCellValue(strs[i]);
126 }
127 }
128 }
129
130 //创建表格列表(DataList)列标
131 HSSFRow rowTableHead = sheet.createRow(rowNum++);
132 rowTableHead.setHeight((short)400);
133 for (int i = 0; i < fieldName.size(); i++) {
134 HSSFCell cell = rowTableHead.createCell(i);//创建单元格
135 cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
136 cell.setCellValue(fieldName.get(i));
137 cell.setCellStyle(colNameStype);
138 }
139
140 //创建表格列表(DataList)数据区域
141 for (int i=0; i<dataList.size(); i++) {
142 HSSFRow row = sheet.createRow(rowNum++);//创建行
143 row.setHeight((short)400);
144 for (int j = 0; j < fieldName.size(); j++) {
145 HSSFCell cell = row.createCell(j);//创建单元格
146 cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
147 Object columnValue = dataList.get(i).get(fieldName.get(j));//数据
148 String columnValueFomart = MapUtils.isEmpty(formatMap)? null : formatMap.get(fieldName.get(j));//数据格式
149 if (columnValue instanceof Date) {
150 //日期格式化
151 if (StringUtils.isBlank(columnValueFomart)) {
152 columnValueFomart = DateUtils.TIME_FORMAT;
153 }
154 cell.setCellValue(DateUtils.format((Date)columnValue, columnValueFomart));
155 } else if (columnValue instanceof Number) {
156 //数字格式化
157 if (null == columnValueFomart) {
158 cell.setCellValue(columnValue.toString());
159 } else {
160 DecimalFormat df1 = new DecimalFormat(columnValueFomart);
161 cell.setCellValue(df1.format(columnValue));
162 }
163 cell.setCellStyle(rightStyle);
164 } else {
165 cell.setCellValue(columnValue==null ? "" : columnValue.toString());
166 }
167 }
168 }
169
170 if (CollectionUtils.isNotEmpty(after)) {
171 // 创建页尾
172 for (String string : after) {
173 HSSFRow fieldRows = sheet.createRow(rowNum);
174 rowNum++;
175 if (StringUtils.isEmpty(string)) {
176 continue;
177 }
178 String[] strs = string.split(",");
179 for (int i = 0; i < strs.length; i++) {
180 // 创建单元格
181 HSSFCell cell = fieldRows.createCell(i);
182
183 // 定义单元格为字符串类型
184 cell.setCellType(HSSFCell.CELL_TYPE_STRING);
185 cell.setCellValue(strs[i]);
186 }
187 }
188 }
189 //导出Excel文件流到浏览器
190 sendExcel(response, workbook, excelName);
191 }
192
193 /**
194 * 导出Excel文件流到浏览器
195 * @param response
196 * @param workbook
197 * @param excelName
198 * @throws Exception
199 * @return void
200 */
201 public static void sendExcel(HttpServletResponse response, HSSFWorkbook workbook, String excelName) throws Exception {
202 if (workbook != null) {
203 response.setContentType("application/vnd.ms-excel");
204 response.setHeader("Content-disposition", "attachment;filename=" + new String(excelName.getBytes("gb2312"), "ISO8859-1") + ".xls");
205 OutputStream ouputStream = null;
206 try {
207 ouputStream = response.getOutputStream();
208 workbook.write(ouputStream);
209 ouputStream.flush();
210 } catch (IOException e) {
211 logger.error("导出Excel文件流到浏览器的时候异常!", e);
212 } finally {
213 try {
214 ouputStream.close();
215 } catch (IOException e) {
216 logger.error("关闭OutputStream异常!", e);
217 }
218 }
219 }
220 }
221
222
223 /**
224 * 创建表格
225 * @param response
226 * @param fieldName
227 * @param dataList
228 * @param formatMap
229 * @param title
230 * @param before
231 * @param after
232 * @param excelName
233 * @param excelmap
234 * @throws Exception
235 */
236 public static void exportExcel(HttpServletResponse response, List<String> fieldName,
237 List<Map<String, Object>> dataList, Map<String, String> formatMap, String title, List<String> before,
238 List<String> after, String excelName, Map<String, String> excelmap) throws Exception {
239 HSSFWorkbook workbook = new HSSFWorkbook();
240 HSSFSheet sheet = workbook.createSheet(title);
241
242 /**样式定义*/
243 //居中样式
244 HSSFCellStyle centerStyle = workbook.createCellStyle();//设置格式
245 centerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//居中
246 centerStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
247 //居中样式
248 HSSFCellStyle rightStyle = workbook.createCellStyle();//设置格式
249 rightStyle.setAlignment(HSSFCellStyle.ALIGN_RIGHT);//右对齐
250 rightStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
251 //创建顶部标题样式
252 HSSFCellStyle cellTitleStyle = workbook.createCellStyle();
253 cellTitleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
254 cellTitleStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
255 //创建顶部标题字体
256 HSSFFont fontTitle = workbook.createFont();
257 //fontTitle.setFontName("宋体");
258 fontTitle.setFontHeightInPoints((short) 16);
259 fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
260 cellTitleStyle.setFont(fontTitle);
261 //表头列名样式
262 HSSFCellStyle colNameStype = workbook.createCellStyle();
263 colNameStype.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
264 colNameStype.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
265 colNameStype.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);//灰色25
266 colNameStype.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);//填充
267
268 /**表名(大标题)*/
269 for (int i=0; i<fieldName.size(); i++) {
270 sheet.setDefaultColumnStyle(i, centerStyle);
271 sheet.setColumnWidth(i, 4500);
272 }
273
274 /**创建标题*/
275 int rowNum = 0;//第一行
276 HSSFRow rowTitle = sheet.createRow(rowNum++);
277 rowTitle.setHeightInPoints(40);
278 HSSFCell cellTitle = rowTitle.createCell(0);//表名单元格
279 cellTitle.setCellValue(title);
280 cellTitle.setCellStyle(cellTitleStyle);
281 sheet.addMergedRegion(new CellRangeAddress(0, (short) 0, 0, (short) (fieldName.size()-1)));
282
283 if (CollectionUtils.isNotEmpty(before)) {
284 //创建页眉
285 for (String item : before) {
286 HSSFRow rowHeader = sheet.createRow(rowNum++);
287 rowHeader.setHeightInPoints(18);
288 if (StringUtils.isEmpty(item)) {
289 continue;
290 }
291 String[] strs = item.split(",");
292 for (int i = 0; i < strs.length; i++) {
293 HSSFCell cell = rowHeader.createCell(i);//创建单元格
294 cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
295 cell.setCellValue(strs[i]);
296 }
297 }
298 }
299
300 //创建表格列表(DataList)列标
301 HSSFRow rowTableHead = sheet.createRow(rowNum++);
302 rowTableHead.setHeight((short)400);
303 for (int i = 0; i < fieldName.size(); i++) {
304 HSSFCell cell = rowTableHead.createCell(i);//创建单元格
305 cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
306 cell.setCellValue(excelmap.get(fieldName.get(i)));
307 cell.setCellStyle(colNameStype);
308 }
309
310 //创建表格列表(DataList)数据区域
311 for (int i=0; i<dataList.size(); i++) {
312 HSSFRow row = sheet.createRow(rowNum++);//创建行
313 row.setHeight((short)400);
314 for (int j = 0; j < fieldName.size(); j++) {
315 HSSFCell cell = row.createCell(j);//创建单元格
316 cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
317 Object columnValue = dataList.get(i).get(fieldName.get(j));//数据
318 String columnValueFomart = MapUtils.isEmpty(formatMap)? null : formatMap.get(fieldName.get(j));//数据格式
319 if (columnValue instanceof Date) {
320 //日期格式化
321 if (StringUtils.isBlank(columnValueFomart)) {
322 columnValueFomart = DateUtils.TIME_FORMAT;
323 }
324 cell.setCellValue(DateUtils.format((Date)columnValue, columnValueFomart));
325 } else if (columnValue instanceof Number) {
326 //数字格式化
327 if (null == columnValueFomart) {
328 cell.setCellValue(columnValue.toString());
329 } else {
330 DecimalFormat df1 = new DecimalFormat(columnValueFomart);
331 cell.setCellValue(df1.format(columnValue));
332 }
333 cell.setCellStyle(rightStyle);
334 } else {
335 cell.setCellValue(columnValue==null ? "" : columnValue.toString());
336 }
337 }
338 }
339
340 if (CollectionUtils.isNotEmpty(after)) {
341 // 创建页尾
342 for (String string : after) {
343 HSSFRow fieldRows = sheet.createRow(rowNum);
344 rowNum++;
345 if (StringUtils.isEmpty(string)) {
346 continue;
347 }
348 String[] strs = string.split(",");
349 for (int i = 0; i < strs.length; i++) {
350 // 创建单元格
351 HSSFCell cell = fieldRows.createCell(i);
352
353 // 定义单元格为字符串类型
354 cell.setCellType(HSSFCell.CELL_TYPE_STRING);
355 cell.setCellValue(strs[i]);
356 }
357 }
358 }
359 //导出Excel文件流到浏览器
360 sendExcel(response, workbook, excelName);
361 }
362
363
364 /*************************导入*************************/
365 /**
366 * 通用导入excel方法
367 * @param formFile 文件
368 * @param clas 映射的类
369 * @return 返回集合对象
370 * @throws Exception
371 */
372 public List<T> readExcel(MultipartFile formFile,Class clas) throws Exception{
373 //检查文件
374 checkFile(formFile);
375 //获得工作簿对象
376 Workbook workbook = getWorkBook(formFile);
377 //创建返回对象,把每行中的值作为一个数组,所有的行作为一个集合返回
378 List<T> list = new ArrayList<T>();
379
380
381 //保存键值(对象属性和值)
382 Map<String,Object> map=new HashMap<String, Object>();
383 if(null!=workbook){
384 for(int sheetNum = 0;sheetNum<workbook.getNumberOfSheets();sheetNum++){
385
386
387 //获取当前sheet工作表
388 Sheet sheet = workbook.getSheetAt(sheetNum);
389 if(null == sheet){
390 continue;
391 }
392 //获得当前sheet的开始行
393 int firstRowNum = sheet.getFirstRowNum();
394 //获得当前sheet的结束行
395 int lastRowNum = sheet.getLastRowNum();
396 //循环除了第一行之外的所有行
397 for(int rowNum = firstRowNum+1;rowNum<=lastRowNum;rowNum++){
398 //获得对象实例
399 Object obj=clas.newInstance();
400 //获得当前行
401 Row row = sheet.getRow(rowNum);
402 if(row == null){
403 continue;
404 }
405 //后的当前行的开始列
406 int firstCellNum = row.getFirstCellNum();
407 //获得当前行的列数
408 int lastCellNum = row.getPhysicalNumberOfCells();
409 //循环当前行
410 for(int cellNum = firstCellNum;cellNum < lastCellNum;cellNum++){
411 Field [] field=clas.getDeclaredFields();
412 Cell cell = row.getCell(cellNum);
413 //得到对应的键值
414 map.put(field[cellNum-1].getName(),getCellValue(cell));
415 }
416 //通过属性名对对象进行赋值操作
417 setFieldValue(obj,map);
418 list.add((T) obj);
419 }
420 }
421 }
422 return list;
423 }
424
425
426 /**
427 * 为bean赋值属性值
428 * @param bean
429 * @param valMap
430 */
431 public static void setFieldValue(Object bean, Map<String, Object> valMap) {
432 Class<?> cls = bean.getClass();
433 // 取出bean里的所有方法
434 Method[] methods = cls.getDeclaredMethods();
435 //取出bean 里面的属性
436 Field[] fields = cls.getDeclaredFields();
437
438 for (Field field : fields) {
439 try {
440 //通过属性名找到对应的set方法
441 String fieldSetName = parSetName(field.getName());
442 //判断set方法是否存在
443 if (!checkSetMet(methods, fieldSetName)) {
444 continue;
445 }
446 //通过set方法和属性类型得到对应的方法
447 Method fieldSetMet = cls.getMethod(fieldSetName, field.getType());
448
449 //通过属性名得到对应的值
450 String value = (String) valMap.get(field.getName());
451
452 if (null != value && !"".equals(value)) {
453 //得到属性类型的简写 如:java.lang.String 得到String
454 String fieldType = field.getType().getSimpleName();
455
456 //判断属性类型 为其进行转换
457 if ("String".equals(fieldType)) {
458 //赋值
459 fieldSetMet.invoke(bean, value);
460 } else if ("Date".equals(fieldType)) {
461 Date temp = parseDate(value);
462 fieldSetMet.invoke(bean, temp);
463 } else if ("Integer".equals(fieldType) || "int".equals(fieldType)) {
464 Integer intval = Integer.parseInt(value);
465 fieldSetMet.invoke(bean, intval);
466 } else if ("Long".equalsIgnoreCase(fieldType)) {
467 Long temp = Long.parseLong(value);
468 fieldSetMet.invoke(bean, temp);
469 } else if ("Double".equalsIgnoreCase(fieldType)) {
470 Double temp = Double.parseDouble(value);
471 fieldSetMet.invoke(bean, temp);
472 } else if ("Boolean".equalsIgnoreCase(fieldType)) {
473 Boolean temp = Boolean.parseBoolean(value);
474 fieldSetMet.invoke(bean, temp);
475 } else {
476
477 }
478 }
479 } catch (Exception e) {
480 continue;
481 }
482 }
483 }
484
485
486 /**
487 * 判断是否存在某属性的 set方法
488 * @param methods
489 * @param fieldSetMet
490 * @return boolean
491 */
492 private static boolean checkSetMet(Method[] methods, String fieldSetMet) {
493 for (Method met : methods) {
494 if (fieldSetMet.equals(met.getName())) {
495 return true;
496 }
497 }
498 return false;
499 }
500
501 /**
502 * 格式化string为Date
503 * @param datestr
504 * @return date
505 */
506 private static Date parseDate(String datestr) {
507 if (null == datestr || "".equals(datestr)) {
508 return null;
509 }
510 try {
511 String fmtstr = null;
512 if (datestr.indexOf(':') > 0) {
513 if(datestr.indexOf("-")>0) {
514 fmtstr = "yyyy-MM-dd HH:mm:ss";
515 }else {
516 fmtstr="HH:mm:ss";
517 }
518 } else {
519 fmtstr = "yyyy-MM-dd";
520 }
521 SimpleDateFormat sdf = new SimpleDateFormat(fmtstr);
522 return sdf.parse(datestr);
523 } catch (Exception e) {
524 return null;
525 }
526 }
527
528 /**
529 * 拼接在某属性的 set方法
530 * @param fieldName
531 * @return String
532 */
533 private static String parSetName(String fieldName) {
534 if (null == fieldName || "".equals(fieldName)) {
535 return null;
536 }
537 return "set" + fieldName.substring(0, 1).toUpperCase()
538 + fieldName.substring(1);
539 }
540
541 /**
542 * 获取当前行数据
543 * @param cell
544 * @return
545 */
546 @SuppressWarnings("deprecation")
547 private static String getCellValue(Cell cell){
548 String cellValue = "";
549
550 if(cell == null){
551 return cellValue;
552 }
553 //把数字当成String来读,避免出现1读成1.0的情况
554 if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
555 if(DateUtil.isCellDateFormatted(cell)){
556 //用于转化为日期格式
557 Date d = cell.getDateCellValue();
558 DateFormat formater = new SimpleDateFormat("HH:mm:ss");
559 cellValue = formater.format(d);
560 return cellValue;
561 }else {
562 cell.setCellType(Cell.CELL_TYPE_STRING);
563 }
564 }
565
566 //判断数据的类型
567 switch(cell.getCellType()){
568 case Cell.CELL_TYPE_NUMERIC://数字0
569 cellValue = String.valueOf(cell.getNumericCellValue());
570 break;
571 case Cell.CELL_TYPE_STRING://字符串
572 cellValue = String.valueOf(cell.getStringCellValue());
573 break;
574 case Cell.CELL_TYPE_BOOLEAN://Boolean
575 cellValue = String.valueOf(cell.getBooleanCellValue());
576 break;
577 case Cell.CELL_TYPE_FORMULA://公式
578 cellValue = String.valueOf(cell.getCellFormula());
579 break;
580 case Cell.CELL_TYPE_BLANK://空值
581 cellValue = "";
582 break;
583 case Cell.CELL_TYPE_ERROR://故障
584 cellValue = "非法字符";
585 break;
586 default:
587 cellValue = "未知类型";
588 break;
589 }
590 return cellValue;
591 }
592
593
594 /**
595 * 获得工作簿对象
596 * @param formFile
597 * @return
598 */
599 public static Workbook getWorkBook(MultipartFile formFile){
600 //获得文件名
601 // String fileName = formFile.getName();
602 String fileName = formFile.getOriginalFilename();
603 //创建Workbook工作簿对象,表示整个excel
604 Workbook workbook = null;
605 try {
606 //获得excel文件的io流
607 InputStream is = formFile.getInputStream();
608 //根据文件后缀名不同(xls和xlsx)获得不同的workbook实现类对象
609 if(fileName.endsWith(XLS)){
610 //2003
611 workbook = new HSSFWorkbook(is);
612 }else if(fileName.endsWith(XLSX)){
613 //2007
614 workbook = new XSSFWorkbook(is);
615 }
616 } catch (IOException e) {
617 e.printStackTrace();
618 }
619 return workbook;
620 }
621
622
623 /**
624 *检查文件
625 * @param formFile
626 * @throws IOException
627 */
628 public static void checkFile(MultipartFile formFile) throws IOException{
629 //判断文件是否存在
630 // logger.error("文件不存在!");
631 if(null == formFile){
632 throw new FileNotFoundException("文件不存在!");
633 }
634 //获得文件名
635 // String fileName = formFile.getName();
636 String fileName = formFile.getOriginalFilename();
637 //判断文件是否是excel文件
638 if(!fileName.endsWith(XLS) && !fileName.endsWith(XLSX)){
639 // logger.error(fileName+"不是excel文件!");
640 throw new IOException(fileName+"不是excel文件!");
641 }
642 }
643
644
645
646
647
648
649
650
651 }
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
10 <result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
11 <result column="real_name" property="realName" jdbcType="VARCHAR" />
12 <result column="help_code" property="helpCode" jdbcType="VARCHAR" />
13 <result column="sex" property="sex" jdbcType="VARCHAR" />
14 <result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
15 <result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
16 <result column="idcode" property="idcode" jdbcType="VARCHAR" />
17 <result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
18 <result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
19 <result column="category" property="category" jdbcType="VARCHAR" />
20 <result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
21 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
22 </resultMap>
23
24 <!--Base_Column_List -->
25 <sql id="Base_Column_List">id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time</sql>
26
27 <!--批量插入MedPlanDetail -->
28 <insert id="batchInsert" parameterType="list">
29 insert into med_hli_care_prov (id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time)
30 values
31 <foreach collection ="list" item="obj" separator =",">
32 <trim prefix=" (" suffix=")" suffixOverrides=",">
33 #{obj.id},
34 #{obj.mfmedStaffCode},
35 #{obj.logonUser},
36 #{obj.realName},
37 #{obj.helpCode},
38 #{obj.sex},
39 #{obj.mobileTel},
40 #{obj.webChatCode},
41 #{obj.idcode},
42 #{obj.e_mail},
43 #{obj.hdeptCode},
44 #{obj.category},
45 #{obj.ishadministrator},
46 #{obj.update_time}
47 </trim>
48 </foreach>
49 </insert>
50
51 <!-- 批量查询HisCtDept -->
52 <select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
53 select
54 <include refid="Base_Column_List" />
55 from med_hli_care_prov
56 <if test="ryCodes != null">
57 where mfmed_staff_code in
58 <foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
59 #{item}
60 </foreach>
61 </if>
62 </select>
63
64 <update id="batchUpdate" parameterType="list">
65 update med_hli_care_prov
66 <trim prefix="set" suffixOverrides=",">
67 <trim prefix="mfmed_staff_code=case" suffix="end,">
68 <foreach collection="list" item="obj" index="index">
69 <if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
70 when id = #{obj.id}
71 then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
72 </if>
73 </foreach>
74 </trim>
75 <trim prefix="logon_user=case" suffix="end,">
76 <foreach collection="list" item="obj" index="index">
77 <if test="obj.logonUser != null and obj.logonUser != ''">
78 when id = #{obj.id}
79 then
80 #{obj.logonUser,jdbcType=VARCHAR}
81 </if>
82 </foreach>
83 </trim>
84 <trim prefix="help_code=case" suffix="end,">
85 <foreach collection="list" item="obj" index="index">
86 <if test="obj.helpCode != null and obj.helpCode != ''">
87 when id = #{obj.id}
88 then #{obj.helpCode,jdbcType=VARCHAR}
89 </if>
90 </foreach>
91 </trim>
92 <trim prefix="real_name=case" suffix="end,">
93 <foreach collection="list" item="obj" index="index">
94 <if test="obj.realName != null and obj.realName != ''">
95 when id = #{obj.id}
96 then #{obj.realName,jdbcType=VARCHAR}
97 </if>
98 </foreach>
99 </trim>
100 <trim prefix="help_code=case" suffix="end,">
101 <foreach collection="list" item="obj" index="index">
102 <if test="obj.helpCode != null and obj.helpCode != ''">
103 when id = #{obj.id}
104 then #{obj.helpCode,jdbcType=VARCHAR}
105 </if>
106 </foreach>
107 </trim>
108 <trim prefix="sex=case" suffix="end,">
109 <foreach collection="list" item="obj" index="index">
110 <if test="obj.sex != null and obj.sex != ''">
111 when id = #{obj.id}
112 then #{obj.sex,jdbcType=VARCHAR}
113 </if>
114 </foreach>
115 </trim>
116 <trim prefix="mobile_tel=case" suffix="end,">
117 <foreach collection="list" item="obj" index="index">
118 <if test="obj.mobileTel != null and obj.mobileTel != ''">
119 when id = #{obj.id}
120 then #{obj.mobileTel,jdbcType=VARCHAR}
121 </if>
122 </foreach>
123 </trim>
124 <trim prefix="category=case" suffix="end,">
125 <foreach collection="list" item="obj" index="index">
126 <if test="obj.category != null and obj.category != ''">
127 when id = #{obj.id}
128 then #{obj.category,jdbcType=VARCHAR}
129 </if>
130 </foreach>
131 </trim>
132 <trim prefix="web_chat_code=case" suffix="end,">
133 <foreach collection="list" item="obj" index="index">
134 <if test="obj.webChatCode != null and obj.webChatCode != ''">
135 when id = #{obj.id}
136 then #{obj.webChatCode,jdbcType=VARCHAR}
137 </if>
138 </foreach>
139 </trim>
140 <trim prefix="idcode=case" suffix="end,">
141 <foreach collection="list" item="obj" index="index">
142 <if test="obj.idcode != null and obj.idcode != ''">
143 when id = #{obj.id}
144 then #{obj.idcode,jdbcType=VARCHAR}
145 </if>
146 </foreach>
147 </trim>
148 <trim prefix="hdept_code=case" suffix="end,">
149 <foreach collection="list" item="obj" index="index">
150 <if test="obj.hdeptCode != null and obj.hdeptCode != ''">
151 when id = #{obj.id}
152 then #{obj.hdeptCode,jdbcType=VARCHAR}
153 </if>
154 </foreach>
155 </trim>
156 <trim prefix="e_mail=case" suffix="end,">
157 <foreach collection="list" item="obj" index="index">
158 <if test="obj.e_mail != null and obj.e_mail != ''">
159 when id = #{obj.id}
160 then #{obj.e_mail,jdbcType=VARCHAR}
161 </if>
162 </foreach>
163 </trim>
164 <trim prefix="ishadministrator=case" suffix="end,">
165 <foreach collection="list" item="obj" index="index">
166 <if test="obj.ishadministrator != null and obj.ishadministrator != ''">
167 when id = #{obj.id}
168 then #{obj.ishadministrator,jdbcType=VARCHAR}
169 </if>
170 </foreach>
171 </trim>
172 <trim prefix="category=case" suffix="end,">
173 <foreach collection="list" item="obj" index="index">
174 <if test="obj.category != null and obj.category != ''">
175 when id = #{obj.id}
176 then #{obj.category,jdbcType=VARCHAR}
177 </if>
178 </foreach>
179 </trim>
180 <trim prefix="update_time=case" suffix="end,">
181 <foreach collection="list" item="obj" index="index">
182 <if test="obj.update_time != null and obj.update_time != ''">
183 when id = #{obj.id}
184 then #{obj.update_time,jdbcType=VARCHAR}
185 </if>
186 </foreach>
187 </trim>
188 </trim>
189 where
190 <foreach collection="list" separator="or" item="obj" index="index">
191 id
192 = #{obj.id}
193 </foreach>
194 </update>
195
196
197 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>送货单打印(普通A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}送货单</h3></td>
13 <td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">供应商:${fOrgName}</td>
17 <td width="25%" height="30">订单号:${orderNo}</td>
18 <td width="25%" height="30">送货单号:${sendNo}</td>
19 <!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
20 </tr>
21 <tr>
22 <td height="30">制单人:${sendUsername}</td>
23 <td height="30" colspan="2">制单时间:${sendDate}</td>
24 </tr>
25 <tr>
26 <td height="30" >收货科室:${deptName}</td>
27 <td height="30" colspan="2">收货地址:${tfAddress}</td>
28 </tr>
29 <tr>
30
31 </tr>
32 </table>
33 </div>
34 <div>
35 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
36 <tr style="height: 25px;">
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
42 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
43 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
44 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
45 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80;">有效期至</td>
46 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
47 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
48 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;" width="80">金额</td>
49 </tr>
50 ${tableContent}
51 </table>
52 </div>
53 <div>
54 ${afterTable
55 <table width="100%" border="0" cellspacing="0" cellpadding="0">
56 <tr height="35px;">
57 <td width="30%" align="left">验收人:</td>
58 <td width="30%" align="left">收货人:</td>
59 <td width="20%" align="left">总金额:${totalPrice}</td>
60 </tr>
61 </table>
62 }
63 </div>
64 </div>
65 </body>
66 </html>
...\ No newline at end of file ...\ No newline at end of file
1 ALTER TABLE med_hli_plan ADD COLUMN settle_type VARCHAR(10) COMMENT '0:零库存 1:非零库存' AFTER bill_type;
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.web.spd;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import javax.servlet.http.HttpServletRequest;
7
8 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
9
10 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Controller;
14 import org.springframework.web.bind.annotation.RequestBody;
15 import org.springframework.web.bind.annotation.RequestMapping;
16 import org.springframework.web.bind.annotation.RequestMethod;
17 import org.springframework.web.bind.annotation.ResponseBody;
18
19 import com.alibaba.fastjson.JSON;
20 import com.alibaba.fastjson.JSONObject;
21 import com.alibaba.fastjson.serializer.SerializerFeature;
22 import com.fasterxml.jackson.annotation.JsonFormat;
23 import com.phxl.common.constants.PlatformConstant;
24 import com.phxl.common.response.PlatFormResponse;
25 import com.phxl.common.response.PlatFormResponseConstant;
26 import com.phxl.common.util.HTTPClient;
27 import com.phxl.common.util.JsonMapper;
28 import com.phxl.common.utils.IdUtil;
29 import com.phxl.modules.goods.entity.billback.BillBack;
30 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
31 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
32 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
33 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
34 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
35 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
36 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
37 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
38 import com.phxl.modules.goods.entity.medplan.MedPlan;
39 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
40 import com.phxl.modules.goods.entity.medstock.MedStock;
41 import com.phxl.modules.goods.entity.medstock.MedStockList;
42 import com.phxl.modules.goods.entity.spills.HisSpills;
43 import com.phxl.modules.goods.entity.spills.HisSpillsList;
44 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
45 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
46 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
47 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
48 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
49 import com.phxl.modules.goods.service.billback.BillBackService;
50 import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
51 import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
52 import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
53 import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
54 import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
55 import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
56 import com.phxl.modules.goods.service.medinstore.MedInStoreService;
57 import com.phxl.modules.goods.service.medplan.MedPlanService;
58 import com.phxl.modules.goods.service.medstock.MedStockService;
59 import com.phxl.modules.goods.service.spills.HisSpillsService;
60 import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
61 import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
62 import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
63
64 @Controller
65 @RequestMapping(value = "/Api")
66 public class SpdControlller {
67
68 /**
69 * 日志对象
70 */
71 protected Logger logger = LoggerFactory.getLogger(getClass());
72
73 @Autowired
74 private HisCtMedicineMaterialService ctMedicineMaterialService;
75
76 @Autowired
77 private InterfaceLogService interfaceLogService;
78
79 @Autowired
80 private HisCtDeptService hisCtDeptService;
81
82 @Autowired
83 private CTCareProvService cTCareProvService;
84
85 @Autowired
86 private MedSupplyGoodsService supplyGoodsService;
87
88 @Autowired
89 private MedStockService stockService;
90
91 @Autowired
92 private MedPlanService medPlanService;
93
94 @Autowired
95 private MedInStoreService medInStoreService;
96
97 @Autowired
98 private BillBackService backService;
99
100 @Autowired
101 private BillSettlementService billSettlementService;
102
103 @Autowired
104 private SupplierStockService supplierStockService;
105
106 @Autowired
107 private SuOutStoreService suOutStoreService;
108
109 @Autowired
110 private HisSpillsService hisSpillsService;
111
112 @Autowired
113 private SuInvoiceBackService suInvoiceBackService;
114
115
116 @RequestMapping(value="/setMFMedGoods")
117 @ResponseBody
118 public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
119 logger.debug("药品目录接口请求参数:{}",medgoodsList);
120 String result = "";
121 String logId = IdUtil.uuid();
122 String exception = "";
123 interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
124 PlatFormResponse response = new PlatFormResponse();
125 List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
126 try {
127 materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
128 for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
129 ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
130 }
131 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
132 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
133 result = JSON.toJSONString(response);
134 //medgoodsList = ctMedicineMaterialService.createRequest();
135 //供应商服务请求:
136 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
137 } catch (Exception e) {
138 logger.error(e.getMessage());
139 exception = e.getMessage();
140 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
141 response.setMsg(e.getMessage());
142 result = JSON.toJSONString(response);
143 }
144 interfaceLogService.setResultLog(response, logId, exception);
145 return result;
146 }
147
148 @RequestMapping(value="/setHDept")
149 @ResponseBody
150 public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
151 logger.debug("医院科室资料接口请求参数:{}",params);
152 String result = "";
153 String logId = IdUtil.uuid();
154 String exception = "";
155 interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
156 PlatFormResponse response = new PlatFormResponse();
157 List<HisCtDept> depts = new ArrayList<HisCtDept>();
158 try {
159 depts = JSONObject.parseArray(params, HisCtDept.class);
160 int end = hisCtDeptService.batchSaveOrUpdate(depts);
161 if(end==1){
162 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
163 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
164 }else{
165 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
166 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
167 }
168 result = JSON.toJSONString(response);
169 //供应商服务请求:
170 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
171 } catch (Exception e) {
172 logger.error(e.getMessage());
173 exception = e.getMessage();
174 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
175 response.setMsg(e.getMessage());
176 result = JSON.toJSONString(response);
177 }
178 interfaceLogService.setResultLog(response, logId, exception);
179 return result;
180 }
181
182 /**
183 * 医院人员资料接口
184 * @param request
185 * @param params
186 * @return
187 */
188 @RequestMapping("/setMedStaff")
189 @ResponseBody
190 public String setMedStaff(HttpServletRequest request, @RequestBody String params){
191 logger.debug("医院人员资料接口请求参数:{}",params);
192 String result = "";
193 String logId = IdUtil.uuid();
194 String exception = "";
195 interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
196 PlatFormResponse response = new PlatFormResponse();
197 List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
198 boolean end = false;
199 try {
200 careProvs = JSONObject.parseArray(params, CTCareProv.class);
201 end = cTCareProvService.batchSaveOrUpdate(careProvs);
202 if(end){
203 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
204 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
205 }else{
206 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
207 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
208 }
209 result = JSON.toJSONString(response);
210 //供应商服务请求:
211 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
212 } catch (Exception e) {
213 logger.error(e.getMessage());
214 exception = e.getMessage();
215 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
216 response.setMsg(e.getMessage());
217 result = JSON.toJSONString(response);
218 }
219 interfaceLogService.setResultLog(response, logId, exception);
220 return result;
221 }
222
223
224 /**
225 * 医院采购目录接口
226 * @param request
227 * @param params
228 * @return
229 */
230 @RequestMapping("/setMFSupplyGoods")
231 @ResponseBody
232 public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
233 logger.debug("医院采购目录接口请求参数:{}",params);
234 String result = "";
235 String logId = IdUtil.uuid();
236 String exception = "";
237 interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
238 PlatFormResponse response = new PlatFormResponse();
239 List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
240 boolean end = false;
241 try {
242 supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
243 end = supplyGoodsService.batchSave(supplyGoods);
244 if(end){
245 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
246 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
247 }else{
248 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
249 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
250 }
251 result = JSON.toJSONString(response);
252 //供应商服务请求:
253 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
254 } catch (Exception e) {
255 logger.error(e.getMessage());
256 exception = e.getMessage();
257 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
258 response.setMsg(e.getMessage());
259 result = JSON.toJSONString(response);
260 }
261 interfaceLogService.setResultLog(response, logId, exception);
262 return result;
263 }
264
265
266 /**
267 * 医院库存接口
268 * @param request
269 * @param params
270 * @return
271 */
272 @ResponseBody
273 @RequestMapping(value="/setMedStock",method = RequestMethod.POST)
274 public String setMedStock(HttpServletRequest request, @RequestBody String params){
275 logger.debug("HLI同步医院库存数据请求参数:{}",params);
276 String result = "";
277 String logId = IdUtil.uuid();
278 String exception = "";
279 interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
280 PlatFormResponse response = new PlatFormResponse();
281 List<MedStockList> stocks = new ArrayList<MedStockList>();
282 boolean end = false;
283 try {
284 stocks = JSONObject.parseArray(params, MedStockList.class);
285 end = stockService.batchSave(stocks);
286 if(end){
287 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
288 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
289 }else{
290 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
291 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
292 }
293 result = JSON.toJSONString(response);
294 //供应商服务请求:
295 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
296 } catch (Exception e) {
297 logger.error(e.getMessage());
298 exception = e.getMessage();
299 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
300 response.setMsg(e.getMessage());
301 result = JSON.toJSONString(response);
302 }
303 interfaceLogService.setResultLog(response, logId, exception);
304 return result;
305 }
306
307
308 /**
309 * 医院补货计划接口
310 * @param request
311 * @param params
312 * @return
313 */
314 @RequestMapping("/setMedPlan")
315 @ResponseBody
316 public String setMedPlan(HttpServletRequest request, @RequestBody String params){
317 logger.debug("补货计划接口请求参数:{}",params);
318 String result = "";
319 String logId = IdUtil.uuid();
320 String exception = "";
321 interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
322 PlatFormResponse response = new PlatFormResponse();
323 List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
324 boolean end = false;
325 try {
326 //改成批量的操作
327 medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
328 end = medPlanService.batchSave(medPlans);
329 if(end){
330 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
331 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
332 }else{
333 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
334 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
335 }
336 result = JSON.toJSONString(response);
337 //供应商服务请求:
338 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
339 } catch (Exception e) {
340 logger.error(e.getMessage());
341 exception = e.getMessage();
342 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
343 response.setMsg(e.getMessage());
344 result = JSON.toJSONString(response);
345 }
346 interfaceLogService.setResultLog(response, logId, exception);
347 return result;
348 }
349
350
351 /**
352 * 医院退货接口
353 * @param request
354 * @param params
355 * @return
356 */
357 @RequestMapping("/setTRMedRPI")
358 @ResponseBody
359 public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
360 logger.debug("医院退货计划接口请求参数:{}",params);
361 String result = "";
362 String logId = IdUtil.uuid();
363 String exception = "";
364 interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
365 PlatFormResponse response = new PlatFormResponse();
366 List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
367 boolean end = false;
368 try {
369 billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
370 end = backService.batchSave(billBacks);
371 if(end){
372 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
373 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
374 }else{
375 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
376 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
377 }
378 result = JSON.toJSONString(response);
379 //供应商服务请求:
380 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
381 } catch (Exception e) {
382 logger.error(e.getMessage());
383 exception = e.getMessage();
384 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
385 response.setMsg(e.getMessage());
386 result = JSON.toJSONString(response);
387 }
388 interfaceLogService.setResultLog(response, logId, exception);
389 return result;
390 }
391
392 /**
393 * 结算单接口
394 * @param request
395 * @param params
396 * @return
397 */
398 @RequestMapping("/setTRSettle")
399 @ResponseBody
400 public String setTRSettle(HttpServletRequest request, @RequestBody String params){
401 logger.debug("同步医院结算单请求参数:{}",params);
402 String result = "";
403 String logId = IdUtil.uuid();
404 String exception = "";
405 interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
406 PlatFormResponse response = new PlatFormResponse();
407 List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
408 boolean end = false;
409 try {
410 settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
411 end = billSettlementService.batchSave(settlementWithDetails);
412 if(end){
413 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
414 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
415 }else{
416 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
417 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
418 }
419 result = JSON.toJSONString(response);
420 //供应商服务请求:
421 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
422 } catch (Exception e) {
423 logger.error(e.getMessage());
424 exception = e.getMessage();
425 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
426 response.setMsg(e.getMessage());
427 result = JSON.toJSONString(response);
428 }
429 interfaceLogService.setResultLog(response, logId, exception);
430 return result;
431 }
432
433
434 /**
435 * 供应商库存接口
436 * @param request
437 * @param params
438 * @return
439 */
440 @RequestMapping("/setStock")
441 @ResponseBody
442 public String setStock(HttpServletRequest request, @RequestBody String params){
443 logger.debug("供应商同步库存数据请求参数:{}",params);
444 String result = "";
445 String logId = IdUtil.uuid();
446 String exception = "";
447 interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
448 PlatFormResponse response = new PlatFormResponse();
449 List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
450 boolean end = false;
451 try {
452 supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
453 end = supplierStockService.batchSave(supplierStocks);
454 if(end){
455 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
456 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
457 }else{
458 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
459 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
460 }
461 result = JSON.toJSONString(response);
462 try
463 {
464 //SPD服务请求:
465 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
466 response = JSONObject.parseObject(result,PlatFormResponse.class);
467 response.setMsg("SPD:"+response.getMsg());
468 }
469 catch(Exception ex){
470 logger.error("SPD:"+ex.getMessage());
471 exception = "SPD:"+ex.getMessage();
472 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
473 response.setMsg("SPD:"+ex.getMessage());
474 result = JSON.toJSONString(response);
475 }
476
477 } catch (Exception e) {
478 logger.error("前置机:"+e.getMessage());
479 exception = "前置机:"+e.getMessage();
480 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
481 response.setMsg("前置机:"+e.getMessage());
482 result = JSON.toJSONString(response);
483 }
484 interfaceLogService.setResultLog(response, logId, exception);
485 return result;
486 }
487
488
489 /**
490 * 供应商出库单接口
491 * @param request
492 * @param params
493 * @return
494 */
495 @RequestMapping("/setTrmedwv")
496 @ResponseBody
497 public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
498 logger.debug("同步供应商出库单请求参数:{}",params);
499 String result = "";
500 String logId = IdUtil.uuid();
501 String exception = "";
502 interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
503 PlatFormResponse response = new PlatFormResponse();
504 List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
505 boolean end = false;
506 try {
507 suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
508 end = suOutStoreService.batchSave(suOutStores);
509 if(end){
510 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
511 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
512 }else{
513 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
514 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
515 }
516 result = JSON.toJSONString(response);
517 try
518 {
519 //SPD服务请求:
520 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
521 response = JSONObject.parseObject(result,PlatFormResponse.class);
522 response.setMsg("SPD:"+response.getMsg());
523 }
524 catch(Exception ex){
525 logger.error("SPD:"+ex.getMessage());
526 exception = "SPD:"+ex.getMessage();
527 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
528 response.setMsg("SPD:"+ex.getMessage());
529 result = JSON.toJSONString(response);
530 }
531
532 } catch (Exception e) {
533 logger.error("前置机:"+e.getMessage());
534 exception = "前置机:"+e.getMessage();
535 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
536 response.setMsg("前置机:"+e.getMessage());
537 result = JSON.toJSONString(response);
538 }
539 interfaceLogService.setResultLog(response, logId, exception);
540 return result;
541 }
542
543 /**
544 * 医院盘点损溢接口
545 * @param request
546 * @param params
547 * @return
548 */
549 @RequestMapping(value="/setTrDiff")
550 @ResponseBody
551 public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
552 logger.debug("医院盘点损溢接口请求参数:{}",params);
553 String result = "";
554 String logId = IdUtil.uuid();
555 String exception = "";
556 interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
557 PlatFormResponse response = new PlatFormResponse();
558 List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
559 boolean end = false;
560 try {
561 spills = JSONObject.parseArray(params, HisSpillsList.class);
562 end = hisSpillsService.batchSave(spills);
563 if(end){
564 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
565 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
566 }else{
567 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
568 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
569 }
570 result = JSON.toJSONString(response);
571 //供应商服务请求:
572 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
573 } catch (Exception e) {
574 logger.error(e.getMessage());
575 exception = e.getMessage();
576 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
577 response.setMsg(e.getMessage());
578 result = JSON.toJSONString(response);
579 }
580 interfaceLogService.setResultLog(response, logId, exception);
581 return result;
582 }
583
584
585 /**
586 * 供应商发票回传接口
587 * @param request
588 * @param params
589 * @return
590 */
591 @RequestMapping("/setInvoice")
592 @ResponseBody
593 public String setInvoice(HttpServletRequest request, @RequestBody String params){
594 logger.debug("供应商发票回传接口请求参数:{}",params);
595 String result = "";
596 String logId = IdUtil.uuid();
597 String exception = "";
598 interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
599 PlatFormResponse response = new PlatFormResponse();
600 List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
601 boolean end = false;
602 try {
603 suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
604 end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
605 if(end){
606 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
607 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
608 }else{
609 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
610 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
611 }
612 result = JSON.toJSONString(response);
613 try
614 {
615 //SPD服务请求:
616 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
617 response = JSONObject.parseObject(result,PlatFormResponse.class);
618 response.setMsg("SPD:"+response.getMsg());
619 }
620 catch(Exception ex){
621 logger.error("SPD:"+ex.getMessage());
622 exception = "SPD:"+ex.getMessage();
623 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
624 response.setMsg("SPD:"+ex.getMessage());
625 result = JSON.toJSONString(response);
626 }
627
628 } catch (Exception e) {
629 logger.error("前置机:"+e.getMessage());
630 exception = "前置机:"+e.getMessage();
631 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
632 response.setMsg("前置机:"+e.getMessage());
633 result = JSON.toJSONString(response);
634 }
635 interfaceLogService.setResultLog(response, logId, exception);
636 return result;
637 }
638
639 /*
640 * 医院入库单回传接口
641 * @param request
642 * @param params
643 * @return
644 */
645 @RequestMapping("/setMedInStore")
646 @ResponseBody
647 public String setMedInStore(HttpServletRequest request, @RequestBody String params){
648 logger.debug("医院入库单回传接口请求参数:{}",params);
649 String result = "";
650 String logId = IdUtil.uuid();
651 String exception = "";
652 interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
653 PlatFormResponse response = new PlatFormResponse();
654 List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
655 boolean end = false;
656 try {
657 //改成批量的操作
658 medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
659 end = medInStoreService.batchSave(medInStores);
660 if(end){
661 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
662 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
663 }else{
664 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
665 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
666 }
667 result = JSON.toJSONString(response);
668 //供应商服务请求:
669 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
670 } catch (Exception e) {
671 logger.error(e.getMessage());
672 exception = e.getMessage();
673 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
674 response.setMsg(e.getMessage());
675 result = JSON.toJSONString(response);
676 }
677 interfaceLogService.setResultLog(response, logId, exception);
678 return result;
679 }
680
681 /***
682 * 推送对账数据到平台
683 * @param params
684 * @return
685 */
686 @RequestMapping("/pushBalance")
687 @ResponseBody
688 public String pushBalance(@RequestBody String params) {
689 logger.debug("推送对账数据:{}", params);
690 String result = "";
691 String logId = IdUtil.uuid();
692 String exception = "";
693 interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
694 PlatFormResponse response = new PlatFormResponse();
695 try {
696 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
697 JSONObject jsonObject = JSONObject.parseObject(result);
698 if(jsonObject.getIntValue("errorCode") != 0){
699 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
700 }else {
701 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
702 }
703 response.setMsg(jsonObject.getString("message"));
704 } catch (Exception e) {
705 logger.error(e.getMessage());
706 exception = e.getMessage();
707 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
708 response.setMsg("发送对账数据给平台错误:" + e.getMessage());
709 result = JSON.toJSONString(response);
710 }
711 interfaceLogService.setResultLog(response, logId, exception);
712 return result;
713
714 }
715
716
717 /**
718 * 推送发药数据到平台
719 * @param params
720 * @return
721 */
722 @RequestMapping("/pushDispensing")
723 @ResponseBody
724 public String pushDispensing(@RequestBody String params){
725 logger.debug("推送发药数据:{}", params);
726 String result = "";
727 String logId = IdUtil.uuid();
728 String exception = "";
729 interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
730 PlatFormResponse response = new PlatFormResponse();
731 try {
732 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
733 JSONObject jsonObject = JSONObject.parseObject(result);
734 if(jsonObject.getIntValue("errorCode") != 0){
735 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
736 }else {
737 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
738 }
739 response.setMsg(jsonObject.getString("message"));
740 } catch (Exception e) {
741 logger.error(e.getMessage());
742 exception = e.getMessage();
743 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
744 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
745 result = JSON.toJSONString(response);
746 }
747 interfaceLogService.setResultLog(response, logId, exception);
748 return result;
749 }
750
751
752 /**
753 * 推送库存数据到平台
754 * @param params
755 * @return
756 */
757 @RequestMapping("/pushStock")
758 @ResponseBody
759 public String pushStock(@RequestBody String params){
760 logger.debug("推送库存数据:{}", params);
761 String result = "";
762 String logId = IdUtil.uuid();
763 String exception = "";
764 interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
765 PlatFormResponse response = new PlatFormResponse();
766 try {
767 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
768 JSONObject jsonObject = JSONObject.parseObject(result);
769 if(jsonObject.getIntValue("errorCode") != 0){
770 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
771 }else {
772 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
773 }
774 response.setMsg(jsonObject.getString("message"));
775 } catch (Exception e) {
776 logger.error(e.getMessage());
777 exception = e.getMessage();
778 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
779 response.setMsg("发送库存数据给平台错误:" + e.getMessage());
780 result = JSON.toJSONString(response);
781 }
782 interfaceLogService.setResultLog(response, logId, exception);
783 return result;
784 }
785 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
4 xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
5 xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
6 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
7 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
8 http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
9 http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
10 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
11 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
12 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
13 default-lazy-init="true">
14 <!-- 启用注解 -->
15 <context:component-scan base-package="com.phxl" />
16
17 <!-- 引入属性文件 -->
18 <context:property-placeholder location="classpath:config.properties"/>
19
20 <!-- 配置数据源 -->
21 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
22 <property name="driverClassName" value="${jdbc.driver}" />
23 <property name="url" value="${jdbc.url}" />
24 <property name="username" value="${jdbc.username}"/>
25 <property name="password" value="${jdbc.password}"/>
26 </bean>
27
28 <!-- 配置sqlsessionFactory -->
29 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
30 <property name="dataSource" ref="dataSource"/>
31 <property name="configLocation" value="classpath:mybatis-config.xml"/>
32 <property name="mapperLocations">
33 <list>
34 <value>classpath:/mappings/**/*.xml</value>
35 </list>
36 </property>
37 </bean>
38
39 <!-- 扫描Mapper -->
40 <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
41 <property name="basePackage" value="com.phxl.modules"/>
42 </bean>
43
44 <!-- 配置事务管理器 -->
45 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
46 <property name="dataSource" ref="dataSource"/>
47 </bean>
48
49 <!-- 启用注解事务 -->
50 <tx:annotation-driven/>
51
52 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.common.util;
2 import java.util.ArrayList;
3 import java.util.Collection;
4 import java.util.HashMap;
5 import java.util.Iterator;
6 import java.util.List;
7 import java.util.Map;
8
9 import org.apache.commons.beanutils.BeanUtils;
10
11 import net.sf.json.JSONArray;
12 import net.sf.json.JSONObject;
13
14 public class JsonToUtils
15 {
16 /**
17 *
18 * @author wangwei JSON工具类
19 * @param
20 *
21 */
22
23 /***
24 * 将List对象序列化为JSON文本
25 */
26 public static <T> String toJSONString(List<T> list)
27 {
28 JSONArray jsonArray = JSONArray.fromObject(list);
29
30 return jsonArray.toString();
31 }
32
33 /***
34 * 将对象序列化为JSON文本
35 * @param object
36 * @return
37 */
38 public static String toJSONString(Object object)
39 {
40 JSONArray jsonArray = JSONArray.fromObject(object);
41
42 return jsonArray.toString();
43 }
44
45 /***
46 * 将JSON对象数组序列化为JSON文本
47 * @param jsonArray
48 * @return
49 */
50 public static String toJSONString(JSONArray jsonArray)
51 {
52 return jsonArray.toString();
53 }
54
55 /***
56 * 将JSON对象序列化为JSON文本
57 * @param jsonObject
58 * @return
59 */
60 public static String toJSONString(JSONObject jsonObject)
61 {
62 return jsonObject.toString();
63 }
64
65 /***
66 * 将对象转换为List对象
67 * @param object
68 * @return
69 */
70 public static List toArrayList(Object object)
71 {
72 List arrayList = new ArrayList();
73
74 JSONArray jsonArray = JSONArray.fromObject(object);
75
76 Iterator it = jsonArray.iterator();
77 while (it.hasNext())
78 {
79 JSONObject jsonObject = (JSONObject) it.next();
80
81 Iterator keys = jsonObject.keys();
82 while (keys.hasNext())
83 {
84 Object key = keys.next();
85 Object value = jsonObject.get(key);
86 arrayList.add(value);
87 }
88 }
89
90 return arrayList;
91 }
92
93 /***
94 * 将对象转换为Collection对象
95 * @param object
96 * @return
97 */
98 public static Collection toCollection(Object object)
99 {
100 JSONArray jsonArray = JSONArray.fromObject(object);
101
102 return JSONArray.toCollection(jsonArray);
103 }
104
105 /***
106 * 将对象转换为JSON对象数组
107 * @param object
108 * @return
109 */
110 public static JSONArray toJSONArray(Object object)
111 {
112 return JSONArray.fromObject(object);
113 }
114
115 /***
116 * 将对象转换为JSON对象
117 * @param object
118 * @return
119 */
120 public static JSONObject toJSONObject(Object object)
121 {
122 return JSONObject.fromObject(object);
123 }
124
125 /***
126 * 将对象转换为HashMap
127 * @param object
128 * @return
129 */
130 public static HashMap toHashMap(Object object)
131 {
132 HashMap<String, Object> data = new HashMap<String, Object>();
133 JSONObject jsonObject = toJSONObject(object);
134 Iterator it = jsonObject.keys();
135 while (it.hasNext())
136 {
137 String key = String.valueOf(it.next());
138 Object value = jsonObject.get(key);
139 data.put(key, value);
140 }
141
142 return data;
143 }
144
145 /***
146 * 将对象转换为List>
147 * @param object
148 * @return
149 */
150 // 返回非实体类型(Map)的List
151 public static List<Map<String, Object>> toList(Object object)
152 {
153 List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
154 JSONArray jsonArray = JSONArray.fromObject(object);
155 for (Object obj : jsonArray)
156 {
157 JSONObject jsonObject = (JSONObject) obj;
158 Map<String, Object> map = new HashMap<String, Object>();
159 Iterator it = jsonObject.keys();
160 while (it.hasNext())
161 {
162 String key = (String) it.next();
163 Object value = jsonObject.get(key);
164 map.put((String) key, value);
165 }
166 list.add(map);
167 }
168 return list;
169 }
170
171 /***
172 * 将JSON对象数组转换为传入类型的List
173 * @param
174 * @param jsonArray
175 * @param objectClass
176 * @return
177 */
178 public static <T> List<T> toList(JSONArray jsonArray, Class<T> objectClass)
179 {
180 return JSONArray.toList(jsonArray, objectClass);
181 }
182
183 /***
184 * 将对象转换为传入类型的List
185 * @param
186 * @param jsonArray
187 * @param objectClass
188 * @return
189 */
190 public static <T> List<T> toList(Object object, Class<T> objectClass)
191 {
192 JSONArray jsonArray = JSONArray.fromObject(object);
193
194 return JSONArray.toList(jsonArray, objectClass);
195 }
196
197 /***
198 * 将JSON对象转换为传入类型的对象
199 * @param
200 * @param jsonObject
201 * @param beanClass
202 * @return
203 */
204 public static <T> T toBean(JSONObject jsonObject, Class<T> beanClass)
205 {
206 return (T) JSONObject.toBean(jsonObject, beanClass);
207 }
208
209 /***
210 * 将将对象转换为传入类型的对象
211 * @param
212 * @param object
213 * @param beanClass
214 * @return
215 */
216 public static <T> T toBean(Object object, Class<T> beanClass)
217 {
218 JSONObject jsonObject = JSONObject.fromObject(object);
219
220 return (T) JSONObject.toBean(jsonObject, beanClass);
221 }
222
223 /***
224 * 将JSON文本反序列化为主从关系的实体
225 * @param 泛型T 代表主实体类型
226 * @param 泛型D 代表从实体类型
227 * @param jsonString JSON文本
228 * @param mainClass 主实体类型
229 * @param detailName 从实体类在主实体类中的属性名称
230 * @param detailClass 从实体类型
231 * @return
232 */
233 public static <T, D> T toBean(String jsonString, Class<T> mainClass,
234 String detailName, Class<D> detailClass)
235 {
236 JSONObject jsonObject = JSONObject.fromObject(jsonString);
237 JSONArray jsonArray = (JSONArray) jsonObject.get(detailName);
238
239 T mainEntity = toBean(jsonObject, mainClass);
240 List<D> detailList = toList(jsonArray, detailClass);
241
242 try
243 {
244 BeanUtils.setProperty(mainEntity, detailName, detailList);
245 }
246 catch (Exception ex)
247 {
248 throw new RuntimeException("主从关系JSON反序列化实体失败!");
249 }
250
251 return mainEntity;
252 }
253
254 /***
255 * 将JSON文本反序列化为主从关系的实体
256 * @param 泛型T 代表主实体类型
257 * @param 泛型D1 代表从实体类型
258 * @param 泛型D2 代表从实体类型
259 * @param jsonString JSON文本
260 * @param mainClass 主实体类型
261 * @param detailName1 从实体类在主实体类中的属性
262 * @param detailClass1 从实体类型
263 * @param detailName2 从实体类在主实体类中的属性
264 * @param detailClass2 从实体类型
265 * @return
266 */
267 public static <T, D1, D2> T toBean(String jsonString, Class<T> mainClass,
268 String detailName1, Class<D1> detailClass1, String detailName2,
269 Class<D2> detailClass2)
270 {
271 JSONObject jsonObject = JSONObject.fromObject(jsonString);
272 JSONArray jsonArray1 = (JSONArray) jsonObject.get(detailName1);
273 JSONArray jsonArray2 = (JSONArray) jsonObject.get(detailName2);
274
275 T mainEntity = toBean(jsonObject, mainClass);
276 List<D1> detailList1 = toList(jsonArray1, detailClass1);
277 List<D2> detailList2 = toList(jsonArray2, detailClass2);
278
279 try
280 {
281 BeanUtils.setProperty(mainEntity, detailName1, detailList1);
282 BeanUtils.setProperty(mainEntity, detailName2, detailList2);
283 }
284 catch (Exception ex)
285 {
286 throw new RuntimeException("主从关系JSON反序列化实体失败!");
287 }
288
289 return mainEntity;
290 }
291
292 /***
293 * 将JSON文本反序列化为主从关系的实体
294 * @param 泛型T 代表主实体类型
295 * @param 泛型D1 代表从实体类型
296 * @param 泛型D2 代表从实体类型
297 * @param jsonString JSON文本
298 * @param mainClass 主实体类型
299 * @param detailName1 从实体类在主实体类中的属性
300 * @param detailClass1 从实体类型
301 * @param detailName2 从实体类在主实体类中的属性
302 * @param detailClass2 从实体类型
303 * @param detailName3 从实体类在主实体类中的属性
304 * @param detailClass3 从实体类型
305 * @return
306 */
307 public static <T, D1, D2, D3> T toBean(String jsonString,
308 Class<T> mainClass, String detailName1, Class<D1> detailClass1,
309 String detailName2, Class<D2> detailClass2, String detailName3,
310 Class<D3> detailClass3)
311 {
312 JSONObject jsonObject = JSONObject.fromObject(jsonString);
313 JSONArray jsonArray1 = (JSONArray) jsonObject.get(detailName1);
314 JSONArray jsonArray2 = (JSONArray) jsonObject.get(detailName2);
315 JSONArray jsonArray3 = (JSONArray) jsonObject.get(detailName3);
316
317 T mainEntity = toBean(jsonObject, mainClass);
318 List<D1> detailList1 = toList(jsonArray1, detailClass1);
319 List<D2> detailList2 = toList(jsonArray2, detailClass2);
320 List<D3> detailList3 = toList(jsonArray3, detailClass3);
321
322 try
323 {
324 BeanUtils.setProperty(mainEntity, detailName1, detailList1);
325 BeanUtils.setProperty(mainEntity, detailName2, detailList2);
326 BeanUtils.setProperty(mainEntity, detailName3, detailList3);
327 }
328 catch (Exception ex)
329 {
330 throw new RuntimeException("主从关系JSON反序列化实体失败!");
331 }
332
333 return mainEntity;
334 }
335
336 /***
337 * 将JSON文本反序列化为主从关系的实体
338 * @param 主实体类型
339 * @param jsonString JSON文本
340 * @param mainClass 主实体类型
341 * @param detailClass 存放了多个从实体在主实体中属性名称和类型
342 * @return
343 */
344 public static <T> T toBean(String jsonString, Class<T> mainClass,
345 HashMap<String, Class> detailClass)
346 {
347 JSONObject jsonObject = JSONObject.fromObject(jsonString);
348 T mainEntity = toBean(jsonObject, mainClass);
349 for (Object key : detailClass.keySet())
350 {
351 try
352 {
353 Class value = (Class) detailClass.get(key);
354 BeanUtils.setProperty(mainEntity, key.toString(), value);
355 }
356 catch (Exception ex)
357 {
358 throw new RuntimeException("主从关系JSON反序列化实体失败!");
359 }
360 }
361 return mainEntity;
362 }
363 }
...\ No newline at end of file ...\ No newline at end of file
1 package com.phxl.modules.goods.dao.billback;
2
3 import com.phxl.modules.goods.entity.billback.BillBack;
4
5 public interface BillBackDao{
6
7 void insert(BillBack billBack);
8
9
10 }
1 package com.phxl.modules.goods.service.ctdept;
2
3 import java.util.ArrayList;
4 import java.util.HashMap;
5 import java.util.List;
6 import java.util.Map;
7
8 import org.apache.commons.collections.CollectionUtils;
9 import org.apache.commons.lang3.StringUtils;
10 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Service;
14
15 import com.phxl.common.utils.BaseException;
16 import com.phxl.common.utils.IdUtil;
17 import com.phxl.modules.goods.dao.ctdept.HisCtDeptDao;
18 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
19
20
21 @Service
22 public class HisCtDeptService{
23
24 @Autowired
25 private HisCtDeptDao hisCtDeptDao;
26
27 /**
28 * 日志对象
29 */
30 protected Logger logger = LoggerFactory.getLogger(getClass());
31
32 public int batchSaveOrUpdate(List<HisCtDept> depts) {
33 try {
34 checkMedDept(depts);
35 } catch (Exception e) {
36 throw new BaseException(e.getMessage());
37 }
38 if (CollectionUtils.isNotEmpty(depts)) {
39 List<String> codes = new ArrayList<String>();
40 for (HisCtDept hisCtDept : depts) {
41 String ctcpCode = hisCtDept.getHdeptCode();
42 codes.add(ctcpCode);
43 }
44 Map<String, Object> map = new HashMap<String, Object>();
45 map.put("ctcpCodes", codes);
46 List<HisCtDept> exsitList = hisCtDeptDao.batchSelect(map);
47 List<HisCtDept> insertList = new ArrayList<HisCtDept>();
48 List<HisCtDept> updateList = new ArrayList<HisCtDept>();
49 for (HisCtDept hisCtDept : depts) {
50 boolean flag = false;
51 for (HisCtDept exsitCtCareProv : exsitList) {
52 if (hisCtDept.getHdeptCode().equals(exsitCtCareProv.getHdeptCode())) {
53 hisCtDept.setId(exsitCtCareProv.getId());
54 flag = true;
55 }
56 }
57 if (!flag) {
58 hisCtDept.setId(IdUtil.uuid());
59 insertList.add(hisCtDept);
60 } else {
61 updateList.add(hisCtDept);
62 }
63 }
64 if (CollectionUtils.isNotEmpty(updateList)) {
65 hisCtDeptDao.batchUpdate(updateList);
66 }
67 if (CollectionUtils.isNotEmpty(insertList)) {
68 hisCtDeptDao.batchInsert(insertList);
69 }
70 }
71 return 1;
72 }
73
74 private void checkMedDept(List<HisCtDept> depts) {
75 if(depts == null || depts.size() == 0){
76 logger.error("无相应科室信息");
77 throw new BaseException("无相应科室信息");
78 }
79 for (HisCtDept hisCtDept : depts) {
80 String hDeptCode = hisCtDept.getHdeptCode();
81 if (StringUtils.isEmpty(hDeptCode)) {
82 logger.error("科室编码不能为空");
83 throw new BaseException("科室编码不能为空");
84 }
85 String hdeptName = hisCtDept.getHdeptName();
86 if (StringUtils.isEmpty(hdeptName)) {
87 logger.error("科室名称不能为空");
88 throw new BaseException("科室名称不能为空");
89 }
90 }
91 }
92
93
94
95 }
1 package com.phxl.modules.goods.web.spd;
2
3 import java.io.File;
4 import java.util.ArrayList;
5 import java.util.List;
6
7 import javax.servlet.http.HttpServletRequest;
8
9 import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
10
11 import org.apache.http.HttpEntity;
12 import org.apache.http.HttpResponse;
13 import org.apache.http.client.HttpClient;
14 import org.apache.http.client.methods.HttpPost;
15 import org.apache.http.entity.mime.MultipartEntityBuilder;
16 import org.apache.http.entity.mime.content.FileBody;
17 import org.apache.http.impl.client.HttpClients;
18 import org.apache.http.util.EntityUtils;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.stereotype.Controller;
23 import org.springframework.web.bind.annotation.RequestBody;
24 import org.springframework.web.bind.annotation.RequestMapping;
25 import org.springframework.web.bind.annotation.RequestMethod;
26 import org.springframework.web.bind.annotation.RequestParam;
27 import org.springframework.web.bind.annotation.ResponseBody;
28 import org.springframework.web.multipart.MultipartFile;
29
30 import com.alibaba.fastjson.JSON;
31 import com.alibaba.fastjson.JSONObject;
32 import com.alibaba.fastjson.serializer.SerializerFeature;
33 import com.fasterxml.jackson.annotation.JsonFormat;
34 import com.phxl.common.constants.PlatformConstant;
35 import com.phxl.common.response.PlatFormResponse;
36 import com.phxl.common.response.PlatFormResponseConstant;
37 import com.phxl.common.util.HTTPClient;
38 import com.phxl.common.util.JsonMapper;
39 import com.phxl.common.utils.IdUtil;
40 import com.phxl.modules.goods.entity.billback.BillBack;
41 import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
42 import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
43 import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
44 import com.phxl.modules.goods.entity.ctdept.HisCtDept;
45 import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
46 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
47 import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
48 import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
49 import com.phxl.modules.goods.entity.medplan.MedPlan;
50 import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
51 import com.phxl.modules.goods.entity.medstock.MedStock;
52 import com.phxl.modules.goods.entity.medstock.MedStockList;
53 import com.phxl.modules.goods.entity.spills.HisSpills;
54 import com.phxl.modules.goods.entity.spills.HisSpillsList;
55 import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
56 import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
57 import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
58 import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
59 import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
60 import com.phxl.modules.goods.service.billback.BillBackService;
61 import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
62 import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
63 import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
64 import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
65 import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
66 import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
67 import com.phxl.modules.goods.service.medinstore.MedInStoreService;
68 import com.phxl.modules.goods.service.medplan.MedPlanService;
69 import com.phxl.modules.goods.service.medstock.MedStockService;
70 import com.phxl.modules.goods.service.spills.HisSpillsService;
71 import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
72 import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
73 import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
74
75 @Controller
76 @RequestMapping(value = "/Api")
77 public class SpdControlller {
78
79 /**
80 * 日志对象
81 */
82 protected Logger logger = LoggerFactory.getLogger(getClass());
83
84 @Autowired
85 private HisCtMedicineMaterialService ctMedicineMaterialService;
86
87 @Autowired
88 private InterfaceLogService interfaceLogService;
89
90 @Autowired
91 private HisCtDeptService hisCtDeptService;
92
93 @Autowired
94 private CTCareProvService cTCareProvService;
95
96 @Autowired
97 private MedSupplyGoodsService supplyGoodsService;
98
99 @Autowired
100 private MedStockService stockService;
101
102 @Autowired
103 private MedPlanService medPlanService;
104
105 @Autowired
106 private MedInStoreService medInStoreService;
107
108 @Autowired
109 private BillBackService backService;
110
111 @Autowired
112 private BillSettlementService billSettlementService;
113
114 @Autowired
115 private SupplierStockService supplierStockService;
116
117 @Autowired
118 private SuOutStoreService suOutStoreService;
119
120 @Autowired
121 private HisSpillsService hisSpillsService;
122
123 @Autowired
124 private SuInvoiceBackService suInvoiceBackService;
125
126
127 @RequestMapping(value="/setMFMedGoods")
128 @ResponseBody
129 public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
130 logger.debug("药品目录接口请求参数:{}",medgoodsList);
131 String result = "";
132 String logId = IdUtil.uuid();
133 String exception = "";
134 interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
135 PlatFormResponse response = new PlatFormResponse();
136 List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
137 try {
138 materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
139 for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
140 ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
141 }
142 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
143 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
144 result = JSON.toJSONString(response);
145 //medgoodsList = ctMedicineMaterialService.createRequest();
146 //供应商服务请求:
147 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
148 } catch (Exception e) {
149 logger.error(e.getMessage());
150 exception = e.getMessage();
151 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
152 response.setMsg(e.getMessage());
153 result = JSON.toJSONString(response);
154 }
155 interfaceLogService.setResultLog(response, logId, exception);
156 return result;
157 }
158
159 @RequestMapping(value="/setHDept")
160 @ResponseBody
161 public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
162 logger.debug("医院科室资料接口请求参数:{}",params);
163 String result = "";
164 String logId = IdUtil.uuid();
165 String exception = "";
166 interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
167 PlatFormResponse response = new PlatFormResponse();
168 List<HisCtDept> depts = new ArrayList<HisCtDept>();
169 try {
170 depts = JSONObject.parseArray(params, HisCtDept.class);
171 int end = hisCtDeptService.batchSaveOrUpdate(depts);
172 if(end==1){
173 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
174 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
175 }else{
176 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
177 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
178 }
179 result = JSON.toJSONString(response);
180 //供应商服务请求:
181 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
182 } catch (Exception e) {
183 logger.error(e.getMessage());
184 exception = e.getMessage();
185 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
186 response.setMsg(e.getMessage());
187 result = JSON.toJSONString(response);
188 }
189 interfaceLogService.setResultLog(response, logId, exception);
190 return result;
191 }
192
193 /**
194 * 医院人员资料接口
195 * @param request
196 * @param params
197 * @return
198 */
199 @RequestMapping("/setMedStaff")
200 @ResponseBody
201 public String setMedStaff(HttpServletRequest request, @RequestBody String params){
202 logger.debug("医院人员资料接口请求参数:{}",params);
203 String result = "";
204 String logId = IdUtil.uuid();
205 String exception = "";
206 interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
207 PlatFormResponse response = new PlatFormResponse();
208 List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
209 boolean end = false;
210 try {
211 careProvs = JSONObject.parseArray(params, CTCareProv.class);
212 end = cTCareProvService.batchSaveOrUpdate(careProvs);
213 if(end){
214 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
215 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
216 }else{
217 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
218 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
219 }
220 result = JSON.toJSONString(response);
221 //供应商服务请求:
222 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
223 } catch (Exception e) {
224 logger.error(e.getMessage());
225 exception = e.getMessage();
226 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
227 response.setMsg(e.getMessage());
228 result = JSON.toJSONString(response);
229 }
230 interfaceLogService.setResultLog(response, logId, exception);
231 return result;
232 }
233
234
235 /**
236 * 医院采购目录接口
237 * @param request
238 * @param params
239 * @return
240 */
241 @RequestMapping("/setMFSupplyGoods")
242 @ResponseBody
243 public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
244 logger.debug("医院采购目录接口请求参数:{}",params);
245 String result = "";
246 String logId = IdUtil.uuid();
247 String exception = "";
248 interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
249 PlatFormResponse response = new PlatFormResponse();
250 List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
251 boolean end = false;
252 try {
253 supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
254 end = supplyGoodsService.batchSave(supplyGoods);
255 if(end){
256 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
257 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
258 }else{
259 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
260 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
261 }
262 result = JSON.toJSONString(response);
263 //供应商服务请求:
264 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
265 } catch (Exception e) {
266 logger.error(e.getMessage());
267 exception = e.getMessage();
268 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
269 response.setMsg(e.getMessage());
270 result = JSON.toJSONString(response);
271 }
272 interfaceLogService.setResultLog(response, logId, exception);
273 return result;
274 }
275
276
277 /**
278 * 医院库存接口
279 * @param request
280 * @param params
281 * @return
282 */
283 @ResponseBody
284 @RequestMapping(value="/setMedStock",method = RequestMethod.POST)
285 public String setMedStock(HttpServletRequest request, @RequestBody String params){
286 logger.debug("HLI同步医院库存数据请求参数:{}",params);
287 String result = "";
288 String logId = IdUtil.uuid();
289 String exception = "";
290 interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
291 PlatFormResponse response = new PlatFormResponse();
292 List<MedStockList> stocks = new ArrayList<MedStockList>();
293 boolean end = false;
294 try {
295 stocks = JSONObject.parseArray(params, MedStockList.class);
296 end = stockService.batchSave(stocks);
297 if(end){
298 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
299 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
300 }else{
301 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
302 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
303 }
304 result = JSON.toJSONString(response);
305 //供应商服务请求:
306 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
307 } catch (Exception e) {
308 logger.error(e.getMessage());
309 exception = e.getMessage();
310 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
311 response.setMsg(e.getMessage());
312 result = JSON.toJSONString(response);
313 }
314 interfaceLogService.setResultLog(response, logId, exception);
315 return result;
316 }
317
318
319 /**
320 * 医院补货计划接口
321 * @param request
322 * @param params
323 * @return
324 */
325 @RequestMapping("/setMedPlan")
326 @ResponseBody
327 public String setMedPlan(HttpServletRequest request, @RequestBody String params){
328 logger.debug("补货计划接口请求参数:{}",params);
329 String result = "";
330 String logId = IdUtil.uuid();
331 String exception = "";
332 interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
333 PlatFormResponse response = new PlatFormResponse();
334 List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
335 boolean end = false;
336 try {
337 //改成批量的操作
338 medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
339 end = medPlanService.batchSave(medPlans);
340 if(end){
341 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
342 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
343 }else{
344 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
345 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
346 }
347 result = JSON.toJSONString(response);
348 //供应商服务请求:
349 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
350 } catch (Exception e) {
351 logger.error(e.getMessage());
352 exception = e.getMessage();
353 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
354 response.setMsg(e.getMessage());
355 result = JSON.toJSONString(response);
356 }
357 interfaceLogService.setResultLog(response, logId, exception);
358 return result;
359 }
360
361
362 /**
363 * 医院退货接口
364 * @param request
365 * @param params
366 * @return
367 */
368 @RequestMapping("/setTRMedRPI")
369 @ResponseBody
370 public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
371 logger.debug("医院退货计划接口请求参数:{}",params);
372 String result = "";
373 String logId = IdUtil.uuid();
374 String exception = "";
375 interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
376 PlatFormResponse response = new PlatFormResponse();
377 List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
378 boolean end = false;
379 try {
380 billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
381 end = backService.batchSave(billBacks);
382 if(end){
383 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
384 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
385 }else{
386 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
387 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
388 }
389 result = JSON.toJSONString(response);
390 //供应商服务请求:
391 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
392 } catch (Exception e) {
393 logger.error(e.getMessage());
394 exception = e.getMessage();
395 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
396 response.setMsg(e.getMessage());
397 result = JSON.toJSONString(response);
398 }
399 interfaceLogService.setResultLog(response, logId, exception);
400 return result;
401 }
402
403 /**
404 * 结算单接口
405 * @param request
406 * @param params
407 * @return
408 */
409 @RequestMapping("/setTRSettle")
410 @ResponseBody
411 public String setTRSettle(HttpServletRequest request, @RequestBody String params){
412 logger.debug("同步医院结算单请求参数:{}",params);
413 String result = "";
414 String logId = IdUtil.uuid();
415 String exception = "";
416 interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
417 PlatFormResponse response = new PlatFormResponse();
418 List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
419 boolean end = false;
420 try {
421 settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
422 end = billSettlementService.batchSave(settlementWithDetails);
423 if(end){
424 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
425 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
426 }else{
427 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
428 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
429 }
430 result = JSON.toJSONString(response);
431 //供应商服务请求:
432 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
433 } catch (Exception e) {
434 logger.error(e.getMessage());
435 exception = e.getMessage();
436 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
437 response.setMsg(e.getMessage());
438 result = JSON.toJSONString(response);
439 }
440 interfaceLogService.setResultLog(response, logId, exception);
441 return result;
442 }
443
444
445 /**
446 * 供应商库存接口
447 * @param request
448 * @param params
449 * @return
450 */
451 @RequestMapping("/setStock")
452 @ResponseBody
453 public String setStock(HttpServletRequest request, @RequestBody String params){
454 logger.debug("供应商同步库存数据请求参数:{}",params);
455 String result = "";
456 String logId = IdUtil.uuid();
457 String exception = "";
458 interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
459 PlatFormResponse response = new PlatFormResponse();
460 List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
461 boolean end = false;
462 try {
463 supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
464 end = supplierStockService.batchSave(supplierStocks);
465 if(end){
466 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
467 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
468 }else{
469 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
470 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
471 }
472 result = JSON.toJSONString(response);
473 try
474 {
475 //SPD服务请求:
476 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
477 response = JSONObject.parseObject(result,PlatFormResponse.class);
478 response.setMsg("SPD:"+response.getMsg());
479 }
480 catch(Exception ex){
481 logger.error("SPD:"+ex.getMessage());
482 exception = "SPD:"+ex.getMessage();
483 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
484 response.setMsg("SPD:"+ex.getMessage());
485 result = JSON.toJSONString(response);
486 }
487
488 } catch (Exception e) {
489 logger.error("前置机:"+e.getMessage());
490 exception = "前置机:"+e.getMessage();
491 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
492 response.setMsg("前置机:"+e.getMessage());
493 result = JSON.toJSONString(response);
494 }
495 interfaceLogService.setResultLog(response, logId, exception);
496 return result;
497 }
498
499
500 /**
501 * 供应商出库单接口
502 * @param request
503 * @param params
504 * @return
505 */
506 @RequestMapping("/setTrmedwv")
507 @ResponseBody
508 public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
509 logger.debug("同步供应商出库单请求参数:{}",params);
510 String result = "";
511 String logId = IdUtil.uuid();
512 String exception = "";
513 interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
514 PlatFormResponse response = new PlatFormResponse();
515 List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
516 boolean end = false;
517 try {
518 suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
519 end = suOutStoreService.batchSave(suOutStores);
520 if(end){
521 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
522 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
523 }else{
524 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
525 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
526 }
527 result = JSON.toJSONString(response);
528 try
529 {
530 //SPD服务请求:
531 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
532 response = JSONObject.parseObject(result,PlatFormResponse.class);
533 response.setMsg("SPD:"+response.getMsg());
534 }
535 catch(Exception ex){
536 logger.error("SPD:"+ex.getMessage());
537 exception = "SPD:"+ex.getMessage();
538 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
539 response.setMsg("SPD:"+ex.getMessage());
540 result = JSON.toJSONString(response);
541 }
542
543 } catch (Exception e) {
544 logger.error("前置机:"+e.getMessage());
545 exception = "前置机:"+e.getMessage();
546 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
547 response.setMsg("前置机:"+e.getMessage());
548 result = JSON.toJSONString(response);
549 }
550 interfaceLogService.setResultLog(response, logId, exception);
551 return result;
552 }
553
554 /**
555 * 医院盘点损溢接口
556 * @param request
557 * @param params
558 * @return
559 */
560 @RequestMapping(value="/setTrDiff")
561 @ResponseBody
562 public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
563 logger.debug("医院盘点损溢接口请求参数:{}",params);
564 String result = "";
565 String logId = IdUtil.uuid();
566 String exception = "";
567 interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
568 PlatFormResponse response = new PlatFormResponse();
569 List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
570 boolean end = false;
571 try {
572 spills = JSONObject.parseArray(params, HisSpillsList.class);
573 end = hisSpillsService.batchSave(spills);
574 if(end){
575 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
576 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
577 }else{
578 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
579 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
580 }
581 result = JSON.toJSONString(response);
582 //供应商服务请求:
583 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
584 } catch (Exception e) {
585 logger.error(e.getMessage());
586 exception = e.getMessage();
587 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
588 response.setMsg(e.getMessage());
589 result = JSON.toJSONString(response);
590 }
591 interfaceLogService.setResultLog(response, logId, exception);
592 return result;
593 }
594
595
596 /**
597 * 供应商发票回传接口
598 * @param request
599 * @param params
600 * @return
601 */
602 @RequestMapping("/setInvoice")
603 @ResponseBody
604 public String setInvoice(HttpServletRequest request, @RequestBody String params){
605 logger.debug("供应商发票回传接口请求参数:{}",params);
606 String result = "";
607 String logId = IdUtil.uuid();
608 String exception = "";
609 interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
610 PlatFormResponse response = new PlatFormResponse();
611 List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
612 boolean end = false;
613 try {
614 suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
615 end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
616 if(end){
617 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
618 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
619 }else{
620 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
621 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
622 }
623 result = JSON.toJSONString(response);
624 try
625 {
626 //SPD服务请求:
627 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
628 response = JSONObject.parseObject(result,PlatFormResponse.class);
629 response.setMsg("SPD:"+response.getMsg());
630 }
631 catch(Exception ex){
632 logger.error("SPD:"+ex.getMessage());
633 exception = "SPD:"+ex.getMessage();
634 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
635 response.setMsg("SPD:"+ex.getMessage());
636 result = JSON.toJSONString(response);
637 }
638
639 } catch (Exception e) {
640 logger.error("前置机:"+e.getMessage());
641 exception = "前置机:"+e.getMessage();
642 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
643 response.setMsg("前置机:"+e.getMessage());
644 result = JSON.toJSONString(response);
645 }
646 interfaceLogService.setResultLog(response, logId, exception);
647 return result;
648 }
649
650 /*
651 * 医院入库单回传接口
652 * @param request
653 * @param params
654 * @return
655 */
656 @RequestMapping("/setMedInStore")
657 @ResponseBody
658 public String setMedInStore(HttpServletRequest request, @RequestBody String params){
659 logger.debug("医院入库单回传接口请求参数:{}",params);
660 String result = "";
661 String logId = IdUtil.uuid();
662 String exception = "";
663 interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
664 PlatFormResponse response = new PlatFormResponse();
665 List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
666 boolean end = false;
667 try {
668 //改成批量的操作
669 medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
670 end = medInStoreService.batchSave(medInStores);
671 if(end){
672 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
673 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
674 }else{
675 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
676 response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
677 }
678 result = JSON.toJSONString(response);
679 //供应商服务请求:
680 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
681 } catch (Exception e) {
682 logger.error(e.getMessage());
683 exception = e.getMessage();
684 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
685 response.setMsg(e.getMessage());
686 result = JSON.toJSONString(response);
687 }
688 interfaceLogService.setResultLog(response, logId, exception);
689 return result;
690 }
691
692 /***
693 * 推送对账数据到平台
694 * @param params
695 * @return
696 */
697 @RequestMapping("/pushBalance")
698 @ResponseBody
699 public String pushBalance(@RequestBody String params) {
700 logger.debug("推送对账数据:{}", params);
701 String result = "";
702 String logId = IdUtil.uuid();
703 String exception = "";
704 interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
705 PlatFormResponse response = new PlatFormResponse();
706 try {
707 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
708 JSONObject jsonObject = JSONObject.parseObject(result);
709 if(jsonObject.getIntValue("errorCode") != 0){
710 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
711 }else {
712 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
713 }
714 response.setMsg(jsonObject.getString("message"));
715 } catch (Exception e) {
716 logger.error(e.getMessage());
717 exception = e.getMessage();
718 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
719 response.setMsg("发送对账数据给平台错误:" + e.getMessage());
720 result = JSON.toJSONString(response);
721 }
722 interfaceLogService.setResultLog(response, logId, exception);
723 return result;
724
725 }
726
727
728 /**
729 * 推送发药数据到平台
730 * @param params
731 * @return
732 */
733 @RequestMapping("/pushDispensing")
734 @ResponseBody
735 public String pushDispensing(@RequestBody String params){
736 logger.debug("推送发药数据:{}", params);
737 String result = "";
738 String logId = IdUtil.uuid();
739 String exception = "";
740 interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
741 PlatFormResponse response = new PlatFormResponse();
742 try {
743 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
744 JSONObject jsonObject = JSONObject.parseObject(result);
745 if(jsonObject.getIntValue("errorCode") != 0){
746 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
747 }else {
748 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
749 }
750 response.setMsg(jsonObject.getString("message"));
751 } catch (Exception e) {
752 logger.error(e.getMessage());
753 exception = e.getMessage();
754 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
755 response.setMsg("发送发药数据给平台错误:" + e.getMessage());
756 result = JSON.toJSONString(response);
757 }
758 interfaceLogService.setResultLog(response, logId, exception);
759 return result;
760 }
761
762
763 /**
764 * 推送库存数据到平台
765 * @param params
766 * @return
767 */
768 @RequestMapping("/pushStock")
769 @ResponseBody
770 public String pushStock(@RequestBody String params){
771 logger.debug("推送库存数据:{}", params);
772 String result = "";
773 String logId = IdUtil.uuid();
774 String exception = "";
775 interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
776 PlatFormResponse response = new PlatFormResponse();
777 try {
778 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
779 JSONObject jsonObject = JSONObject.parseObject(result);
780 if(jsonObject.getIntValue("errorCode") != 0){
781 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
782 }else {
783 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
784 }
785 response.setMsg(jsonObject.getString("message"));
786 } catch (Exception e) {
787 logger.error(e.getMessage());
788 exception = e.getMessage();
789 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
790 response.setMsg("发送库存数据给平台错误:" + e.getMessage());
791 result = JSON.toJSONString(response);
792 }
793 interfaceLogService.setResultLog(response, logId, exception);
794 return result;
795 }
796
797 /**
798 * 推送证照数据到平台
799 * @param params
800 * @return
801 */
802 @RequestMapping("/pushlicinfo")
803 @ResponseBody
804 public String pushlicinfo(@RequestBody String params){
805 logger.debug("证照数据:{}", params);
806 String result = "";
807 String logId = IdUtil.uuid();
808 String exception = "";
809 interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
810 PlatFormResponse response = new PlatFormResponse();
811 try {
812 result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
813 JSONObject jsonObject = JSONObject.parseObject(result);
814 if(jsonObject.getIntValue("errorCode") != 0){
815 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
816 }else {
817 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
818 }
819 response.setMsg(jsonObject.getString("message"));
820 } catch (Exception e) {
821 logger.error(e.getMessage());
822 exception = e.getMessage();
823 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
824 response.setMsg("发送证照数据给平台错误:" + e.getMessage());
825 result = JSON.toJSONString(response);
826 }
827 interfaceLogService.setResultLog(response, logId, exception);
828 return result;
829 }
830
831
832 /**
833 * 推送证照图片数据到平台
834 * @param params
835 * @return
836 */
837 @RequestMapping("/pushlicpicinfo")
838 @ResponseBody
839 public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
840 String result = "";
841 String logId = IdUtil.uuid();
842 String exception = "";
843 PlatFormResponse response = new PlatFormResponse();
844 interfaceLogService.saveLog("pushDispensing:(推送证照数据)","filename////"+file.getOriginalFilename(), logId);
845 try {
846 if (file!=null) {
847 HttpClient client = HttpClients.createDefault();
848 HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
849 String fileName = file.getOriginalFilename();
850 String prefix = fileName.substring(fileName.lastIndexOf("."));
851 String filePreName= fileName.substring(0,fileName.lastIndexOf("."));
852 File newfile = File.createTempFile(filePreName+ "", prefix);
853 file.transferTo(newfile);
854 FileBody bin = new FileBody(newfile);
855 HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
856 post.setEntity(reqEntity);
857 HttpResponse htppresponse = client.execute(post);
858 HttpEntity resEntity = htppresponse.getEntity();
859 result = EntityUtils.toString(resEntity, "UTF-8");
860 JSONObject jsonObject = JSONObject.parseObject(result);
861 if(!"Y".equals(jsonObject.getString("FLAG"))){
862 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
863 }else {
864 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
865 }
866 response.setMsg(jsonObject.toJSONString());
867 }
868
869 } catch (Exception e) {
870 logger.error(e.getMessage());
871 exception = e.getMessage();
872 response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
873 response.setMsg("发送证照图片数据给平台错误:" + e.getMessage());
874 result = JSON.toJSONString(response);
875 }
876 interfaceLogService.setResultLog(response, logId, exception);
877 return result;
878 }
879 }
No preview for this file type
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <project name="maven-antrun-" default="main" >
3 <target name="main">
4 <move todir="D:\WorkSpaces\SPD\CS\medicinal-supplier\target/medicinal-supplier-1.0-prod/">
5 <fileset dir="D:\WorkSpaces\SPD\CS\medicinal-supplier\target/classes/">
6 <include name="Runner.class"/>
7 </fileset>
8 </move>
9 </target>
10 </project>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ehcache updateCheck="false" name="defaultCache">
3
4 <diskStore path="../temp/medicinal/ehcache" />
5
6 <!-- 默认缓存配置. 自动失效:最后一次访问时间间隔300秒失效,若没有访问过自创建时间600秒失效。-->
7 <defaultCache maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
8 overflowToDisk="true" statistics="true"/>
9
10 <!-- 系统缓存 -->
11 <cache name="sysCache" maxEntriesLocalHeap="1000" eternal="true" overflowToDisk="true" statistics="true"/>
12
13 </ehcache>
...\ No newline at end of file ...\ No newline at end of file
1
2 jdbc.type=mysql
3 jdbc.driver=com.mysql.jdbc.Driver
4 jdbc.url=jdbc:mysql://10.146.9.50:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
5 jdbc.username=root
6 jdbc.password=BOE190326jdfyy
7
8 spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
9
10 huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
11
12 #spd服务地址
13 spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
14 spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
15 spd_wechat_logout=http://10.146.9.50:8080/medicinal-web/a/logout
16
17 appid=wx9657f3a42806237c
18 appsecrent=fb6768612d5802551d202d9b4e59d23e
19 token=spd
20
21
22 ehcache.configFile=cache/ehcache-local.xml
23 version=V1.2.7
24 order_template_id=a8mZCkoeBHiqwVUJvDbrNS-qe5mT8wVksutVY_MWSjs
25 store_template_id=wF6hltnW1eYLQRcGIVc7SUCClnR3FXbb9575PDnw3q0
26 lic_template_id=eHuLEQ9lwvfK_ovjKlupDDfMTkUrbbuVPL5-gOSmAuM
27 local_url=http://ht.yao4pl.com
1 <?xml version="1.0" ?>
2
3 <!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
4 debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
5 <configuration scan="true" scanPeriod="600 seconds" debug="false">
6 <!-- 定义日志文件 输入位置 -->
7 <property name="log_dir" value="/usr/supplierlog"/>
8 <!-- 日志最大的历史-->
9 <property name="maxHistory" value="90"/>
10 <property name="normal-pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
11
12 <!-- ConsoleAppender 控制台输出日志 -->
13 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
14 <!-- 对日志进行格式化 -->
15 <encoder>
16 <pattern>${normal-pattern}</pattern>
17 </encoder>
18 </appender>
19
20 <!-- ERROR级别日志 -->
21 <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
22 <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
23 <!-- 过滤器,只记录WARN级别的日志 -->
24 <filter class="ch.qos.logback.classic.filter.LevelFilter">
25 <level>ERROR</level>
26 <onMatch>ACCEPT</onMatch>
27 <onMismatch>DENY</onMismatch>
28 </filter>
29 <file>${log_dir}/error.log</file>
30 <!-- 配置日志所生成的目录-->
31 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
32 <fileNamePattern>${log_dir}/error-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
33 <maxHistory>${maxHistory}</maxHistory>
34 </rollingPolicy>
35 <encoder>
36 <pattern>${normal-pattern}</pattern>
37 </encoder>
38 </appender>
39
40 <!-- INFO级别日志 appender -->
41 <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
42 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
43 <level>INFO</level>
44 </filter>
45 <file>${log_dir}/info.log</file>
46 <!-- 配置日志所生成的目录-->
47 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
48 <fileNamePattern>${log_dir}/info-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
49 <maxHistory>${maxHistory}</maxHistory>
50 </rollingPolicy>
51 <encoder>
52 <pattern>${normal-pattern}</pattern>
53 </encoder>
54 </appender>
55
56 <!-- DEBUG级别日志 appender -->
57 <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
58 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
59 <level>DEBUG</level>
60 </filter>
61 <file>${log_dir}/debug.log</file>
62 <!-- 配置日志所生成的目录-->
63 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
64 <fileNamePattern>${log_dir}/debug-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
65 <maxHistory>${maxHistory}</maxHistory>
66 </rollingPolicy>
67 <encoder>
68 <pattern>${normal-pattern}</pattern>
69 </encoder>
70 </appender>
71
72 <logger name="org.apache.zookeeper.ClientCnxn" level="ERROR" additivity="false"/>
73
74 <logger name="com.phxl.modules.goods.dao" level="debug" additivity="false">
75 <appender-ref ref="debug" />
76 </logger>
77
78 <!-- root级别 DEBUG -->
79 <root level="DEBUG">
80 <!-- 控制台输出 -->
81 <appender-ref ref="STDOUT" />
82 <!-- 文件输出 -->
83 <appender-ref ref="ERROR" />
84 <appender-ref ref="INFO" />
85 <appender-ref ref="DEBUG" />
86 </root>
87 </configuration>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billback.BillBackDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
12 <result column="medMV_row_no" property="medMVRowNo" jdbcType="TINYINT" />
13 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
14 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
15 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
16 <result column="returns_unit" property="returns_Unit" jdbcType="VARCHAR" />
17 <result column="returns_price" property="returns_Price" jdbcType="DECIMAL" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="rpi_qty" property="rpiQty" jdbcType="DECIMAL" />
20 <result column="amount" property="amount" jdbcType="DECIMAL" />
21 <result column="lot" property="lot" jdbcType="VARCHAR" />
22 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
23 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
24 <result column="memo" property="memo" jdbcType="VARCHAR" />
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,bill_no,row_no,medMV_bill_no,medMV_row_no,goods_code,goods_name,goods_spec,returns_unit,returns_price,manufacturer,rpi_qty,amount,lot,production_date,expire_date,memo</sql>
29
30 <!--批量插入BillBackDetail -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_bill_back_detail (id,bill_no,row_no,medMV_bill_no,medMV_row_no,goods_code,goods_name,goods_spec,returns_unit,returns_price,manufacturer,rpi_qty,amount,lot,production_date,expire_date,memo)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.billNo},
38 #{obj.rowNo},
39 #{obj.medMVBillNo},
40 #{obj.medMVRowNo},
41 #{obj.goodsCode},
42 #{obj.goodsName},
43 #{obj.goodsSpec},
44 #{obj.returns_Unit},
45 #{obj.returns_Price},
46 #{obj.manufacturer},
47 #{obj.rpiQty},
48 #{obj.amount},
49 #{obj.lot},
50 #{obj.productionDate},
51 #{obj.expireDate},
52 #{obj.memo}
53 </trim>
54 </foreach>
55 </insert>
56
57
58 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billback.BillBack">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
11 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
12 <result column="supplierb_name" property="supplierbName" jdbcType="VARCHAR" />
13 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
14 <result column="med_name" property="medName" jdbcType="VARCHAR" />
15 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
16 <result column="reason" property="reason" jdbcType="VARCHAR" />
17 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
18 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
19 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
20 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
21 <result column="memo" property="memo" jdbcType="VARCHAR" />
22 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
23 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
24 </resultMap>
25
26 <!--Base_Column_List -->
27 <sql id="Base_Column_List">id,bill_no,medMV_bill_no,supplier_code,supplierb_name,med_code,med_name,bill_date,reason,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
28
29
30 <!-- 新增BillBack-->
31 <insert id="insert" parameterType="com.phxl.modules.goods.entity.billback.BillBack">
32 insert into med_bill_back (id,bill_no,medMV_bill_no,supplier_code,supplierb_name,med_code,med_name,bill_date,reason,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
33 values (
34 #{id,jdbcType=VARCHAR}
35 ,#{billNo,jdbcType=VARCHAR}
36 ,#{medMVBillNo,jdbcType=VARCHAR}
37 ,#{supplierCode,jdbcType=VARCHAR}
38 ,#{supplierbName,jdbcType=VARCHAR}
39 ,#{medCode,jdbcType=VARCHAR}
40 ,#{medName,jdbcType=VARCHAR}
41 ,#{billDate,jdbcType=TIMESTAMP}
42 ,#{reason,jdbcType=VARCHAR}
43 ,#{countSum,jdbcType=TINYINT}
44 ,#{detailSum,jdbcType=DECIMAL}
45 ,#{operaterName,jdbcType=VARCHAR}
46 ,#{inputDate,jdbcType=TIMESTAMP}
47 ,#{memo,jdbcType=VARCHAR}
48 ,#{create_time,jdbcType=TIMESTAMP}
49 ,#{update_time,jdbcType=TIMESTAMP}
50 )
51 </insert>
52
53 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_cate" property="goodsCate" jdbcType="VARCHAR" />
12 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
13 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
14 <result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
15 <result column="unit" property="unit" jdbcType="VARCHAR" />
16 <result column="settle_price" property="settleUnit" jdbcType="DECIMAL" />
17 <result column="settle_amount" property="settlePrice" jdbcType="DECIMAL" />
18 <result column="regist_key" property="registKey" jdbcType="VARCHAR" />
19 <result column="producer_name" property="producerName" jdbcType="VARCHAR" />
20 <result column="lot" property="lot" jdbcType="VARCHAR" />
21 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
22 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
23 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
24 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,settle_bill_no,row_no,goods_code,goods_name,settle_qty,unit,settle_price,settle_amount,regist_key,producer_name,lot,production_date,expire_date,create_time,update_time,goods_cate</sql>
29
30 <!--批量插入BillBackDetail -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_bill_settlement_detail (id,settle_bill_no,row_no,goods_code,goods_name,settle_qty,unit,settle_price,settle_amount,regist_key,producer_name,lot,production_date,expire_date,create_time,update_time,goods_cate)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.settleBillNo},
38 #{obj.rowNo},
39 #{obj.goodsCode},
40 #{obj.goodsName},
41 #{obj.settleQty},
42 #{obj.unit},
43 #{obj.settlePrice},
44 #{obj.settleAmount},
45 #{obj.registKey},
46 #{obj.producerName},
47 #{obj.lot},
48 #{obj.productionDate},
49 #{obj.expireDate},
50 #{obj.create_time},
51 #{obj.update_time},
52 #{obj.goodsCate}
53 </trim>
54 </foreach>
55 </insert>
56
57 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
11 <result column="bill_state" property="billState" jdbcType="VARCHAR" />
12 <result column="purchaser_corp_code" property="medCode" jdbcType="VARCHAR" />
13 <result column="purchaser_corp_name" property="medName" jdbcType="VARCHAR" />
14 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
15 <result column="supplier_name" property="supplierName" jdbcType="TIMESTAMP" />
16 <result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
17 <result column="amount" property="amount" jdbcType="DECIMAL" />
18 <result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
19 <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
20 <result column="use_bill_no" property="usebillno" jdbcType="VARCHAR" />
21 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
22 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
23 </resultMap>
24
25 <!--Base_Column_List -->
26 <sql id="Base_Column_List">id,settle_bill_no,settle_date,bill_state,purchaser_corp_code,purchaser_corp_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,use_bill_no,create_time,update_time</sql>
27
28
29 <!-- 新增BillBack-->
30 <insert id="insert" parameterType="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
31 insert into med_bill_settlement (id,settle_bill_no,settle_date,bill_state,purchaser_corp_code,purchaser_corp_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,use_bill_no,create_time,update_time)
32 values (
33 #{id,jdbcType=VARCHAR}
34 ,#{settleBillNo,jdbcType=VARCHAR}
35 ,#{settleDate,jdbcType=TIMESTAMP}
36 ,#{billState,jdbcType=VARCHAR}
37 ,#{medCode,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{supplierCode,jdbcType=VARCHAR}
40 ,#{supplierName,jdbcType=TIMESTAMP}
41 ,#{goodsSum,jdbcType=TINYINT}
42 ,#{amount,jdbcType=DECIMAL}
43 ,#{beginDate,jdbcType=TIMESTAMP}
44 ,#{endDate,jdbcType=TIMESTAMP}
45 ,#{useBillNo,jdbcType=VARCHAR}
46 ,#{create_time,jdbcType=TIMESTAMP}
47 ,#{update_time,jdbcType=TIMESTAMP}
48 )
49 </insert>
50
51 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
10 <result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
11 <result column="real_name" property="realName" jdbcType="VARCHAR" />
12 <result column="help_code" property="helpCode" jdbcType="VARCHAR" />
13 <result column="sex" property="sex" jdbcType="VARCHAR" />
14 <result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
15 <result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
16 <result column="idcode" property="idcode" jdbcType="VARCHAR" />
17 <result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
18 <result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
19 <result column="category" property="category" jdbcType="VARCHAR" />
20 <result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
21 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
22 </resultMap>
23
24 <!--Base_Column_List -->
25 <sql id="Base_Column_List">id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time</sql>
26
27 <!--批量插入MedPlanDetail -->
28 <insert id="batchInsert" parameterType="list">
29 insert into med_hli_care_prov (id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time)
30 values
31 <foreach collection ="list" item="obj" separator =",">
32 <trim prefix=" (" suffix=")" suffixOverrides=",">
33 #{obj.id},
34 #{obj.mfmedStaffCode},
35 #{obj.logonUser},
36 #{obj.realName},
37 #{obj.helpCode},
38 #{obj.sex},
39 #{obj.mobileTel},
40 #{obj.webChatCode},
41 #{obj.idcode},
42 #{obj.e_mail},
43 #{obj.hdeptCode},
44 #{obj.category},
45 #{obj.ishadministrator},
46 #{obj.update_time}
47 </trim>
48 </foreach>
49 </insert>
50
51 <!-- 批量查询HisCtDept -->
52 <select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
53 select
54 <include refid="Base_Column_List" />
55 from med_hli_care_prov
56 <if test="ryCodes != null">
57 where mfmed_staff_code in
58 <foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
59 #{item}
60 </foreach>
61 </if>
62 </select>
63
64 <update id="batchUpdate" parameterType="list">
65 update med_hli_care_prov
66 <trim prefix="set" suffixOverrides=",">
67 <trim prefix="mfmed_staff_code=case" suffix="end,">
68 <foreach collection="list" item="obj" index="index">
69 <if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
70 when id = #{obj.id}
71 then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
72 </if>
73 </foreach>
74 </trim>
75 <trim prefix="logon_user=case" suffix="end,">
76 <foreach collection="list" item="obj" index="index">
77 <if test="obj.logonUser != null and obj.logonUser != ''">
78 when id = #{obj.id}
79 then
80 #{obj.logonUser,jdbcType=VARCHAR}
81 </if>
82 </foreach>
83 </trim>
84 <trim prefix="help_code=case" suffix="end,">
85 <foreach collection="list" item="obj" index="index">
86 <if test="obj.helpCode != null and obj.helpCode != ''">
87 when id = #{obj.id}
88 then #{obj.helpCode,jdbcType=VARCHAR}
89 </if>
90 </foreach>
91 </trim>
92 <trim prefix="real_name=case" suffix="end,">
93 <foreach collection="list" item="obj" index="index">
94 <if test="obj.realName != null and obj.realName != ''">
95 when id = #{obj.id}
96 then #{obj.realName,jdbcType=VARCHAR}
97 </if>
98 </foreach>
99 </trim>
100 <trim prefix="help_code=case" suffix="end,">
101 <foreach collection="list" item="obj" index="index">
102 <if test="obj.helpCode != null and obj.helpCode != ''">
103 when id = #{obj.id}
104 then #{obj.helpCode,jdbcType=VARCHAR}
105 </if>
106 </foreach>
107 </trim>
108 <trim prefix="sex=case" suffix="end,">
109 <foreach collection="list" item="obj" index="index">
110 <if test="obj.sex != null and obj.sex != ''">
111 when id = #{obj.id}
112 then #{obj.sex,jdbcType=VARCHAR}
113 </if>
114 </foreach>
115 </trim>
116 <trim prefix="mobile_tel=case" suffix="end,">
117 <foreach collection="list" item="obj" index="index">
118 <if test="obj.mobileTel != null and obj.mobileTel != ''">
119 when id = #{obj.id}
120 then #{obj.mobileTel,jdbcType=VARCHAR}
121 </if>
122 </foreach>
123 </trim>
124 <trim prefix="category=case" suffix="end,">
125 <foreach collection="list" item="obj" index="index">
126 <if test="obj.category != null and obj.category != ''">
127 when id = #{obj.id}
128 then #{obj.category,jdbcType=VARCHAR}
129 </if>
130 </foreach>
131 </trim>
132 <trim prefix="web_chat_code=case" suffix="end,">
133 <foreach collection="list" item="obj" index="index">
134 <if test="obj.webChatCode != null and obj.webChatCode != ''">
135 when id = #{obj.id}
136 then #{obj.webChatCode,jdbcType=VARCHAR}
137 </if>
138 </foreach>
139 </trim>
140 <trim prefix="idcode=case" suffix="end,">
141 <foreach collection="list" item="obj" index="index">
142 <if test="obj.idcode != null and obj.idcode != ''">
143 when id = #{obj.id}
144 then #{obj.idcode,jdbcType=VARCHAR}
145 </if>
146 </foreach>
147 </trim>
148 <trim prefix="hdept_code=case" suffix="end,">
149 <foreach collection="list" item="obj" index="index">
150 <if test="obj.hdeptCode != null and obj.hdeptCode != ''">
151 when id = #{obj.id}
152 then #{obj.hdeptCode,jdbcType=VARCHAR}
153 </if>
154 </foreach>
155 </trim>
156 <trim prefix="e_mail=case" suffix="end,">
157 <foreach collection="list" item="obj" index="index">
158 <if test="obj.e_mail != null and obj.e_mail != ''">
159 when id = #{obj.id}
160 then #{obj.e_mail,jdbcType=VARCHAR}
161 </if>
162 </foreach>
163 </trim>
164 <trim prefix="ishadministrator=case" suffix="end,">
165 <foreach collection="list" item="obj" index="index">
166 <if test="obj.ishadministrator != null and obj.ishadministrator != ''">
167 when id = #{obj.id}
168 then #{obj.ishadministrator,jdbcType=VARCHAR}
169 </if>
170 </foreach>
171 </trim>
172 <trim prefix="category=case" suffix="end,">
173 <foreach collection="list" item="obj" index="index">
174 <if test="obj.category != null and obj.category != ''">
175 when id = #{obj.id}
176 then #{obj.category,jdbcType=VARCHAR}
177 </if>
178 </foreach>
179 </trim>
180 <trim prefix="update_time=case" suffix="end,">
181 <foreach collection="list" item="obj" index="index">
182 <if test="obj.update_time != null and obj.update_time != ''">
183 when id = #{obj.id}
184 then #{obj.update_time,jdbcType=VARCHAR}
185 </if>
186 </foreach>
187 </trim>
188 </trim>
189 where
190 <foreach collection="list" separator="or" item="obj" index="index">
191 id
192 = #{obj.id}
193 </foreach>
194 </update>
195
196
197 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.ctdept.HisCtDeptDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.ctdept.HisCtDept">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
10 <result column="hdept_name" property="hdeptName" jdbcType="VARCHAR" />
11 <result column="help_code" property="helpCode" jdbcType="VARCHAR" />
12 <result column="upper_GUID" property="upperGUID" jdbcType="VARCHAR" />
13 <result column="is_order_right" property="isOrderRight" jdbcType="VARCHAR" />
14 <result column="category" property="category" jdbcType="VARCHAR" />
15 <result column="director" property="director" jdbcType="VARCHAR" />
16 <result column="state" property="state" jdbcType="VARCHAR" />
17 <result column="is_last_level" property="isLastLevel" jdbcType="VARCHAR" />
18 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
19 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
20 </resultMap>
21
22 <!--Base_Column_List -->
23 <sql id="Base_Column_List">id,hdept_code,hdept_name,help_code,upper_GUID,is_order_right,category,director,state,is_last_level,create_time,update_time</sql>
24
25 <!-- 批量查询 -->
26 <select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
27 select
28 <include refid="Base_Column_List" />
29 from med_hli_dept
30 <if test="ctcpCodes != null">
31 where hdept_code in
32 <foreach item="item" index="index" collection="ctcpCodes" open="(" separator="," close=")">
33 #{item}
34 </foreach>
35 </if>
36 </select>
37
38 <!--批量插入 -->
39 <insert id="batchInsert" parameterType="list">
40 insert into med_hli_dept (id,hdept_code,hdept_name,help_code,upper_GUID,is_order_right,category,director,state,is_last_level,create_time,update_time)
41 values
42 <foreach collection ="list" item="obj" separator =",">
43 <trim prefix=" (" suffix=")" suffixOverrides=",">
44 #{obj.id},
45 #{obj.hdeptCode},
46 #{obj.hdeptName},
47 #{obj.helpCode},
48 #{obj.upperGUID},
49 #{obj.isOrderRight},
50 #{obj.category},
51 #{obj.director},
52 #{obj.state},
53 #{obj.isLastLevel},
54 #{obj.create_time},
55 #{obj.update_time}
56 </trim>
57 </foreach>
58 </insert>
59
60 <update id="batchUpdate" parameterType="list">
61 update med_hli_dept
62 <trim prefix="set" suffixOverrides=",">
63 <trim prefix="hdept_code=case" suffix="end,">
64 <foreach collection="list" item="obj" index="index">
65 <if test="obj.hdeptCode != null and obj.hdeptCode != ''">
66 when id = #{obj.id}
67 then #{obj.hdeptCode,jdbcType=VARCHAR}
68 </if>
69 </foreach>
70 </trim>
71 <trim prefix="hdept_name=case" suffix="end,">
72 <foreach collection="list" item="obj" index="index">
73 <if test="obj.hdeptName != null and obj.hdeptName != ''">
74 when id = #{obj.id}
75 then
76 #{obj.hdeptName,jdbcType=VARCHAR}
77 </if>
78 </foreach>
79 </trim>
80 <trim prefix="help_code=case" suffix="end,">
81 <foreach collection="list" item="obj" index="index">
82 <if test="obj.helpCode != null and obj.helpCode != ''">
83 when id = #{obj.id}
84 then #{obj.helpCode,jdbcType=VARCHAR}
85 </if>
86 </foreach>
87 </trim>
88 <trim prefix="upper_GUID=case" suffix="end,">
89 <foreach collection="list" item="obj" index="index">
90 <if test="obj.upperGUID != null and obj.upperGUID != ''">
91 when id = #{obj.id}
92 then #{obj.upperGUID,jdbcType=VARCHAR}
93 </if>
94 </foreach>
95 </trim>
96 <trim prefix="is_order_right=case" suffix="end,">
97 <foreach collection="list" item="obj" index="index">
98 <if test="obj.isOrderRight != null and obj.isOrderRight != ''">
99 when id = #{obj.id}
100 then #{obj.isOrderRight,jdbcType=VARCHAR}
101 </if>
102 </foreach>
103 </trim>
104 <trim prefix="category=case" suffix="end,">
105 <foreach collection="list" item="obj" index="index">
106 <if test="obj.category != null and obj.category != ''">
107 when id = #{obj.id}
108 then #{obj.category,jdbcType=VARCHAR}
109 </if>
110 </foreach>
111 </trim>
112 <trim prefix="director=case" suffix="end,">
113 <foreach collection="list" item="obj" index="index">
114 <if test="obj.director != null and obj.director != ''">
115 when id = #{obj.id}
116 then #{obj.director,jdbcType=VARCHAR}
117 </if>
118 </foreach>
119 </trim>
120 <trim prefix="state=case" suffix="end,">
121 <foreach collection="list" item="obj" index="index">
122 <if test="obj.state != null and obj.state != ''">
123 when id = #{obj.id}
124 then #{obj.state,jdbcType=VARCHAR}
125 </if>
126 </foreach>
127 </trim>
128 <trim prefix="is_last_level=case" suffix="end,">
129 <foreach collection="list" item="obj" index="index">
130 <if test="obj.isLastLevel != null and obj.isLastLevel != ''">
131 when id = #{obj.id}
132 then #{obj.isLastLevel,jdbcType=VARCHAR}
133 </if>
134 </foreach>
135 </trim>
136 <trim prefix="create_time=case" suffix="end,">
137 <foreach collection="list" item="obj" index="index">
138 <if test="obj.create_time != null">
139 when id = #{obj.id}
140 then #{obj.create_time,jdbcType=DATE}
141 </if>
142 </foreach>
143 </trim>
144 <trim prefix="update_time=case" suffix="end,">
145 <foreach collection="list" item="obj" index="index">
146 <if test="obj.update_time != null">
147 when id = #{obj.id}
148 then #{obj.update_time,jdbcType=DATE}
149 </if>
150 </foreach>
151 </trim>
152 </trim>
153 where
154 <foreach collection="list" separator="or" item="obj" index="index">
155 id
156 = #{obj.id}
157 </foreach>
158 </update>
159
160
161 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao">
4
5 <!--BaseResultMap-->
6 <resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
7 <id column="id" property="id" jdbcType="BIGINT"/>
8 <result column="med_code" property="medCode" jdbcType="VARCHAR"/>
9 <result column="med_name" property="medName" jdbcType="VARCHAR"/>
10 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
11 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
13 <result column="s_name" property="sName" jdbcType="VARCHAR"/>
14 <result column="p_name" property="pName" jdbcType="VARCHAR"/>
15 <result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
16 <result column="producer" property="producer" jdbcType="VARCHAR"/>
17 <result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
18 <result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
19 <result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
20 <result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
21 <result column="price" property="price" jdbcType="DECIMAL"/>
22 <result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
23 <result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
24 <result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
25 <result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
26 <result column="length" property="length" jdbcType="DECIMAL"/>
27 <result column="width" property="width" jdbcType="DECIMAL"/>
28 <result column="height" property="height" jdbcType="DECIMAL"/>
29 <result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
30 <result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
31 <result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
32 <result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
33 <result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
34 <result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
35 <result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
36 <result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
37 <result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
38 <result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
39 <result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
40 <result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
41 <result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
42 <result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
43 <result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
44 <result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
45 <result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
46 <result column="brand" property="brand" jdbcType="VARCHAR"/>
47 <result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
48 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
49 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
50 <result column="memo" property="memo" jdbcType="VARCHAR"/>
51 </resultMap>
52
53 <!--Base_Column_List-->
54 <sql id="Base_Column_List">id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo</sql>
55
56 <!-- 新增HisCtMedicineMaterial-->
57 <insert id="insert" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
58 insert into med_hli_medicine_material (id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo)
59 values (
60 #{id,jdbcType=VARCHAR}
61 ,#{medCode,jdbcType=VARCHAR}
62 ,#{medName,jdbcType=VARCHAR}
63 ,#{goodsCode,jdbcType=VARCHAR}
64 ,#{goodsSpec,jdbcType=VARCHAR}
65 ,#{goodsName,jdbcType=VARCHAR}
66 ,#{sName,jdbcType=VARCHAR}
67 ,#{pName,jdbcType=VARCHAR}
68 ,#{helpCode,jdbcType=VARCHAR}
69 ,#{producer,jdbcType=VARCHAR}
70 ,#{agentName,jdbcType=VARCHAR}
71 ,#{medGoodsCateGUID,jdbcType=VARCHAR}
72 ,#{medGoodsCateName,jdbcType=VARCHAR}
73 ,#{registKey,jdbcType=VARCHAR}
74 ,#{price,jdbcType=DECIMAL}
75 ,#{salePrice,jdbcType=DECIMAL}
76 ,#{batSalePrice,jdbcType=DECIMAL}
77 ,#{productionAddress,jdbcType=VARCHAR}
78 ,#{dosageForm,jdbcType=VARCHAR}
79 ,#{length,jdbcType=DECIMAL}
80 ,#{width,jdbcType=DECIMAL}
81 ,#{height,jdbcType=DECIMAL}
82 ,#{grossWeight,jdbcType=DECIMAL}
83 ,#{netWeight,jdbcType=DECIMAL}
84 ,#{unitStyle,jdbcType=VARCHAR}
85 ,#{bigUnitStyle,jdbcType=VARCHAR}
86 ,#{bigUnitQty,jdbcType=DECIMAL}
87 ,#{bigBcd,jdbcType=VARCHAR}
88 ,#{minUnitStyle,jdbcType=VARCHAR}
89 ,#{minUnitQty,jdbcType=DECIMAL}
90 ,#{litBcd,jdbcType=VARCHAR}
91 ,#{isLotCtrlInput,jdbcType=VARCHAR}
92 ,#{bizState,jdbcType=VARCHAR}
93 ,#{importedFlag,jdbcType=VARCHAR}
94 ,#{reportFlag,jdbcType=VARCHAR}
95 ,#{noxiousFlag,jdbcType=VARCHAR}
96 ,#{drugNerveFlag,jdbcType=VARCHAR}
97 ,#{productStandardCode,jdbcType=VARCHAR}
98 ,#{specStandardCode,jdbcType=VARCHAR}
99 ,#{brand,jdbcType=VARCHAR}
100 ,#{coldFlag,jdbcType=VARCHAR}
101 ,#{supplierCode,jdbcType=VARCHAR}
102 ,#{supplierName,jdbcType=VARCHAR}
103 ,#{memo,jdbcType=VARCHAR}
104 )
105 </insert>
106
107 <!-- 按需修改HisCtMedicineMaterial-->
108 <update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
109 update med_hli_medicine_material
110 <set>
111 <if test="medName != null and medName != ''">
112 med_name = #{medName,jdbcType=VARCHAR},
113 </if>
114 <if test="goodsCode != null and goodsCode != ''">
115 goods_code = #{goodsCode,jdbcType=VARCHAR},
116 </if>
117 <if test="goodsSpec != null and goodsSpec != ''">
118 goods_spec = #{goodsSpec,jdbcType=VARCHAR},
119 </if>
120 <if test="goodsName != null and goodsName != ''">
121 goods_name = #{goodsName,jdbcType=VARCHAR},
122 </if>
123 <if test="sName != null and sName != ''">
124 s_name = #{sName,jdbcType=VARCHAR},
125 </if>
126 <if test="pName != null and pName != ''">
127 p_name = #{pName,jdbcType=VARCHAR},
128 </if>
129 <if test="helpCode != null and helpCode != ''">
130 help_code = #{helpCode,jdbcType=VARCHAR},
131 </if>
132 <if test="producer != null and producer != ''">
133 producer = #{producer,jdbcType=VARCHAR},
134 </if>
135 <if test="agentName != null and agentName != ''">
136 agent_name = #{agentName,jdbcType=VARCHAR},
137 </if>
138 <if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
139 med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
140 </if>
141 <if test="medGoodsCateName != null and medGoodsCateName != ''">
142 med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
143 </if>
144 <if test="registKey != null and registKey != ''">
145 regist_key = #{registKey,jdbcType=VARCHAR},
146 </if>
147 <if test="price != null and price != ''">
148 price = #{price,jdbcType=DECIMAL},
149 </if>
150 <if test="salePrice != null and salePrice != ''">
151 sale_price = #{salePrice,jdbcType=DECIMAL},
152 </if>
153 <if test="batSalePrice != null and batSalePrice != ''">
154 bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
155 </if>
156 <if test="productionAddress != null and productionAddress != ''">
157 production_address = #{productionAddress,jdbcType=VARCHAR},
158 </if>
159 <if test="dosageForm != null and dosageForm != ''">
160 dosage_form = #{dosageForm,jdbcType=VARCHAR},
161 </if>
162 <if test="length != null and length != ''">
163 length = #{length,jdbcType=DECIMAL},
164 </if>
165 <if test="width != null and width != ''">
166 width = #{width,jdbcType=DECIMAL},
167 </if>
168 <if test="height != null and height != ''">
169 height = #{height,jdbcType=DECIMAL},
170 </if>
171 <if test="grossWeight != null and grossWeight != ''">
172 gross_weight = #{grossWeight,jdbcType=DECIMAL},
173 </if>
174 <if test="netWeight != null and netWeight != ''">
175 net_weight = #{netWeight,jdbcType=DECIMAL},
176 </if>
177 <if test="unitStyle != null and unitStyle != ''">
178 unit_style = #{unitStyle,jdbcType=VARCHAR},
179 </if>
180 <if test="bigUnitStyle != null and bigUnitStyle != ''">
181 big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
182 </if>
183 <if test="bigUnitQty != null and bigUnitQty != ''">
184 big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
185 </if>
186 <if test="bigBcd != null and bigBcd != ''">
187 big_bcd = #{bigBcd,jdbcType=VARCHAR},
188 </if>
189 <if test="minUnitStyle != null and minUnitStyle != ''">
190 min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
191 </if>
192 <if test="minUnitQty != null and minUnitQty != ''">
193 min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
194 </if>
195 <if test="litBcd != null and litBcd != ''">
196 lit_bcd = #{litBcd,jdbcType=VARCHAR},
197 </if>
198 <if test="isLotCtrlInput != null and isLotCtrlInput != ''">
199 is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
200 </if>
201 <if test="bizState != null and bizState != ''">
202 biz_state = #{bizState,jdbcType=VARCHAR},
203 </if>
204 <if test="importedFlag != null and importedFlag != ''">
205 imported_flag = #{importedFlag,jdbcType=VARCHAR},
206 </if>
207 <if test="reportFlag != null and reportFlag != ''">
208 report_flag = #{reportFlag,jdbcType=VARCHAR},
209 </if>
210 <if test="noxiousFlag != null and noxiousFlag != ''">
211 noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
212 </if>
213 <if test="drugNerveFlag != null and drugNerveFlag != ''">
214 drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
215 </if>
216 <if test="productStandardCode != null and productStandardCode != ''">
217 product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
218 </if>
219 <if test="specStandardCode != null and specStandardCode != ''">
220 spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
221 </if>
222 <if test="brand != null and brand != ''">
223 brand = #{brand,jdbcType=VARCHAR},
224 </if>
225 <if test="coldFlag != null and coldFlag != ''">
226 cold_flag = #{coldFlag,jdbcType=VARCHAR},
227 </if>
228 <if test="supplierCode != null and supplierCode != ''">
229 supplier_code = #{supplierCode,jdbcType=VARCHAR},
230 </if>
231 <if test="supplierName != null and supplierName != ''">
232 supplier_name=#{supplierName,jdbcType=VARCHAR},
233 </if>
234 <if test="memo != null and memo != ''">
235 memo=#{memo,jdbcType=VARCHAR}
236 </if>
237 </set>
238 where med_code = #{medCode,jdbcType=BIGINT}
239 </update>
240
241
242 <!-- 查询HisCtMedicineMaterial详情 -->
243 <select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
244 select
245 <include refid="Base_Column_List"/>
246 from med_hli_medicine_material material
247 <where>
248 <if test="goodsCode!=null and goodsCode!=''">
249 And goods_code = #{goodsCode,jdbcType=VARCHAR}
250 </if>
251 </where>
252 </select>
253
254 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao">
4
5 <insert id="insert">
6 INSERT INTO med_interface_log(
7 id,
8 request_time,
9 request_method,
10 request_param
11 ) VALUES (
12 #{id},
13 #{requestTime},
14 #{requestMethod},
15 #{requestParam}
16 )
17 </insert>
18
19 <!-- 更新接口请求结果信息-->
20 <update id="update" parameterType="com.phxl.modules.goods.entity.interfaceLog.InterfaceLog">
21 update med_interface_log
22 <set>
23 <if test="resultCode != null and resultCode != ''">
24 result_code = #{resultCode,jdbcType=VARCHAR},
25 </if>
26 <if test="resultContent != null and resultContent != ''">
27 result_content = #{resultContent,jdbcType=VARCHAR},
28 </if>
29 <if test="exception != null and exception != ''">
30 exception = #{exception,jdbcType=VARCHAR}
31 </if>
32 </set>
33 where id = #{id,jdbcType=BIGINT}
34 </update>
35
36 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="producer_name" property="producerName" jdbcType="VARCHAR" />
15 <result column="regist_key" property="registKey" jdbcType="VARCHAR" />
16 <result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
17 <result column="unit" property="unit" jdbcType="VARCHAR" />
18 <result column="settle_price" property="settlePrice" jdbcType="DECIMAL" />
19 <result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
20 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
21 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
22 <result column="invoice_no" property="invoiceNo" jdbcType="VARCHAR" />
23 <result column="invoice_code" property="invoiceCode" jdbcType="VARCHAR" />
24 <result column="invoice_time" property="invoiceTime" jdbcType="DECIMAL" />
25 <result column="invoice_amount" property="invoiceAmount" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,settle_bill_no,row_no,goods_code,goods_name,goods_spec,producer_name,regist_key,settle_qty,unit,settle_price,settle_amount,create_time,update_time,invoice_no,invoice_code,invoice_time,invoice_amount</sql>
30
31 <!--批量插入MedPlanDetail -->
32 <insert id="batchInsert" parameterType="list">
33 insert into med_supplier_invoice_back_detail (id,settle_bill_no,row_no,goods_code,goods_name,goods_spec,producer_name,regist_key,settle_qty,unit,settle_price,settle_amount,create_time,update_time,invoice_no,invoice_code,invoice_time,invoice_amount)
34 values
35 <foreach collection ="list" item="obj" separator =",">
36 <trim prefix=" (" suffix=")" suffixOverrides=",">
37 #{obj.id},
38 #{obj.settleBillNo},
39 #{obj.rowNo},
40 #{obj.goodsCode},
41 #{obj.goodsName},
42 #{obj.goodsSpec},
43 #{obj.producerName},
44 #{obj.registKey},
45 #{obj.settleQty},
46 #{obj.unit},
47 #{obj.settlePrice},
48 #{obj.settleAmount},
49 #{obj.create_time},
50 #{obj.update_time},
51 #{obj.invoiceNo},
52 #{obj.invoiceCode},
53 #{obj.invoiceTime},
54 #{obj.invoiceAmount}
55 </trim>
56 </foreach>
57 </insert>
58
59
60 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
11 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
12 <result column="med_name" property="medName" jdbcType="VARCHAR" />
13 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
14 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
15 <result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
16 <result column="amount" property="amount" jdbcType="DECIMAL" />
17 <result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
18 <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
19 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
20 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
21 </resultMap>
22
23 <!--Base_Column_List -->
24 <sql id="Base_Column_List">id,settle_bill_no,settle_date,med_code,med_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,create_time,update_time</sql>
25
26 <!-- 新增invoiceback-->
27 <insert id="insert" parameterType="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
28 insert into med_supplier_invoice_back (id,settle_bill_no,settle_date,med_code,med_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,create_time,update_time)
29 values (
30 #{id,jdbcType=VARCHAR}
31 ,#{settleBillNo,jdbcType=VARCHAR}
32 ,#{settleDate,jdbcType=TIMESTAMP}
33 ,#{medCode,jdbcType=VARCHAR}
34 ,#{medName,jdbcType=VARCHAR}
35 ,#{supplierCode,jdbcType=VARCHAR}
36 ,#{supplierName,jdbcType=VARCHAR}
37 ,#{goodsSum,jdbcType=TINYINT}
38 ,#{amount,jdbcType=DECIMAL}
39 ,#{beginDate,jdbcType=TIMESTAMP}
40 ,#{endDate,jdbcType=TIMESTAMP}
41 ,#{create_time,jdbcType=TIMESTAMP}
42 ,#{update_time,jdbcType=TIMESTAMP}
43 )
44 </insert>
45
46 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medinstore.MedInStoreDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
12 <result column="supplier_do_no" property="supplierDoNo" jdbcType="VARCHAR" />
13 <result column="supplier_do_row_no" property="supplierDoRowNo" jdbcType="TINYINT" />
14 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
15 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
16 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
17 <result column="unit" property="unit" jdbcType="VARCHAR" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
20 <result column="amount" property="amount" jdbcType="DECIMAL" />
21 <result column="lot" property="lot" jdbcType="VARCHAR" />
22 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
23 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
24 <result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
25 <result column="mvqty" property="mvqty" jdbcType="DECIMAL" />
26 <result column="memo" property="memo" jdbcType="VARCHAR" />
27 </resultMap>
28
29 <!--Base_Column_List -->
30 <sql id="Base_Column_List">id,bill_no,row_no,med_plan_row_no,supplier_do_no,supplier_do_row_no,goods_code,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,arrivalqty,mvqty,memo</sql>
31
32 <!--批量插入MedInStoreDetail -->
33 <insert id="batchInsert" parameterType="list">
34 insert into med_hli_in_store_detail (id,bill_no,row_no,med_plan_row_no,supplier_do_no,supplier_do_row_no,goods_code,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,arrivalqty,mvqty,memo)
35 values
36 <foreach collection ="list" item="obj" separator =",">
37 <trim prefix=" (" suffix=")" suffixOverrides=",">
38 #{obj.id},
39 #{obj.billNo},
40 #{obj.rowNo},
41 #{obj.medPlanRowNo},
42 #{obj.supplierDoNo},
43 #{obj.supplierDoRowNo},
44 #{obj.goodsCode},
45 #{obj.goodsName},
46 #{obj.goodsSpec},
47 #{obj.unit},
48 #{obj.manufacturer},
49 #{obj.purchaserPrice},
50 #{obj.amount},
51 #{obj.lot},
52 #{obj.productionDate},
53 #{obj.expireDate},
54 #{obj.arrivalqty},
55 #{obj.mvqty},
56 #{obj.memo}
57 </trim>
58 </foreach>
59 </insert>
60
61
62 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medinstore.MedInStore">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
11 <result column="med_name" property="medName" jdbcType="VARCHAR" />
12 <result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
13 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
14 <result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
15 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
16 <result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
17 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
18 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
19 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
20 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
21 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
22 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
25 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
30
31 <!-- 新增MedInStore-->
32 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medinstore.MedInStore">
33 insert into med_hli_in_store (id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
34 values (
35 #{id,jdbcType=VARCHAR}
36 ,#{billNo,jdbcType=VARCHAR}
37 ,#{medGuid,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{medDeptGuid,jdbcType=VARCHAR}
40 ,#{medDeptName,jdbcType=VARCHAR}
41 ,#{medStoreGuid,jdbcType=VARCHAR}
42 ,#{medStoreName,jdbcType=VARCHAR}
43 ,#{supplierGuid,jdbcType=VARCHAR}
44 ,#{supplierName,jdbcType=VARCHAR}
45 ,#{billDate,jdbcType=TIMESTAMP}
46 ,#{countSum,jdbcType=TINYINT}
47 ,#{detailSum,jdbcType=DECIMAL}
48 ,#{operaterName,jdbcType=VARCHAR}
49 ,#{inputDate,jdbcType=TIMESTAMP}
50 ,#{memo,jdbcType=VARCHAR}
51 ,#{create_time,jdbcType=TIMESTAMP}
52 ,#{update_time,jdbcType=TIMESTAMP}
53 )
54 </insert>
55
56
57 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medplan.MedPlanDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
15 <result column="po_qty" property="poQty" jdbcType="DECIMAL" />
16 <result column="unit" property="unit" jdbcType="VARCHAR" />
17 <result column="taxprice" property="taxprice" jdbcType="DECIMAL" />
18 <result column="taxsum" property="taxsum" jdbcType="DECIMAL" />
19 </resultMap>
20
21 <!--Base_Column_List -->
22 <sql id="Base_Column_List">id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum</sql>
23
24 <!--批量插入MedPlanDetail -->
25 <insert id="batchInsert" parameterType="list">
26 insert into med_hli_plan_detail (id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum)
27 values
28 <foreach collection ="list" item="obj" separator =",">
29 <trim prefix=" (" suffix=")" suffixOverrides=",">
30 #{obj.id},
31 #{obj.billNo},
32 #{obj.rowNo},
33 #{obj.goodsCode},
34 #{obj.goodsName},
35 #{obj.goodsSpec},
36 #{obj.manufacturer},
37 #{obj.poQty},
38 #{obj.unit},
39 #{obj.taxprice},
40 #{obj.taxsum}
41 </trim>
42 </foreach>
43 </insert>
44
45
46 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medplan.MedPlan">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
10 <result column="med_name" property="medName" jdbcType="VARCHAR" />
11 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
12 <result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
13 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
14 <result column="bill_type" property="billType" jdbcType="VARCHAR" />
15 <result column="settle_type" property="settleType" jdbcType="VARCHAR" />
16 <result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
17 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
18 <result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
19 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
20 <result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
21 <result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
22 <result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
25 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
26 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
27 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
28 </resultMap>
29
30 <!--Base_Column_List -->
31 <sql id="Base_Column_List">id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time</sql>
32
33 <!--批量插入 -->
34 <insert id="batchInsert" parameterType="list">
35 insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
36 values
37 <foreach collection ="list" item="obj" separator =",">
38 <trim prefix=" (" suffix=")" suffixOverrides=",">
39 #{obj.id},
40 #{obj.medCode},
41 #{obj.medName},
42 #{obj.supplierCode},
43 #{obj.suppliername},
44 #{obj.billNo},
45 #{obj.billType},
46 #{obj.medDeptCode},
47 #{obj.medDeptName},
48 #{obj.medStoreCode},
49 #{obj.medStoreName},
50 #{obj.firstFlag},
51 #{obj.planBeginDate},
52 #{obj.planEndDate},
53 #{obj.memo},
54 #{obj.operaterName},
55 #{obj.inputDate},
56 #{obj.create_time},
57 #{obj.update_time}
58 </trim>
59 </foreach>
60 </insert>
61
62 <!-- 新增MedPlan-->
63 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
64 insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,settle_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
65 values (
66 #{id,jdbcType=VARCHAR}
67 ,#{medCode,jdbcType=VARCHAR}
68 ,#{medName,jdbcType=VARCHAR}
69 ,#{supplierCode,jdbcType=VARCHAR}
70 ,#{suppliername,jdbcType=VARCHAR}
71 ,#{billNo,jdbcType=VARCHAR}
72 ,#{billType,jdbcType=VARCHAR}
73 ,#{settleType,jdbcType=VARCHAR}
74 ,#{medDeptCode,jdbcType=VARCHAR}
75 ,#{medDeptName,jdbcType=VARCHAR}
76 ,#{medStoreCode,jdbcType=VARCHAR}
77 ,#{medStoreName,jdbcType=VARCHAR}
78 ,#{firstFlag,jdbcType=VARCHAR}
79 ,#{planBeginDate,jdbcType=TIMESTAMP}
80 ,#{planEndDate,jdbcType=TIMESTAMP}
81 ,#{memo,jdbcType=VARCHAR}
82 ,#{operaterName,jdbcType=VARCHAR}
83 ,#{inputDate,jdbcType=TIMESTAMP}
84 ,#{create_time,jdbcType=TIMESTAMP}
85 ,#{update_time,jdbcType=TIMESTAMP}
86 )
87 </insert>
88
89 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medstock.MedStockDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medstock.MedStock">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
10 <result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
11 <result column="store_code" property="storeCode" jdbcType="VARCHAR" />
12 <result column="store_name" property="storeName" jdbcType="VARCHAR" />
13 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
14 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
15 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
16 <result column="lot" property="lot" jdbcType="VARCHAR" />
17 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
18 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
19 <result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
20 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
21 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
22 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
23 <result column="med_name" property="medName" jdbcType="VARCHAR" />
24
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name</sql>
29
30 <!--批量插入 -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_stock (id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.medSuppliercode},
38 #{obj.medSuppliername},
39 #{obj.storeCode},
40 #{obj.storeName},
41 #{obj.goodsCode},
42 #{obj.goodsSpec},
43 #{obj.goodsName},
44 #{obj.lot},
45 #{obj.productionDate},
46 #{obj.expireDate},
47 #{obj.stockQty},
48 #{obj.createTime},
49 #{obj.updateTime},
50 #{obj.medCode},
51 #{obj.medName},
52 </trim>
53 </foreach>
54 </insert>
55 <!-- 新增HisSpills-->
56 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medstock.MedStock">
57 insert into med_stock (id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name)
58 values (
59 #{id,jdbcType=VARCHAR}
60 ,#{medSuppliercode,jdbcType=VARCHAR}
61 ,#{medSuppliername,jdbcType=VARCHAR}
62 ,#{storeCode,jdbcType=VARCHAR}
63 ,#{storeName,jdbcType=VARCHAR}
64 ,#{goodsCode,jdbcType=TIMESTAMP}
65 ,#{goodsSpec,jdbcType=VARCHAR}
66 ,#{goodsName,jdbcType=VARCHAR}
67 ,#{lot,jdbcType=VARCHAR}
68 ,#{productionDate,jdbcType=VARCHAR}
69 ,#{expireDate,jdbcType=DECIMAL}
70 ,#{stockQty,jdbcType=DECIMAL}
71 ,#{createTime,jdbcType=DECIMAL}
72 ,#{updateTime,jdbcType=TIMESTAMP}
73 ,#{medCode,jdbcType=VARCHAR}
74 ,#{medName,jdbcType=VARCHAR}
75 )
76 </insert>
77
78 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.spills.HisSpillsDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.spills.HisSpills">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
10 <result column="med_name" property="medName" jdbcType="VARCHAR" />
11 <result column="depot_code" property="depotCode" jdbcType="VARCHAR" />
12 <result column="depot_name" property="depotName" jdbcType="VARCHAR" />
13 <result column="tack_stockdate" property="tackStockDate" jdbcType="TIMESTAMP" />
14 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
15 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
16 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
17 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="lot" property="lot" jdbcType="VARCHAR" />
20 <result column="unit" property="unit" jdbcType="VARCHAR" />
21 <result column="number" property="number" jdbcType="DECIMAL" />
22 <result column="storck_num" property="storckNum" jdbcType="DECIMAL" />
23 <result column="difference_num" property="differenceNum" jdbcType="DECIMAL" />
24 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
25 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
26 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
27 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
28 <result column="tackstock_billno" property="tackStockBillNo" jdbcType="VARCHAR" />
29 <result column="price" property="price" jdbcType="DECIMAL" />
30
31 </resultMap>
32
33 <!--Base_Column_List -->
34 <sql id="Base_Column_List">id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price</sql>
35
36 <!--批量插入 -->
37 <insert id="batchInsert" parameterType="list">
38 insert into med_hli_spills (id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price)
39 values
40 <foreach collection ="list" item="obj" separator =",">
41 <trim prefix=" (" suffix=")" suffixOverrides=",">
42 #{obj.id},
43 #{obj.medCode},
44 #{obj.medName},
45 #{obj.depotCode},
46 #{obj.depotName},
47 #{obj.tackStockDate},
48 #{obj.operaterName},
49 #{obj.goodsCode},
50 #{obj.goodsName},
51 #{obj.goodsSpec},
52 #{obj.manufacturer},
53 #{obj.lot},
54 #{obj.unit},
55 #{obj.number},
56 #{obj.storckNum},
57 #{obj.differenceNum},
58 #{obj.productionDate},
59 #{obj.expireDate},
60 #{obj.supplierCode},
61 #{obj.supplierName},
62 #{obj.tackStockBillNo},
63 #{obj.price}
64 </trim>
65 </foreach>
66 </insert>
67
68 <!-- 新增HisSpills-->
69 <insert id="insert" parameterType="com.phxl.modules.goods.entity.spills.HisSpills">
70 insert into med_hli_spills (id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price)
71 values (
72 #{id,jdbcType=VARCHAR}
73 ,#{medCode,jdbcType=VARCHAR}
74 ,#{medName,jdbcType=VARCHAR}
75 ,#{depotCode,jdbcType=VARCHAR}
76 ,#{depotName,jdbcType=VARCHAR}
77 ,#{tackStockDate,jdbcType=TIMESTAMP}
78 ,#{operaterName,jdbcType=VARCHAR}
79 ,#{goodsCode,jdbcType=VARCHAR}
80 ,#{goodsName,jdbcType=VARCHAR}
81 ,#{goodsSpec,jdbcType=VARCHAR}
82 ,#{manufacturer,jdbcType=VARCHAR}
83 ,#{lot,jdbcType=VARCHAR}
84 ,#{unit,jdbcType=VARCHAR}
85 ,#{number,jdbcType=DECIMAL}
86 ,#{storckNum,jdbcType=DECIMAL}
87 ,#{differenceNum,jdbcType=DECIMAL}
88 ,#{productionDate,jdbcType=TIMESTAMP}
89 ,#{expireDate,jdbcType=TIMESTAMP}
90 ,#{supplierCode,jdbcType=VARCHAR}
91 ,#{supplierName,jdbcType=VARCHAR}
92 ,#{tackStockBillNo,jdbcType=VARCHAR}
93 ,#{price,jdbcType=DECIMAL}
94 )
95 </insert>
96
97 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="med_plan_no" property="medPlanNo" jdbcType="VARCHAR" />
12 <result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
13 <result column="goods_guid" property="goodsGuid" jdbcType="VARCHAR" />
14 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
15 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
16 <result column="unit" property="unit" jdbcType="VARCHAR" />
17 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
18 <result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
19 <result column="amount" property="amount" jdbcType="DECIMAL" />
20 <result column="lot" property="lot" jdbcType="VARCHAR" />
21 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
22 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
23 <result column="poqty" property="poqty" jdbcType="DECIMAL" />
24 <result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
25 <result column="memo" property="memo" jdbcType="VARCHAR" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,row_no,med_plan_no,med_plan_row_no,goods_guid,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,poqty,arrivalqty,memo</sql>
30
31 <!--批量插入MedPlanDetail -->
32 <insert id="batchInsert" parameterType="list">
33 insert into med_supplier_out_store_detail (id,bill_no,row_no,med_plan_no,med_plan_row_no,goods_guid,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,poqty,arrivalqty,memo)
34 values
35 <foreach collection ="list" item="obj" separator =",">
36 <trim prefix=" (" suffix=")" suffixOverrides=",">
37 #{obj.id},
38 #{obj.billNo},
39 #{obj.rowNo},
40 #{obj.medPlanNo},
41 #{obj.medPlanRowNo},
42 #{obj.goodsGuid},
43 #{obj.goodsName},
44 #{obj.goodsSpec},
45 #{obj.unit},
46 #{obj.manufacturer},
47 #{obj.purchaserPrice},
48 #{obj.amount},
49 #{obj.lot},
50 #{obj.productionDate},
51 #{obj.expireDate},
52 #{obj.poqty},
53 #{obj.arrivalqty},
54 #{obj.memo}
55 </trim>
56 </foreach>
57 </insert>
58
59
60 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
11 <result column="med_name" property="medName" jdbcType="VARCHAR" />
12 <result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
13 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
14 <result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
15 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
16 <result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
17 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
18 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
19 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
20 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
21 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
22 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
25 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
30
31 <!-- 新增MedPlan-->
32 <insert id="insert" parameterType="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
33 insert into med_supplier_out_store (id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
34 values (
35 #{id,jdbcType=VARCHAR}
36 ,#{billNo,jdbcType=VARCHAR}
37 ,#{medGuid,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{medDeptGuid,jdbcType=VARCHAR}
40 ,#{medDeptName,jdbcType=VARCHAR}
41 ,#{medStoreGuid,jdbcType=VARCHAR}
42 ,#{medStoreName,jdbcType=VARCHAR}
43 ,#{supplierGuid,jdbcType=VARCHAR}
44 ,#{supplierName,jdbcType=VARCHAR}
45 ,#{billDate,jdbcType=TIMESTAMP}
46 ,#{countSum,jdbcType=TINYINT}
47 ,#{detailSum,jdbcType=DECIMAL}
48 ,#{operaterName,jdbcType=VARCHAR}
49 ,#{inputDate,jdbcType=TIMESTAMP}
50 ,#{memo,jdbcType=VARCHAR}
51 ,#{createTime,jdbcType=TIMESTAMP}
52 ,#{updateTime,jdbcType=TIMESTAMP}
53 )
54 </insert>
55
56 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.supplierstock.SupplierStockDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="supplier_code" property="suppliercode" jdbcType="VARCHAR" />
10 <result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
15 <result column="lot" property="lot" jdbcType="VARCHAR" />
16 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
17 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
18 <result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
19 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
20 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
21 </resultMap>
22
23 <!--Base_Column_List -->
24 <sql id="Base_Column_List">id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time</sql>
25
26
27 <!--批量插入 -->
28 <insert id="batchInsert" parameterType="list">
29 insert into med_supplier_stock (id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time)
30 values
31 <foreach collection ="list" item="obj" separator =",">
32 <trim prefix=" (" suffix=")" suffixOverrides=",">
33 #{obj.id},
34 #{obj.suppliercode},
35 #{obj.suppliername},
36 #{obj.goodsCode},
37 #{obj.goodsName},
38 #{obj.goodsSpec},
39 #{obj.manufacturer},
40 #{obj.lot},
41 #{obj.productionDate},
42 #{obj.expireDate},
43 #{obj.stockQty},
44 #{obj.createTime},
45 #{obj.updateTime}
46 </trim>
47 </foreach>
48 </insert>
49 <!-- 新增SupplierStock-->
50 <insert id="insert" parameterType="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
51 insert into med_supplier_stock (id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time)
52 values (
53 #{id,jdbcType=VARCHAR}
54 ,#{suppliercode,jdbcType=VARCHAR}
55 ,#{suppliername,jdbcType=VARCHAR}
56 ,#{goodsCode,jdbcType=VARCHAR}
57 ,#{goodsName,jdbcType=VARCHAR}
58 ,#{goodsSpec,jdbcType=TIMESTAMP}
59 ,#{manufacturer,jdbcType=VARCHAR}
60 ,#{lot,jdbcType=VARCHAR}
61 ,#{productionDate,jdbcType=TIMESTAMP}
62 ,#{expireDate,jdbcType=TIMESTAMP}
63 ,#{stockQty,jdbcType=DECIMAL}
64 ,#{createTime,jdbcType=TIMESTAMP}
65 ,#{updateTime,jdbcType=TIMESTAMP}
66 )
67 </insert>
68
69 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
10 <result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="producer" property="producer" jdbcType="VARCHAR" />
14 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
15 <result column="unit_style" property="unitStyle" jdbcType="VARCHAR" />
16 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
17 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
18 <result column="price" property="price" jdbcType="DECIMAL" />
19 </resultMap>
20
21 <!--Base_Column_List -->
22 <sql id="Base_Column_List">id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price</sql>
23
24 <!--批量插入 -->
25 <insert id="batchInsert" parameterType="list">
26 insert into med_supply_catalog (id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price)
27 values
28 <foreach collection ="list" item="obj" separator =",">
29 <trim prefix=" (" suffix=")" suffixOverrides=",">
30 #{obj.id},
31 #{obj.medSuppliercode},
32 #{obj.medSuppliername},
33 #{obj.goodsCode},
34 #{obj.goodsName},
35 #{obj.producer},
36 #{obj.goodsSpec},
37 #{obj.unitStyle},
38 #{obj.createTime},
39 #{obj.updateTime},
40 #{obj.price}
41 </trim>
42 </foreach>
43 </insert>
44
45 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
3 <configuration>
4
5
6 </configuration>
1 <beans xmlns="http://www.springframework.org/schema/beans"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
3 xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context"
4 xmlns:aop="http://www.springframework.org/schema/aop"
5 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
6 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
7 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
8 <!-- 定时器开关 -->
9 <task:annotation-driven />
10 <bean id="weChat" class="com.phxl.modules.wechat.utils.WeChatUtils"></bean>
11 <task:scheduled-tasks>
12 <!--
13 每隔5秒执行一次:*/5 * * * * ?
14 每隔1分钟执行一次:0 */1 * * * ?
15 每天23点执行一次:0 0 23 * * ?
16 每天凌晨1点执行一次:0 0 1 * * ?
17 每天凌晨2点执行一次:0 0 2 * * ?
18 -->
19 <task:scheduled ref="weChat" method="getAccessToken" cron="0 */118 * * * ?" />
20 </task:scheduled-tasks>
21 <context:component-scan base-package="com.phxl.modules" />
22
23
24
25
26
27 </beans>
28
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
4 xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
5 xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
6 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
7 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
8 http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
9 http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
10 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
11 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
12 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
13 default-lazy-init="true">
14 <!-- 启用注解 -->
15 <context:component-scan base-package="com.phxl.modules" />
16
17 <!-- 引入属性文件 -->
18 <context:property-placeholder location="classpath:config.properties"/>
19
20
21 <!-- 配置数据源 -->
22 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
23 <property name="driverClassName" value="${jdbc.driver}" />
24 <property name="url" value="${jdbc.url}" />
25 <property name="username" value="${jdbc.username}"/>
26 <property name="password" value="${jdbc.password}"/>
27 </bean>
28
29 <!-- 配置sqlsessionFactory -->
30 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
31 <property name="dataSource" ref="dataSource"/>
32 <property name="configLocation" value="classpath:mybatis-config.xml"/>
33 <property name="mapperLocations">
34 <list>
35 <value>classpath:/mappings/**/*.xml</value>
36 </list>
37 </property>
38 </bean>
39
40 <!-- 扫描Mapper -->
41 <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
42 <property name="basePackage" value="com.phxl.modules"/>
43 </bean>
44
45 <!-- 配置事务管理器 -->
46 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
47 <property name="dataSource" ref="dataSource"/>
48 </bean>
49
50 <!-- 缓存配置 -->
51 <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
52 <property name="cacheManagerConfigFile" value="classpath:${ehcache.configFile}" />
53 </bean>
54
55 <!-- 启用注解事务 -->
56 <tx:annotation-driven/>
57
58 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:util="http://www.springframework.org/schema/util"
6 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
7 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
8 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
9
10 <context:annotation-config />
11
12
13
14 <context:component-scan base-package="com.phxl.modules.goods.web.spd">
15 <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
16 </context:component-scan>
17
18 <util:properties id="config" location="classpath:config.properties"/>
19
20 </beans>
1 ALTER TABLE med_hli_plan ADD COLUMN settle_type VARCHAR(10) COMMENT '0:零库存 1:非零库存' AFTER bill_type;
...\ No newline at end of file ...\ No newline at end of file
1 ALTER TABLE med_bill_settlement ADD COLUMN use_bill_no LONGTEXT COMMENT '发药单号';
2 ALTER TABLE med_bill_settlement_detail DROP use_bill_no;
...\ No newline at end of file ...\ No newline at end of file
1 Manifest-Version: 1.0
2 Built-By: ASUS
3 Build-Jdk: 1.8.0_141
4 Created-By: Maven Integration for Eclipse
5 Main-Class: Runner
6
1 #Generated by Maven Integration for Eclipse
2 #Thu Oct 10 09:03:23 CST 2019
3 version=1.0
4 groupId=com.phxl
5 m2e.projectName=medicinal-supplier
6 m2e.projectLocation=D\:\\csbr_fanming_xlc\\SPD\u524D\u7F6E\u673A\\medicinal-supplier
7 artifactId=medicinal-supplier
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3 <modelVersion>4.0.0</modelVersion>
4 <groupId>com.phxl</groupId>
5 <artifactId>medicinal-supplier</artifactId>
6 <packaging>war</packaging>
7 <version>1.0</version>
8 <name>medicinal-supplier</name>
9 <url>http://maven.apache.org</url>
10
11 <!-- 属性配置 -->
12 <properties>
13 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14 <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
15 <junit.version>4.8.1</junit.version>
16 <javax.servlet.version>1.2</javax.servlet.version>
17 <javax.servlet.api.version>2.5</javax.servlet.api.version>
18 <spring.version>4.1.1.RELEASE</spring.version>
19 <ehcache.version>2.6.11</ehcache.version>
20 <ehcache-web.version>2.0.4</ehcache-web.version>
21 <shiro.version>1.2.3</shiro.version>
22
23 <org.apache.commons.version>3.3.2</org.apache.commons.version>
24 <org.apache.xmlbeans.version>2.6.0</org.apache.xmlbeans.version>
25 <org.apache.poi.version>3.9</org.apache.poi.version>
26 <org.apache.poi.openxml4j.version>1.0-beta</org.apache.poi.openxml4j.version>
27
28 <com.fasterxml.jackson.version>2.8.4</com.fasterxml.jackson.version>
29 <com.itextpdf.version>5.5.7</com.itextpdf.version>
30 <com.itextpdf.itext-asian.version>5.2.0</com.itextpdf.itext-asian.version>
31 <com.aliyun.oss.version>2.2.3</com.aliyun.oss.version>
32 <com.google.gson.version>2.2.2</com.google.gson.version>
33 <com.google.zxing.version>3.2.1</com.google.zxing.version>
34 <com.thoughtworks.xstream.version>1.4.10</com.thoughtworks.xstream.version>
35 <commons-fileupload.version>1.3.1</commons-fileupload.version>
36 <dom4j.version>1.6.1</dom4j.version>
37 <qrcode.version>1.4</qrcode.version>
38 <eu.medsea.mimeutil.version>2.1.3</eu.medsea.mimeutil.version>
39 <mysql.driver.version>5.1.30</mysql.driver.version>
40 <mybatis.version>3.2.8</mybatis.version>
41 <mybatis-spring.version>1.2.3</mybatis-spring.version>
42 <cxf.version>2.2.3</cxf.version>
43
44 <!-- environment setting -->
45 <jdk.version>1.8</jdk.version>
46 <tomcat.version>2.2</tomcat.version>
47 <webserver.port>8888</webserver.port>
48 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49 <downloadSources>true</downloadSources>
50
51 <slf4j.version>1.7.7</slf4j.version>
52 <!-- logback setting -->
53 <ch.qos.logback.version>1.1.7</ch.qos.logback.version>
54 <org.slf4j.version>1.7.7</org.slf4j.version>
55 </properties>
56
57 <!-- 配置环境 -->
58 <profiles>
59 <profile>
60 <id>prod</id>
61 <!-- <activation>
62 <activeByDefault>true</activeByDefault>
63 </activation> -->
64 <properties>
65 <package.environment>prod</package.environment>
66 </properties>
67 </profile>
68 <profile>
69 <id>stg</id>
70 <properties>
71 <package.environment>stg</package.environment>
72 </properties>
73 </profile>
74 <profile>
75 <id>test</id>
76 <properties>
77 <package.environment>test</package.environment>
78 </properties>
79 </profile>
80 </profiles>
81
82 <dependencies>
83 <dependency>
84 <groupId>junit</groupId>
85 <artifactId>junit</artifactId>
86 <version>${junit.version}</version>
87 <scope>test</scope>
88 </dependency>
89
90 <!-- jackson -->
91 <dependency>
92 <groupId>com.fasterxml.jackson.core</groupId>
93 <artifactId>jackson-core</artifactId>
94 <version>${com.fasterxml.jackson.version}</version>
95 </dependency>
96 <dependency>
97 <groupId>com.fasterxml.jackson.core</groupId>
98 <artifactId>jackson-databind</artifactId>
99 <version>${com.fasterxml.jackson.version}</version>
100 </dependency>
101
102 <!-- spring -->
103 <dependency>
104 <groupId>org.springframework</groupId>
105 <artifactId>spring-aop</artifactId>
106 <version>${spring.version}</version>
107 <type>jar</type>
108 <scope>compile</scope>
109 </dependency>
110 <dependency>
111 <groupId>org.springframework</groupId>
112 <artifactId>spring-aspects</artifactId>
113 <version>${spring.version}</version>
114 <type>jar</type>
115 <scope>compile</scope>
116 </dependency>
117 <dependency>
118 <groupId>org.springframework</groupId>
119 <artifactId>spring-beans</artifactId>
120 <version>${spring.version}</version>
121 <type>jar</type>
122 <scope>compile</scope>
123 </dependency>
124 <dependency>
125 <groupId>org.springframework</groupId>
126 <artifactId>spring-context</artifactId>
127 <version>${spring.version}</version>
128 <type>jar</type>
129 <scope>compile</scope>
130 </dependency>
131 <dependency>
132 <groupId>org.springframework</groupId>
133 <artifactId>spring-context-support</artifactId>
134 <version>${spring.version}</version>
135 <type>jar</type>
136 <scope>compile</scope>
137 </dependency>
138 <dependency>
139 <groupId>org.springframework</groupId>
140 <artifactId>spring-core</artifactId>
141 <version>${spring.version}</version>
142 <type>jar</type>
143 <scope>compile</scope>
144 </dependency>
145 <dependency>
146 <groupId>org.springframework</groupId>
147 <artifactId>spring-expression</artifactId>
148 <version>${spring.version}</version>
149 <type>jar</type>
150 <scope>compile</scope>
151 </dependency>
152 <dependency>
153 <groupId>org.springframework</groupId>
154 <artifactId>spring-jdbc</artifactId>
155 <version>${spring.version}</version>
156 <type>jar</type>
157 <scope>compile</scope>
158 </dependency>
159 <dependency>
160 <groupId>org.springframework</groupId>
161 <artifactId>spring-jms</artifactId>
162 <version>${spring.version}</version>
163 <type>jar</type>
164 <scope>compile</scope>
165 </dependency>
166 <dependency>
167 <groupId>org.springframework</groupId>
168 <artifactId>spring-orm</artifactId>
169 <version>${spring.version}</version>
170 <type>jar</type>
171 <scope>compile</scope>
172 </dependency>
173 <dependency>
174 <groupId>org.springframework</groupId>
175 <artifactId>spring-oxm</artifactId>
176 <version>${spring.version}</version>
177 <type>jar</type>
178 <scope>compile</scope>
179 </dependency>
180 <dependency>
181 <groupId>org.springframework</groupId>
182 <artifactId>spring-tx</artifactId>
183 <version>${spring.version}</version>
184 <type>jar</type>
185 <scope>compile</scope>
186 </dependency>
187 <dependency>
188 <groupId>org.springframework</groupId>
189 <artifactId>spring-web</artifactId>
190 <version>${spring.version}</version>
191 <type>jar</type>
192 <scope>compile</scope>
193 </dependency>
194 <dependency>
195 <groupId>org.springframework</groupId>
196 <artifactId>spring-webmvc</artifactId>
197 <version>${spring.version}</version>
198 <type>jar</type>
199 <scope>compile</scope>
200 </dependency>
201 <dependency>
202 <groupId>org.springframework</groupId>
203 <artifactId>spring-test</artifactId>
204 <version>${spring.version}</version>
205 <type>jar</type>
206 <scope>compile</scope>
207 </dependency>
208
209 <dependency>
210 <groupId>javax.servlet</groupId>
211 <artifactId>jstl</artifactId>
212 <version>${javax.servlet.version}</version>
213 <type>jar</type>
214 <scope>compile</scope>
215 </dependency>
216
217 <dependency>
218 <groupId>com.aliyun.oss</groupId>
219 <artifactId>aliyun-sdk-oss</artifactId>
220 <version>${com.aliyun.oss.version}</version>
221 </dependency>
222
223 <dependency>
224 <groupId>javax.servlet</groupId>
225 <artifactId>servlet-api</artifactId>
226 <version>${javax.servlet.api.version}</version>
227 <scope>provided</scope>
228 </dependency>
229
230 <dependency>
231 <groupId>commons-fileupload</groupId>
232 <artifactId>commons-fileupload</artifactId>
233 <version>${commons-fileupload.version}</version>
234 </dependency>
235
236 <dependency>
237 <groupId>com.alibaba</groupId>
238 <artifactId>fastjson</artifactId>
239 <version>1.2.33</version>
240 </dependency>
241
242 <dependency>
243 <groupId>org.apache.commons</groupId>
244 <artifactId>commons-lang3</artifactId>
245 <version>${org.apache.commons.version}</version>
246 </dependency>
247
248 <dependency>
249 <groupId>eu.medsea.mimeutil</groupId>
250 <artifactId>mime-util</artifactId>
251 <version>${eu.medsea.mimeutil.version}</version>
252 </dependency>
253 <dependency>
254 <groupId>com.google.code.gson</groupId>
255 <artifactId>gson</artifactId>
256 <version>${com.google.gson.version}</version>
257 </dependency>
258
259
260 <!-- <dependency>
261 <groupId>javabuilder</groupId>
262 <artifactId>javabuilder_rt</artifactId>
263 <version>2.0</version>
264 <scope>system</scope>
265 <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/rt.jar</systemPath>
266 </dependency>
267
268
269 <dependency>
270 <groupId>javabuilder</groupId>
271 <artifactId>javabuilder11_jce</artifactId>
272 <version>0.0.1-SNAPSHOT</version>
273 <scope>system</scope>
274 <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jce.jar</systemPath>
275 </dependency> -->
276
277 <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
278 <dependency>
279 <groupId>com.thoughtworks.xstream</groupId>
280 <artifactId>xstream</artifactId>
281 <version>${com.thoughtworks.xstream.version}</version>
282 </dependency>
283
284 <!-- LOGGING begin -->
285 <dependency>
286 <groupId>org.slf4j</groupId>
287 <artifactId>slf4j-api</artifactId>
288 <version>${slf4j.version}</version>
289 </dependency>
290 <dependency>
291 <groupId>org.slf4j</groupId>
292 <artifactId>slf4j-log4j12</artifactId>
293 <version>${slf4j.version}</version>
294 </dependency>
295
296 <!-- logback -->
297 <dependency>
298 <groupId>org.slf4j</groupId>
299 <artifactId>slf4j-api</artifactId>
300 <version>${org.slf4j.version}</version>
301 </dependency>
302
303 <dependency>
304 <groupId>ch.qos.logback</groupId>
305 <artifactId>logback-core</artifactId>
306 <version>${ch.qos.logback.version}</version>
307 </dependency>
308 <dependency>
309 <groupId>ch.qos.logback</groupId>
310 <artifactId>logback-access</artifactId>
311 <version>${ch.qos.logback.version}</version>
312 </dependency>
313 <dependency>
314 <groupId>ch.qos.logback</groupId>
315 <artifactId>logback-classic</artifactId>
316 <version>${ch.qos.logback.version}</version>
317 </dependency>
318
319 <!-- Apache POI: start -->
320 <dependency>
321 <groupId>org.apache.poi</groupId>
322 <artifactId>poi</artifactId>
323 <version>${org.apache.poi.version}</version>
324 </dependency>
325
326 <dependency>
327 <groupId>org.apache.poi</groupId>
328 <artifactId>poi-ooxml</artifactId>
329 <version>${org.apache.poi.version}</version>
330 </dependency>
331 <dependency>
332 <groupId>org.apache.poi</groupId>
333 <artifactId>poi-excelant</artifactId>
334 <version>${org.apache.poi.version}</version>
335 </dependency>
336 <dependency>
337 <groupId>org.apache.poi</groupId>
338 <artifactId>poi-examples</artifactId>
339 <version>${org.apache.poi.version}</version>
340 </dependency>
341 <dependency>
342 <groupId>org.apache.poi</groupId>
343 <artifactId>poi-scratchpad</artifactId>
344 <version>${org.apache.poi.version}</version>
345 </dependency>
346 <dependency>
347 <groupId>org.apache.xmlbeans</groupId>
348 <artifactId>xmlbeans</artifactId>
349 <version>${org.apache.xmlbeans.version}</version>
350 </dependency>
351 <dependency>
352 <groupId>org.apache.poi</groupId>
353 <artifactId>openxml4j</artifactId>
354 <version>${org.apache.poi.openxml4j.version}</version>
355 </dependency>
356
357
358 <!-- itextpdf -->
359 <dependency>
360 <groupId>com.itextpdf</groupId>
361 <artifactId>itextpdf</artifactId>
362 <version>${com.itextpdf.version}</version>
363 </dependency>
364 <dependency>
365 <groupId>com.itextpdf</groupId>
366 <artifactId>itext-asian</artifactId>
367 <version>${com.itextpdf.itext-asian.version}</version>
368 </dependency>
369 <!-- Zxing -->
370 <dependency>
371 <groupId>com.google.zxing</groupId>
372 <artifactId>javase</artifactId>
373 <version>${com.google.zxing.version}</version>
374 </dependency>
375 <dependency>
376 <groupId>dom4j</groupId>
377 <artifactId>dom4j</artifactId>
378 <version>${dom4j.version}</version>
379 </dependency>
380
381 <!-- QRCode -->
382 <dependency>
383 <groupId>net.glxn</groupId>
384 <artifactId>qrgen</artifactId>
385 <version>${qrcode.version}</version>
386 </dependency>
387
388 <dependency>
389 <groupId>mysql</groupId>
390 <artifactId>mysql-connector-java</artifactId>
391 <version>${mysql.driver.version}</version>
392 <scope>runtime</scope>
393 </dependency>
394
395 <!-- MyBatis -->
396 <dependency>
397 <groupId>org.mybatis</groupId>
398 <artifactId>mybatis</artifactId>
399 <version>${mybatis.version}</version>
400 </dependency>
401 <dependency>
402 <groupId>org.mybatis</groupId>
403 <artifactId>mybatis-spring</artifactId>
404 <version>${mybatis-spring.version}</version>
405 </dependency>
406
407 <dependency>
408 <groupId>org.apache.httpcomponents</groupId>
409 <artifactId>httpmime</artifactId>
410 <version>4.5.2</version>
411 </dependency>
412
413 <dependency>
414 <groupId>junit</groupId>
415 <artifactId>junit</artifactId>
416 <version>4.7</version>
417 </dependency>
418
419 <!-- CACHE begin -->
420 <dependency>
421 <groupId>net.sf.ehcache</groupId>
422 <artifactId>ehcache-core</artifactId>
423 <version>${ehcache.version}</version>
424 </dependency>
425 <dependency>
426 <groupId>net.sf.ehcache</groupId>
427 <artifactId>ehcache-web</artifactId>
428 <version>${ehcache-web.version}</version>
429 </dependency>
430 <dependency>
431 <groupId>org.apache.shiro</groupId>
432 <artifactId>shiro-ehcache</artifactId>
433 <version>${shiro.version}</version>
434 </dependency>
435
436 </dependencies>
437
438
439 <!--构建设置 -->
440 <build>
441 <finalName>${project.artifactId}</finalName>
442 <resources>
443 <resource>
444 <directory>src/main/resources</directory>
445 <filtering>true</filtering>
446 <includes>
447 <include>**/*.*</include>
448 </includes>
449 </resource>
450 <resource>
451 <directory>src/main/java</directory>
452 <includes>
453 <include>**/*.xml</include>
454 </includes>
455 <filtering>true</filtering>
456 </resource>
457 <resource>
458 <directory>conf/${package.environment}</directory>
459 <filtering>true</filtering>
460 <includes>
461 <include>*.*</include>
462 </includes>
463 </resource>
464 </resources>
465 <plugins>
466
467 <!-- insert jetty class(compiler) -->
468 <!-- 指定war包的执行入口-->
469 <plugin>
470 <groupId>org.apache.maven.plugins</groupId>
471 <artifactId>maven-war-plugin</artifactId>
472 <version>2.3</version>
473 <configuration>
474 <archive>
475 <manifest>
476 <mainClass>Runner</mainClass>
477 </manifest>
478 </archive>
479 </configuration>
480 </plugin>
481 <plugin>
482 <groupId>org.apache.maven.plugins</groupId>
483 <artifactId>maven-war-plugin</artifactId>
484 <configuration>
485 <failOnMissingWebXml>false</failOnMissingWebXml>
486 </configuration>
487 </plugin>
488 <!-- 将Runner移动到Meta-info下面-->
489 <plugin>
490 <groupId>org.apache.maven.plugins</groupId>
491 <artifactId>maven-antrun-plugin</artifactId>
492 <version>1.7</version>
493 <executions>
494 <execution>
495 <id>main-class-placement</id>
496 <phase>prepare-package</phase>
497 <configuration>
498 <target>
499 <move todir="${project.build.directory}/${project.artifactId}-${project.version}-${package.environment}/">
500 <fileset dir="${project.build.directory}/classes/">
501 <include name="Runner.class" />
502 </fileset>
503 </move>
504 </target>
505 </configuration>
506 <goals>
507 <goal>run</goal>
508 </goals>
509 </execution>
510 </executions>
511 </plugin>
512
513
514 <plugin>
515 <groupId>org.apache.maven.plugins</groupId>
516 <artifactId>maven-compiler-plugin</artifactId>
517 <configuration>
518 <source>1.6</source>
519 <target>1.6</target>
520 <encoding>UTF-8</encoding>
521 <compilerArguments>
522 <extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
523 </compilerArguments>
524 </configuration>
525 </plugin>
526
527 <!-- <plugin>
528 <artifactId>maven-compiler-plugin</artifactId>
529 <version>2.3.2</version>
530 <configuration>
531 <source>1.6</source>
532 <target>1.6</target>
533 <encoding>UTF-8</encoding>
534 <optimize>true</optimize>
535 <debug>true</debug>
536 <showDeprecation>true</showDeprecation>
537 <showWarnings>false</showWarnings>
538 <compilerArguments>
539 <verbose />
540 <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
541 </compilerArguments>
542 </configuration>
543 </plugin> -->
544
545 <!-- tomcat7插件 -->
546 <plugin>
547 <groupId>org.apache.tomcat.maven</groupId>
548 <artifactId>tomcat7-maven-plugin</artifactId>
549 <version>${tomcat.version}</version>
550 <configuration>
551 <port>${webserver.port}</port>
552 <path>/${project.artifactId}</path>
553 <uriEncoding>${project.build.sourceEncoding}</uriEncoding>
554 </configuration>
555 </plugin>
556 </plugins>
557 </build>
558 </project>
1 #Generated by Maven
2 #Tue Jul 09 17:29:34 CST 2019
3 version=1.0
4 groupId=com.phxl
5 artifactId=medicinal-supplier
1 com\phxl\modules\goods\service\supplierstock\SupplierStockService.class
2 com\phxl\modules\goods\entity\billsettlement\BillSettlementDetail.class
3 com\phxl\common\utils\Exceptions.class
4 com\phxl\modules\goods\entity\spills\HisSpillsList.class
5 com\phxl\common\util\JsonMapper.class
6 com\phxl\modules\goods\dao\medstock\MedStockDao.class
7 com\phxl\modules\wechat\entity\PushOrder.class
8 com\phxl\modules\goods\dao\ctcareprov\CTCareProvDao.class
9 com\phxl\common\util\PdfReportHeaderFooter.class
10 com\phxl\common\util\XMLUtil.class
11 com\phxl\common\utils\CacheUtils.class
12 com\phxl\modules\goods\dao\ctdept\HisCtDeptDao.class
13 com\phxl\modules\goods\entity\medinstore\MedInStore.class
14 com\phxl\modules\goods\service\medinstore\MedInStoreService.class
15 com\phxl\common\util\Tools.class
16 com\phxl\modules\goods\dao\supplierstock\SupplierStockDao.class
17 com\phxl\modules\goods\entity\billback\BillBackWithDetail.class
18 com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackWithDetail.class
19 com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackDetail.class
20 com\phxl\common\response\PlatFormResponseConstant.class
21 com\phxl\common\util\MD5Util.class
22 com\phxl\common\util\JsonMapper$2.class
23 com\phxl\modules\goods\service\medstock\MedStockService.class
24 com\phxl\modules\wechat\service\impl\WeChatServiceImpl.class
25 com\phxl\modules\goods\dao\billsettlement\BillSettlementDetailDao.class
26 com\phxl\modules\goods\service\suoutstore\SuOutStoreService.class
27 com\phxl\common\utils\Encodes.class
28 com\phxl\common\utils\PropertiesLoader.class
29 com\phxl\common\utils\SpringContextHolder.class
30 com\phxl\common\util\PropertiesLoader.class
31 com\phxl\modules\goods\entity\billback\BillBackDetail.class
32 com\phxl\modules\goods\service\supplygoods\MedSupplyGoodsService.class
33 com\phxl\modules\goods\dao\hisCtMedicineMaterial\HisCtMedicineMaterialDao.class
34 com\phxl\common\util\IdentifieUtil.class
35 com\phxl\modules\goods\dao\interfaceLog\InterfaceLogDao.class
36 com\phxl\modules\goods\entity\suoutstore\SuOutStore.class
37 com\phxl\modules\goods\service\hisCtMedicineMaterial\HisCtMedicineMaterialService.class
38 com\phxl\modules\goods\service\medplan\MedPlanService.class
39 com\phxl\modules\goods\entity\medplan\MedPlanWithDetail.class
40 com\phxl\common\constants\HisResponseConstant$ResponseHeaderMsg.class
41 com\phxl\common\util\SystemConfig.class
42 com\phxl\modules\goods\dao\billsettlement\BillSettlementDao.class
43 com\phxl\modules\goods\dao\suoutstore\SuOutStoreDetailDao.class
44 com\phxl\common\util\HttpUtils.class
45 com\phxl\modules\goods\dao\medinstore\MedInStoreDetailDao.class
46 com\phxl\modules\wechat\dto\WeChatDto.class
47 com\phxl\common\constants\HisRequestConstant.class
48 com\phxl\modules\goods\entity\billback\BillBack.class
49 com\phxl\modules\goods\entity\supplierstock\SupplierStockList.class
50 com\phxl\common\util\JsonToUtils.class
51 com\phxl\common\utils\IdUtil.class
52 com\phxl\modules\goods\entity\medplan\MedPlanDetail.class
53 com\phxl\modules\goods\entity\hisCtMedicineMaterial\HisCtMedicineMaterial.class
54 com\phxl\modules\goods\entity\ctdept\HisCtDept.class
55 com\phxl\modules\goods\dao\medplan\MedPlanDetailDao.class
56 com\phxl\common\util\Global.class
57 com\phxl\common\util\HTTPClient.class
58 com\phxl\modules\goods\entity\medinstore\MedInStoreDetail.class
59 com\phxl\modules\goods\entity\suoutstore\SuOutStoreWithDetail.class
60 com\phxl\common\constants\PlatformConstant.class
61 com\phxl\common\filter\SimpleCORSFilter.class
62 com\phxl\common\response\PlatFormResponseConstant$ResponseHeaderMsg.class
63 com\phxl\modules\goods\service\ctcareprov\CTCareProvService.class
64 com\phxl\common\util\ExportUtil.class
65 com\phxl\modules\wechat\constants\WeChatConstants.class
66 com\phxl\modules\goods\entity\billsettlement\BillSettlement.class
67 com\phxl\modules\goods\entity\medstock\MedStockList.class
68 com\phxl\common\constants\HisResponseConstant$ResponseBodyMsg.class
69 com\phxl\modules\goods\service\billsettlement\BillSettlementService.class
70 com\phxl\modules\wechat\utils\WeChatHttpClient.class
71 com\phxl\modules\wechat\service\WeChatService.class
72 com\phxl\modules\goods\service\billback\BillBackService.class
73 com\phxl\common\util\JsonUtils.class
74 com\phxl\modules\goods\dao\billback\BillBackDetailDao.class
75 com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDao.class
76 com\phxl\modules\goods\entity\medplan\MedPlanDto.class
77 com\phxl\modules\goods\entity\supplierstock\SupplierStock.class
78 com\phxl\modules\goods\entity\suoutstore\SuOutStoreDetail.class
79 com\phxl\modules\goods\entity\billsettlement\BillSettlementWithDetail.class
80 com\phxl\common\utils\BaseException.class
81 com\phxl\modules\wechat\utils\WeChatUtils.class
82 com\phxl\common\response\PlatFormResponseConstant$ResponseBodyMsg.class
83 com\phxl\common\util\DateUtils.class
84 com\phxl\modules\wechat\entity\RequestParams.class
85 com\phxl\modules\goods\service\spills\HisSpillsService.class
86 com\phxl\common\response\PlatFormResponse.class
87 com\phxl\modules\goods\entity\invoiceback\SuInvoiceBack.class
88 com\phxl\common\util\XMLClient.class
89 com\phxl\modules\goods\entity\spills\HisSpills.class
90 com\phxl\common\utils\CookieUtils.class
91 com\phxl\modules\wechat\controller\WeChatController.class
92 com\phxl\modules\goods\web\spd\HisProxyController.class
93 com\phxl\modules\goods\entity\medstock\MedStock.class
94 com\phxl\modules\goods\service\interfaceLog\InterfaceLogService.class
95 com\phxl\modules\goods\dao\billback\BillBackDao.class
96 com\phxl\common\util\VideoThumbTaker.class
97 com\phxl\common\util\JsonMapper$1.class
98 com\phxl\modules\goods\entity\medplan\MedPlan.class
99 com\phxl\modules\wechat\constants\WeChatEnum.class
100 com\phxl\common\utils\ReturnCode.class
101 com\phxl\modules\goods\dao\medinstore\MedInStoreDao.class
102 com\phxl\modules\goods\entity\interfaceLog\InterfaceLog.class
103 com\phxl\modules\goods\dao\supplygoods\MedSupplyGoodsDao.class
104 com\phxl\modules\goods\service\ctdept\HisCtDeptService.class
105 com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDetailDao.class
106 com\phxl\modules\goods\dao\spills\HisSpillsDao.class
107 com\phxl\modules\goods\entity\medinstore\MedInStoreWithDetail.class
108 com\phxl\modules\goods\dao\medplan\MedPlanDao.class
109 com\phxl\modules\goods\web\spd\SpdControlller.class
110 com\phxl\modules\goods\dao\suoutstore\SuOutStoreDao.class
111 com\phxl\common\constants\HisResponseConstant.class
112 com\phxl\modules\goods\service\invoiceback\SuInvoiceBackService.class
113 com\phxl\modules\goods\entity\ctcareprov\CTCareProv.class
114 com\phxl\modules\goods\entity\supplygoods\MedSupplyGoods.class
115 com\phxl\common\util\JaxbUtil.class
116 com\phxl\common\util\JsonDateDeserializer.class
1 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billback\BillBack.java
2 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonDateDeserializer.java
3 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\constants\WeChatEnum.java
4 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\spills\HisSpillsList.java
5 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billback\BillBackDetailDao.java
6 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medinstore\MedInStore.java
7 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\supplierstock\SupplierStock.java
8 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\suoutstore\SuOutStoreDao.java
9 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billback\BillBackDetail.java
10 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medinstore\MedInStoreWithDetail.java
11 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\VideoThumbTaker.java
12 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\ctdept\HisCtDeptDao.java
13 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\utils\WeChatUtils.java
14 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\Encodes.java
15 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medstock\MedStockList.java
16 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\suoutstore\SuOutStore.java
17 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\medplan\MedPlanService.java
18 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\supplierstock\SupplierStockDao.java
19 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\constants\WeChatConstants.java
20 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\IdUtil.java
21 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\PropertiesLoader.java
22 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\web\spd\SpdControlller.java
23 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\hisCtMedicineMaterial\HisCtMedicineMaterialService.java
24 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\ReturnCode.java
25 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\medstock\MedStockService.java
26 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlanDto.java
27 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackWithDetail.java
28 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\utils\WeChatHttpClient.java
29 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billsettlement\BillSettlement.java
30 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\Global.java
31 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\billsettlement\BillSettlementService.java
32 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\response\PlatFormResponse.java
33 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medinstore\MedInStoreDetail.java
34 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\spills\HisSpillsService.java
35 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JaxbUtil.java
36 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medplan\MedPlanDao.java
37 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\CacheUtils.java
38 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\hisCtMedicineMaterial\HisCtMedicineMaterialDao.java
39 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\invoiceback\SuInvoiceBackService.java
40 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\dto\WeChatDto.java
41 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\suoutstore\SuOutStoreService.java
42 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billsettlement\BillSettlementDetail.java
43 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\constants\HisRequestConstant.java
44 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\Tools.java
45 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\PdfReportHeaderFooter.java
46 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\spills\HisSpillsDao.java
47 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\IdentifieUtil.java
48 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\ctcareprov\CTCareProvService.java
49 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonUtils.java
50 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\HTTPClient.java
51 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\ctcareprov\CTCareProv.java
52 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\service\impl\WeChatServiceImpl.java
53 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDetailDao.java
54 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\constants\HisResponseConstant.java
55 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\HttpUtils.java
56 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\CookieUtils.java
57 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\interfaceLog\InterfaceLog.java
58 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\medinstore\MedInStoreService.java
59 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\interfaceLog\InterfaceLogDao.java
60 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billsettlement\BillSettlementWithDetail.java
61 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\Exceptions.java
62 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\interfaceLog\InterfaceLogService.java
63 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonMapper.java
64 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\BaseException.java
65 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\web\spd\HisProxyController.java
66 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\ctdept\HisCtDeptService.java
67 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\SpringContextHolder.java
68 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\supplygoods\MedSupplyGoodsDao.java
69 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\response\PlatFormResponseConstant.java
70 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\ctcareprov\CTCareProvDao.java
71 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\suoutstore\SuOutStoreDetailDao.java
72 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\spills\HisSpills.java
73 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\filter\SimpleCORSFilter.java
74 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medstock\MedStockDao.java
75 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\supplygoods\MedSupplyGoods.java
76 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\PropertiesLoader.java
77 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\service\WeChatService.java
78 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\controller\WeChatController.java
79 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\billback\BillBackService.java
80 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\supplygoods\MedSupplyGoodsService.java
81 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billsettlement\BillSettlementDao.java
82 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\ctdept\HisCtDept.java
83 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\DateUtils.java
84 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonToUtils.java
85 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\entity\PushOrder.java
86 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billsettlement\BillSettlementDetailDao.java
87 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\SystemConfig.java
88 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medinstore\MedInStoreDao.java
89 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\ExportUtil.java
90 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medstock\MedStock.java
91 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDao.java
92 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\suoutstore\SuOutStoreDetail.java
93 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\entity\RequestParams.java
94 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\suoutstore\SuOutStoreWithDetail.java
95 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billback\BillBackWithDetail.java
96 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\supplierstock\SupplierStockList.java
97 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\hisCtMedicineMaterial\HisCtMedicineMaterial.java
98 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackDetail.java
99 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\XMLUtil.java
100 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\XMLClient.java
101 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\constants\PlatformConstant.java
102 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medinstore\MedInStoreDetailDao.java
103 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlanWithDetail.java
104 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlanDetail.java
105 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlan.java
106 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\invoiceback\SuInvoiceBack.java
107 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\supplierstock\SupplierStockService.java
108 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billback\BillBackDao.java
109 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medplan\MedPlanDetailDao.java
110 D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\MD5Util.java
1 Manifest-Version: 1.0
2 Built-By: 何
3 Created-By: IntelliJ IDEA
4 Build-Jdk: 1.8
5 Main-Class: Runner
6
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ehcache updateCheck="false" name="defaultCache">
3
4 <diskStore path="../temp/medicinal/ehcache" />
5
6 <!-- 默认缓存配置. 自动失效:最后一次访问时间间隔300秒失效,若没有访问过自创建时间600秒失效。-->
7 <defaultCache maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
8 overflowToDisk="true" statistics="true"/>
9
10 <!-- 系统缓存 -->
11 <cache name="sysCache" maxEntriesLocalHeap="1000" eternal="true" overflowToDisk="true" statistics="true"/>
12
13 </ehcache>
...\ No newline at end of file ...\ No newline at end of file
1
2 jdbc.type=mysql
3 jdbc.driver=com.mysql.jdbc.Driver
4 jdbc.url=jdbc:mysql://10.146.9.50:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
5 jdbc.username=root
6 jdbc.password=BOE190326jdfyy
7
8 spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
9
10 huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
11
12 #spd服务地址
13 spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
14 spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
15 spd_wechat_logout=http://10.146.9.50:8080/medicinal-web/a/logout
16
17 appid=wx9657f3a42806237c
18 appsecrent=fb6768612d5802551d202d9b4e59d23e
19 token=spd
20
21
22 ehcache.configFile=cache/ehcache-local.xml
23 version=V1.2.7
24 order_template_id=a8mZCkoeBHiqwVUJvDbrNS-qe5mT8wVksutVY_MWSjs
25 store_template_id=wF6hltnW1eYLQRcGIVc7SUCClnR3FXbb9575PDnw3q0
26 lic_template_id=eHuLEQ9lwvfK_ovjKlupDDfMTkUrbbuVPL5-gOSmAuM
27 local_url=http://60.174.197.140:9001
1 <?xml version="1.0" ?>
2
3 <!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
4 debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
5 <configuration scan="true" scanPeriod="600 seconds" debug="false">
6 <!-- 定义日志文件 输入位置 -->
7 <property name="log_dir" value="/usr/supplierlog"/>
8 <!-- 日志最大的历史-->
9 <property name="maxHistory" value="90"/>
10 <property name="normal-pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
11
12 <!-- ConsoleAppender 控制台输出日志 -->
13 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
14 <!-- 对日志进行格式化 -->
15 <encoder>
16 <pattern>${normal-pattern}</pattern>
17 </encoder>
18 </appender>
19
20 <!-- ERROR级别日志 -->
21 <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
22 <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
23 <!-- 过滤器,只记录WARN级别的日志 -->
24 <filter class="ch.qos.logback.classic.filter.LevelFilter">
25 <level>ERROR</level>
26 <onMatch>ACCEPT</onMatch>
27 <onMismatch>DENY</onMismatch>
28 </filter>
29 <file>${log_dir}/error.log</file>
30 <!-- 配置日志所生成的目录-->
31 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
32 <fileNamePattern>${log_dir}/error-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
33 <maxHistory>${maxHistory}</maxHistory>
34 </rollingPolicy>
35 <encoder>
36 <pattern>${normal-pattern}</pattern>
37 </encoder>
38 </appender>
39
40 <!-- INFO级别日志 appender -->
41 <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
42 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
43 <level>INFO</level>
44 </filter>
45 <file>${log_dir}/info.log</file>
46 <!-- 配置日志所生成的目录-->
47 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
48 <fileNamePattern>${log_dir}/info-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
49 <maxHistory>${maxHistory}</maxHistory>
50 </rollingPolicy>
51 <encoder>
52 <pattern>${normal-pattern}</pattern>
53 </encoder>
54 </appender>
55
56 <!-- DEBUG级别日志 appender -->
57 <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
58 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
59 <level>DEBUG</level>
60 </filter>
61 <file>${log_dir}/debug.log</file>
62 <!-- 配置日志所生成的目录-->
63 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
64 <fileNamePattern>${log_dir}/debug-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
65 <maxHistory>${maxHistory}</maxHistory>
66 </rollingPolicy>
67 <encoder>
68 <pattern>${normal-pattern}</pattern>
69 </encoder>
70 </appender>
71
72 <logger name="org.apache.zookeeper.ClientCnxn" level="ERROR" additivity="false"/>
73
74 <logger name="com.phxl.modules.goods.dao" level="debug" additivity="false">
75 <appender-ref ref="debug" />
76 </logger>
77
78 <!-- root级别 DEBUG -->
79 <root level="DEBUG">
80 <!-- 控制台输出 -->
81 <appender-ref ref="STDOUT" />
82 <!-- 文件输出 -->
83 <appender-ref ref="ERROR" />
84 <appender-ref ref="INFO" />
85 <appender-ref ref="DEBUG" />
86 </root>
87 </configuration>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billback.BillBackDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
12 <result column="medMV_row_no" property="medMVRowNo" jdbcType="TINYINT" />
13 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
14 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
15 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
16 <result column="returns_unit" property="returns_Unit" jdbcType="VARCHAR" />
17 <result column="returns_price" property="returns_Price" jdbcType="DECIMAL" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="rpi_qty" property="rpiQty" jdbcType="DECIMAL" />
20 <result column="amount" property="amount" jdbcType="DECIMAL" />
21 <result column="lot" property="lot" jdbcType="VARCHAR" />
22 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
23 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
24 <result column="memo" property="memo" jdbcType="VARCHAR" />
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,bill_no,row_no,medMV_bill_no,medMV_row_no,goods_code,goods_name,goods_spec,returns_unit,returns_price,manufacturer,rpi_qty,amount,lot,production_date,expire_date,memo</sql>
29
30 <!--批量插入BillBackDetail -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_bill_back_detail (id,bill_no,row_no,medMV_bill_no,medMV_row_no,goods_code,goods_name,goods_spec,returns_unit,returns_price,manufacturer,rpi_qty,amount,lot,production_date,expire_date,memo)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.billNo},
38 #{obj.rowNo},
39 #{obj.medMVBillNo},
40 #{obj.medMVRowNo},
41 #{obj.goodsCode},
42 #{obj.goodsName},
43 #{obj.goodsSpec},
44 #{obj.returns_Unit},
45 #{obj.returns_Price},
46 #{obj.manufacturer},
47 #{obj.rpiQty},
48 #{obj.amount},
49 #{obj.lot},
50 #{obj.productionDate},
51 #{obj.expireDate},
52 #{obj.memo}
53 </trim>
54 </foreach>
55 </insert>
56
57
58 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billback.BillBack">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
11 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
12 <result column="supplierb_name" property="supplierbName" jdbcType="VARCHAR" />
13 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
14 <result column="med_name" property="medName" jdbcType="VARCHAR" />
15 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
16 <result column="reason" property="reason" jdbcType="VARCHAR" />
17 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
18 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
19 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
20 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
21 <result column="memo" property="memo" jdbcType="VARCHAR" />
22 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
23 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
24 </resultMap>
25
26 <!--Base_Column_List -->
27 <sql id="Base_Column_List">id,bill_no,medMV_bill_no,supplier_code,supplierb_name,med_code,med_name,bill_date,reason,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
28
29
30 <!-- 新增BillBack-->
31 <insert id="insert" parameterType="com.phxl.modules.goods.entity.billback.BillBack">
32 insert into med_bill_back (id,bill_no,medMV_bill_no,supplier_code,supplierb_name,med_code,med_name,bill_date,reason,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
33 values (
34 #{id,jdbcType=VARCHAR}
35 ,#{billNo,jdbcType=VARCHAR}
36 ,#{medMVBillNo,jdbcType=VARCHAR}
37 ,#{supplierCode,jdbcType=VARCHAR}
38 ,#{supplierbName,jdbcType=VARCHAR}
39 ,#{medCode,jdbcType=VARCHAR}
40 ,#{medName,jdbcType=VARCHAR}
41 ,#{billDate,jdbcType=TIMESTAMP}
42 ,#{reason,jdbcType=VARCHAR}
43 ,#{countSum,jdbcType=TINYINT}
44 ,#{detailSum,jdbcType=DECIMAL}
45 ,#{operaterName,jdbcType=VARCHAR}
46 ,#{inputDate,jdbcType=TIMESTAMP}
47 ,#{memo,jdbcType=VARCHAR}
48 ,#{create_time,jdbcType=TIMESTAMP}
49 ,#{update_time,jdbcType=TIMESTAMP}
50 )
51 </insert>
52
53 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_cate" property="goodsCate" jdbcType="VARCHAR" />
12 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
13 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
14 <result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
15 <result column="unit" property="unit" jdbcType="VARCHAR" />
16 <result column="settle_price" property="settleUnit" jdbcType="DECIMAL" />
17 <result column="settle_amount" property="settlePrice" jdbcType="DECIMAL" />
18 <result column="regist_key" property="registKey" jdbcType="VARCHAR" />
19 <result column="producer_name" property="producerName" jdbcType="VARCHAR" />
20 <result column="lot" property="lot" jdbcType="VARCHAR" />
21 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
22 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
23 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
24 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,settle_bill_no,row_no,goods_code,goods_name,settle_qty,unit,settle_price,settle_amount,regist_key,producer_name,lot,production_date,expire_date,create_time,update_time,goods_cate</sql>
29
30 <!--批量插入BillBackDetail -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_bill_settlement_detail (id,settle_bill_no,row_no,goods_code,goods_name,settle_qty,unit,settle_price,settle_amount,regist_key,producer_name,lot,production_date,expire_date,create_time,update_time,goods_cate)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.settleBillNo},
38 #{obj.rowNo},
39 #{obj.goodsCode},
40 #{obj.goodsName},
41 #{obj.settleQty},
42 #{obj.unit},
43 #{obj.settlePrice},
44 #{obj.settleAmount},
45 #{obj.registKey},
46 #{obj.producerName},
47 #{obj.lot},
48 #{obj.productionDate},
49 #{obj.expireDate},
50 #{obj.create_time},
51 #{obj.update_time},
52 #{obj.goodsCate}
53 </trim>
54 </foreach>
55 </insert>
56
57 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
11 <result column="bill_state" property="billState" jdbcType="VARCHAR" />
12 <result column="purchaser_corp_code" property="medCode" jdbcType="VARCHAR" />
13 <result column="purchaser_corp_name" property="medName" jdbcType="VARCHAR" />
14 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
15 <result column="supplier_name" property="supplierName" jdbcType="TIMESTAMP" />
16 <result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
17 <result column="amount" property="amount" jdbcType="DECIMAL" />
18 <result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
19 <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
20 <result column="use_bill_no" property="usebillno" jdbcType="VARCHAR" />
21 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
22 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
23 </resultMap>
24
25 <!--Base_Column_List -->
26 <sql id="Base_Column_List">id,settle_bill_no,settle_date,bill_state,purchaser_corp_code,purchaser_corp_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,use_bill_no,create_time,update_time</sql>
27
28
29 <!-- 新增BillBack-->
30 <insert id="insert" parameterType="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
31 insert into med_bill_settlement (id,settle_bill_no,settle_date,bill_state,purchaser_corp_code,purchaser_corp_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,use_bill_no,create_time,update_time)
32 values (
33 #{id,jdbcType=VARCHAR}
34 ,#{settleBillNo,jdbcType=VARCHAR}
35 ,#{settleDate,jdbcType=TIMESTAMP}
36 ,#{billState,jdbcType=VARCHAR}
37 ,#{medCode,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{supplierCode,jdbcType=VARCHAR}
40 ,#{supplierName,jdbcType=TIMESTAMP}
41 ,#{goodsSum,jdbcType=TINYINT}
42 ,#{amount,jdbcType=DECIMAL}
43 ,#{beginDate,jdbcType=TIMESTAMP}
44 ,#{endDate,jdbcType=TIMESTAMP}
45 ,#{useBillNo,jdbcType=VARCHAR}
46 ,#{create_time,jdbcType=TIMESTAMP}
47 ,#{update_time,jdbcType=TIMESTAMP}
48 )
49 </insert>
50
51 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
10 <result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
11 <result column="real_name" property="realName" jdbcType="VARCHAR" />
12 <result column="help_code" property="helpCode" jdbcType="VARCHAR" />
13 <result column="sex" property="sex" jdbcType="VARCHAR" />
14 <result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
15 <result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
16 <result column="idcode" property="idcode" jdbcType="VARCHAR" />
17 <result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
18 <result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
19 <result column="category" property="category" jdbcType="VARCHAR" />
20 <result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
21 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
22 </resultMap>
23
24 <!--Base_Column_List -->
25 <sql id="Base_Column_List">id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time</sql>
26
27 <!--批量插入MedPlanDetail -->
28 <insert id="batchInsert" parameterType="list">
29 insert into med_hli_care_prov (id,mfmed_staff_code,logon_user,real_name,help_code,sex,mobile_tel,web_chat_code,idcode,e_mail,hdept_code,category,ishadministrator,update_time)
30 values
31 <foreach collection ="list" item="obj" separator =",">
32 <trim prefix=" (" suffix=")" suffixOverrides=",">
33 #{obj.id},
34 #{obj.mfmedStaffCode},
35 #{obj.logonUser},
36 #{obj.realName},
37 #{obj.helpCode},
38 #{obj.sex},
39 #{obj.mobileTel},
40 #{obj.webChatCode},
41 #{obj.idcode},
42 #{obj.e_mail},
43 #{obj.hdeptCode},
44 #{obj.category},
45 #{obj.ishadministrator},
46 #{obj.update_time}
47 </trim>
48 </foreach>
49 </insert>
50
51 <!-- 批量查询HisCtDept -->
52 <select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
53 select
54 <include refid="Base_Column_List" />
55 from med_hli_care_prov
56 <if test="ryCodes != null">
57 where mfmed_staff_code in
58 <foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
59 #{item}
60 </foreach>
61 </if>
62 </select>
63
64 <update id="batchUpdate" parameterType="list">
65 update med_hli_care_prov
66 <trim prefix="set" suffixOverrides=",">
67 <trim prefix="mfmed_staff_code=case" suffix="end,">
68 <foreach collection="list" item="obj" index="index">
69 <if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
70 when id = #{obj.id}
71 then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
72 </if>
73 </foreach>
74 </trim>
75 <trim prefix="logon_user=case" suffix="end,">
76 <foreach collection="list" item="obj" index="index">
77 <if test="obj.logonUser != null and obj.logonUser != ''">
78 when id = #{obj.id}
79 then
80 #{obj.logonUser,jdbcType=VARCHAR}
81 </if>
82 </foreach>
83 </trim>
84 <trim prefix="help_code=case" suffix="end,">
85 <foreach collection="list" item="obj" index="index">
86 <if test="obj.helpCode != null and obj.helpCode != ''">
87 when id = #{obj.id}
88 then #{obj.helpCode,jdbcType=VARCHAR}
89 </if>
90 </foreach>
91 </trim>
92 <trim prefix="real_name=case" suffix="end,">
93 <foreach collection="list" item="obj" index="index">
94 <if test="obj.realName != null and obj.realName != ''">
95 when id = #{obj.id}
96 then #{obj.realName,jdbcType=VARCHAR}
97 </if>
98 </foreach>
99 </trim>
100 <trim prefix="help_code=case" suffix="end,">
101 <foreach collection="list" item="obj" index="index">
102 <if test="obj.helpCode != null and obj.helpCode != ''">
103 when id = #{obj.id}
104 then #{obj.helpCode,jdbcType=VARCHAR}
105 </if>
106 </foreach>
107 </trim>
108 <trim prefix="sex=case" suffix="end,">
109 <foreach collection="list" item="obj" index="index">
110 <if test="obj.sex != null and obj.sex != ''">
111 when id = #{obj.id}
112 then #{obj.sex,jdbcType=VARCHAR}
113 </if>
114 </foreach>
115 </trim>
116 <trim prefix="mobile_tel=case" suffix="end,">
117 <foreach collection="list" item="obj" index="index">
118 <if test="obj.mobileTel != null and obj.mobileTel != ''">
119 when id = #{obj.id}
120 then #{obj.mobileTel,jdbcType=VARCHAR}
121 </if>
122 </foreach>
123 </trim>
124 <trim prefix="category=case" suffix="end,">
125 <foreach collection="list" item="obj" index="index">
126 <if test="obj.category != null and obj.category != ''">
127 when id = #{obj.id}
128 then #{obj.category,jdbcType=VARCHAR}
129 </if>
130 </foreach>
131 </trim>
132 <trim prefix="web_chat_code=case" suffix="end,">
133 <foreach collection="list" item="obj" index="index">
134 <if test="obj.webChatCode != null and obj.webChatCode != ''">
135 when id = #{obj.id}
136 then #{obj.webChatCode,jdbcType=VARCHAR}
137 </if>
138 </foreach>
139 </trim>
140 <trim prefix="idcode=case" suffix="end,">
141 <foreach collection="list" item="obj" index="index">
142 <if test="obj.idcode != null and obj.idcode != ''">
143 when id = #{obj.id}
144 then #{obj.idcode,jdbcType=VARCHAR}
145 </if>
146 </foreach>
147 </trim>
148 <trim prefix="hdept_code=case" suffix="end,">
149 <foreach collection="list" item="obj" index="index">
150 <if test="obj.hdeptCode != null and obj.hdeptCode != ''">
151 when id = #{obj.id}
152 then #{obj.hdeptCode,jdbcType=VARCHAR}
153 </if>
154 </foreach>
155 </trim>
156 <trim prefix="e_mail=case" suffix="end,">
157 <foreach collection="list" item="obj" index="index">
158 <if test="obj.e_mail != null and obj.e_mail != ''">
159 when id = #{obj.id}
160 then #{obj.e_mail,jdbcType=VARCHAR}
161 </if>
162 </foreach>
163 </trim>
164 <trim prefix="ishadministrator=case" suffix="end,">
165 <foreach collection="list" item="obj" index="index">
166 <if test="obj.ishadministrator != null and obj.ishadministrator != ''">
167 when id = #{obj.id}
168 then #{obj.ishadministrator,jdbcType=VARCHAR}
169 </if>
170 </foreach>
171 </trim>
172 <trim prefix="category=case" suffix="end,">
173 <foreach collection="list" item="obj" index="index">
174 <if test="obj.category != null and obj.category != ''">
175 when id = #{obj.id}
176 then #{obj.category,jdbcType=VARCHAR}
177 </if>
178 </foreach>
179 </trim>
180 <trim prefix="update_time=case" suffix="end,">
181 <foreach collection="list" item="obj" index="index">
182 <if test="obj.update_time != null and obj.update_time != ''">
183 when id = #{obj.id}
184 then #{obj.update_time,jdbcType=VARCHAR}
185 </if>
186 </foreach>
187 </trim>
188 </trim>
189 where
190 <foreach collection="list" separator="or" item="obj" index="index">
191 id
192 = #{obj.id}
193 </foreach>
194 </update>
195
196
197 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.ctdept.HisCtDeptDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.ctdept.HisCtDept">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
10 <result column="hdept_name" property="hdeptName" jdbcType="VARCHAR" />
11 <result column="help_code" property="helpCode" jdbcType="VARCHAR" />
12 <result column="upper_GUID" property="upperGUID" jdbcType="VARCHAR" />
13 <result column="is_order_right" property="isOrderRight" jdbcType="VARCHAR" />
14 <result column="category" property="category" jdbcType="VARCHAR" />
15 <result column="director" property="director" jdbcType="VARCHAR" />
16 <result column="state" property="state" jdbcType="VARCHAR" />
17 <result column="is_last_level" property="isLastLevel" jdbcType="VARCHAR" />
18 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
19 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
20 </resultMap>
21
22 <!--Base_Column_List -->
23 <sql id="Base_Column_List">id,hdept_code,hdept_name,help_code,upper_GUID,is_order_right,category,director,state,is_last_level,create_time,update_time</sql>
24
25 <!-- 批量查询 -->
26 <select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
27 select
28 <include refid="Base_Column_List" />
29 from med_hli_dept
30 <if test="ctcpCodes != null">
31 where hdept_code in
32 <foreach item="item" index="index" collection="ctcpCodes" open="(" separator="," close=")">
33 #{item}
34 </foreach>
35 </if>
36 </select>
37
38 <!--批量插入 -->
39 <insert id="batchInsert" parameterType="list">
40 insert into med_hli_dept (id,hdept_code,hdept_name,help_code,upper_GUID,is_order_right,category,director,state,is_last_level,create_time,update_time)
41 values
42 <foreach collection ="list" item="obj" separator =",">
43 <trim prefix=" (" suffix=")" suffixOverrides=",">
44 #{obj.id},
45 #{obj.hdeptCode},
46 #{obj.hdeptName},
47 #{obj.helpCode},
48 #{obj.upperGUID},
49 #{obj.isOrderRight},
50 #{obj.category},
51 #{obj.director},
52 #{obj.state},
53 #{obj.isLastLevel},
54 #{obj.create_time},
55 #{obj.update_time}
56 </trim>
57 </foreach>
58 </insert>
59
60 <update id="batchUpdate" parameterType="list">
61 update med_hli_dept
62 <trim prefix="set" suffixOverrides=",">
63 <trim prefix="hdept_code=case" suffix="end,">
64 <foreach collection="list" item="obj" index="index">
65 <if test="obj.hdeptCode != null and obj.hdeptCode != ''">
66 when id = #{obj.id}
67 then #{obj.hdeptCode,jdbcType=VARCHAR}
68 </if>
69 </foreach>
70 </trim>
71 <trim prefix="hdept_name=case" suffix="end,">
72 <foreach collection="list" item="obj" index="index">
73 <if test="obj.hdeptName != null and obj.hdeptName != ''">
74 when id = #{obj.id}
75 then
76 #{obj.hdeptName,jdbcType=VARCHAR}
77 </if>
78 </foreach>
79 </trim>
80 <trim prefix="help_code=case" suffix="end,">
81 <foreach collection="list" item="obj" index="index">
82 <if test="obj.helpCode != null and obj.helpCode != ''">
83 when id = #{obj.id}
84 then #{obj.helpCode,jdbcType=VARCHAR}
85 </if>
86 </foreach>
87 </trim>
88 <trim prefix="upper_GUID=case" suffix="end,">
89 <foreach collection="list" item="obj" index="index">
90 <if test="obj.upperGUID != null and obj.upperGUID != ''">
91 when id = #{obj.id}
92 then #{obj.upperGUID,jdbcType=VARCHAR}
93 </if>
94 </foreach>
95 </trim>
96 <trim prefix="is_order_right=case" suffix="end,">
97 <foreach collection="list" item="obj" index="index">
98 <if test="obj.isOrderRight != null and obj.isOrderRight != ''">
99 when id = #{obj.id}
100 then #{obj.isOrderRight,jdbcType=VARCHAR}
101 </if>
102 </foreach>
103 </trim>
104 <trim prefix="category=case" suffix="end,">
105 <foreach collection="list" item="obj" index="index">
106 <if test="obj.category != null and obj.category != ''">
107 when id = #{obj.id}
108 then #{obj.category,jdbcType=VARCHAR}
109 </if>
110 </foreach>
111 </trim>
112 <trim prefix="director=case" suffix="end,">
113 <foreach collection="list" item="obj" index="index">
114 <if test="obj.director != null and obj.director != ''">
115 when id = #{obj.id}
116 then #{obj.director,jdbcType=VARCHAR}
117 </if>
118 </foreach>
119 </trim>
120 <trim prefix="state=case" suffix="end,">
121 <foreach collection="list" item="obj" index="index">
122 <if test="obj.state != null and obj.state != ''">
123 when id = #{obj.id}
124 then #{obj.state,jdbcType=VARCHAR}
125 </if>
126 </foreach>
127 </trim>
128 <trim prefix="is_last_level=case" suffix="end,">
129 <foreach collection="list" item="obj" index="index">
130 <if test="obj.isLastLevel != null and obj.isLastLevel != ''">
131 when id = #{obj.id}
132 then #{obj.isLastLevel,jdbcType=VARCHAR}
133 </if>
134 </foreach>
135 </trim>
136 <trim prefix="create_time=case" suffix="end,">
137 <foreach collection="list" item="obj" index="index">
138 <if test="obj.create_time != null">
139 when id = #{obj.id}
140 then #{obj.create_time,jdbcType=DATE}
141 </if>
142 </foreach>
143 </trim>
144 <trim prefix="update_time=case" suffix="end,">
145 <foreach collection="list" item="obj" index="index">
146 <if test="obj.update_time != null">
147 when id = #{obj.id}
148 then #{obj.update_time,jdbcType=DATE}
149 </if>
150 </foreach>
151 </trim>
152 </trim>
153 where
154 <foreach collection="list" separator="or" item="obj" index="index">
155 id
156 = #{obj.id}
157 </foreach>
158 </update>
159
160
161 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao">
4
5 <!--BaseResultMap-->
6 <resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
7 <id column="id" property="id" jdbcType="BIGINT"/>
8 <result column="med_code" property="medCode" jdbcType="VARCHAR"/>
9 <result column="med_name" property="medName" jdbcType="VARCHAR"/>
10 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
11 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
13 <result column="s_name" property="sName" jdbcType="VARCHAR"/>
14 <result column="p_name" property="pName" jdbcType="VARCHAR"/>
15 <result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
16 <result column="producer" property="producer" jdbcType="VARCHAR"/>
17 <result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
18 <result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
19 <result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
20 <result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
21 <result column="price" property="price" jdbcType="DECIMAL"/>
22 <result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
23 <result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
24 <result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
25 <result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
26 <result column="length" property="length" jdbcType="DECIMAL"/>
27 <result column="width" property="width" jdbcType="DECIMAL"/>
28 <result column="height" property="height" jdbcType="DECIMAL"/>
29 <result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
30 <result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
31 <result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
32 <result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
33 <result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
34 <result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
35 <result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
36 <result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
37 <result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
38 <result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
39 <result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
40 <result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
41 <result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
42 <result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
43 <result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
44 <result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
45 <result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
46 <result column="brand" property="brand" jdbcType="VARCHAR"/>
47 <result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
48 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
49 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
50 <result column="memo" property="memo" jdbcType="VARCHAR"/>
51 </resultMap>
52
53 <!--Base_Column_List-->
54 <sql id="Base_Column_List">id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo</sql>
55
56 <!-- 新增HisCtMedicineMaterial-->
57 <insert id="insert" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
58 insert into med_hli_medicine_material (id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo)
59 values (
60 #{id,jdbcType=VARCHAR}
61 ,#{medCode,jdbcType=VARCHAR}
62 ,#{medName,jdbcType=VARCHAR}
63 ,#{goodsCode,jdbcType=VARCHAR}
64 ,#{goodsSpec,jdbcType=VARCHAR}
65 ,#{goodsName,jdbcType=VARCHAR}
66 ,#{sName,jdbcType=VARCHAR}
67 ,#{pName,jdbcType=VARCHAR}
68 ,#{helpCode,jdbcType=VARCHAR}
69 ,#{producer,jdbcType=VARCHAR}
70 ,#{agentName,jdbcType=VARCHAR}
71 ,#{medGoodsCateGUID,jdbcType=VARCHAR}
72 ,#{medGoodsCateName,jdbcType=VARCHAR}
73 ,#{registKey,jdbcType=VARCHAR}
74 ,#{price,jdbcType=DECIMAL}
75 ,#{salePrice,jdbcType=DECIMAL}
76 ,#{batSalePrice,jdbcType=DECIMAL}
77 ,#{productionAddress,jdbcType=VARCHAR}
78 ,#{dosageForm,jdbcType=VARCHAR}
79 ,#{length,jdbcType=DECIMAL}
80 ,#{width,jdbcType=DECIMAL}
81 ,#{height,jdbcType=DECIMAL}
82 ,#{grossWeight,jdbcType=DECIMAL}
83 ,#{netWeight,jdbcType=DECIMAL}
84 ,#{unitStyle,jdbcType=VARCHAR}
85 ,#{bigUnitStyle,jdbcType=VARCHAR}
86 ,#{bigUnitQty,jdbcType=DECIMAL}
87 ,#{bigBcd,jdbcType=VARCHAR}
88 ,#{minUnitStyle,jdbcType=VARCHAR}
89 ,#{minUnitQty,jdbcType=DECIMAL}
90 ,#{litBcd,jdbcType=VARCHAR}
91 ,#{isLotCtrlInput,jdbcType=VARCHAR}
92 ,#{bizState,jdbcType=VARCHAR}
93 ,#{importedFlag,jdbcType=VARCHAR}
94 ,#{reportFlag,jdbcType=VARCHAR}
95 ,#{noxiousFlag,jdbcType=VARCHAR}
96 ,#{drugNerveFlag,jdbcType=VARCHAR}
97 ,#{productStandardCode,jdbcType=VARCHAR}
98 ,#{specStandardCode,jdbcType=VARCHAR}
99 ,#{brand,jdbcType=VARCHAR}
100 ,#{coldFlag,jdbcType=VARCHAR}
101 ,#{supplierCode,jdbcType=VARCHAR}
102 ,#{supplierName,jdbcType=VARCHAR}
103 ,#{memo,jdbcType=VARCHAR}
104 )
105 </insert>
106
107 <!-- 按需修改HisCtMedicineMaterial-->
108 <update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
109 update med_hli_medicine_material
110 <set>
111 <if test="medName != null and medName != ''">
112 med_name = #{medName,jdbcType=VARCHAR},
113 </if>
114 <if test="goodsCode != null and goodsCode != ''">
115 goods_code = #{goodsCode,jdbcType=VARCHAR},
116 </if>
117 <if test="goodsSpec != null and goodsSpec != ''">
118 goods_spec = #{goodsSpec,jdbcType=VARCHAR},
119 </if>
120 <if test="goodsName != null and goodsName != ''">
121 goods_name = #{goodsName,jdbcType=VARCHAR},
122 </if>
123 <if test="sName != null and sName != ''">
124 s_name = #{sName,jdbcType=VARCHAR},
125 </if>
126 <if test="pName != null and pName != ''">
127 p_name = #{pName,jdbcType=VARCHAR},
128 </if>
129 <if test="helpCode != null and helpCode != ''">
130 help_code = #{helpCode,jdbcType=VARCHAR},
131 </if>
132 <if test="producer != null and producer != ''">
133 producer = #{producer,jdbcType=VARCHAR},
134 </if>
135 <if test="agentName != null and agentName != ''">
136 agent_name = #{agentName,jdbcType=VARCHAR},
137 </if>
138 <if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
139 med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
140 </if>
141 <if test="medGoodsCateName != null and medGoodsCateName != ''">
142 med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
143 </if>
144 <if test="registKey != null and registKey != ''">
145 regist_key = #{registKey,jdbcType=VARCHAR},
146 </if>
147 <if test="price != null and price != ''">
148 price = #{price,jdbcType=DECIMAL},
149 </if>
150 <if test="salePrice != null and salePrice != ''">
151 sale_price = #{salePrice,jdbcType=DECIMAL},
152 </if>
153 <if test="batSalePrice != null and batSalePrice != ''">
154 bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
155 </if>
156 <if test="productionAddress != null and productionAddress != ''">
157 production_address = #{productionAddress,jdbcType=VARCHAR},
158 </if>
159 <if test="dosageForm != null and dosageForm != ''">
160 dosage_form = #{dosageForm,jdbcType=VARCHAR},
161 </if>
162 <if test="length != null and length != ''">
163 length = #{length,jdbcType=DECIMAL},
164 </if>
165 <if test="width != null and width != ''">
166 width = #{width,jdbcType=DECIMAL},
167 </if>
168 <if test="height != null and height != ''">
169 height = #{height,jdbcType=DECIMAL},
170 </if>
171 <if test="grossWeight != null and grossWeight != ''">
172 gross_weight = #{grossWeight,jdbcType=DECIMAL},
173 </if>
174 <if test="netWeight != null and netWeight != ''">
175 net_weight = #{netWeight,jdbcType=DECIMAL},
176 </if>
177 <if test="unitStyle != null and unitStyle != ''">
178 unit_style = #{unitStyle,jdbcType=VARCHAR},
179 </if>
180 <if test="bigUnitStyle != null and bigUnitStyle != ''">
181 big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
182 </if>
183 <if test="bigUnitQty != null and bigUnitQty != ''">
184 big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
185 </if>
186 <if test="bigBcd != null and bigBcd != ''">
187 big_bcd = #{bigBcd,jdbcType=VARCHAR},
188 </if>
189 <if test="minUnitStyle != null and minUnitStyle != ''">
190 min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
191 </if>
192 <if test="minUnitQty != null and minUnitQty != ''">
193 min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
194 </if>
195 <if test="litBcd != null and litBcd != ''">
196 lit_bcd = #{litBcd,jdbcType=VARCHAR},
197 </if>
198 <if test="isLotCtrlInput != null and isLotCtrlInput != ''">
199 is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
200 </if>
201 <if test="bizState != null and bizState != ''">
202 biz_state = #{bizState,jdbcType=VARCHAR},
203 </if>
204 <if test="importedFlag != null and importedFlag != ''">
205 imported_flag = #{importedFlag,jdbcType=VARCHAR},
206 </if>
207 <if test="reportFlag != null and reportFlag != ''">
208 report_flag = #{reportFlag,jdbcType=VARCHAR},
209 </if>
210 <if test="noxiousFlag != null and noxiousFlag != ''">
211 noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
212 </if>
213 <if test="drugNerveFlag != null and drugNerveFlag != ''">
214 drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
215 </if>
216 <if test="productStandardCode != null and productStandardCode != ''">
217 product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
218 </if>
219 <if test="specStandardCode != null and specStandardCode != ''">
220 spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
221 </if>
222 <if test="brand != null and brand != ''">
223 brand = #{brand,jdbcType=VARCHAR},
224 </if>
225 <if test="coldFlag != null and coldFlag != ''">
226 cold_flag = #{coldFlag,jdbcType=VARCHAR},
227 </if>
228 <if test="supplierCode != null and supplierCode != ''">
229 supplier_code = #{supplierCode,jdbcType=VARCHAR},
230 </if>
231 <if test="supplierName != null and supplierName != ''">
232 supplier_name=#{supplierName,jdbcType=VARCHAR},
233 </if>
234 <if test="memo != null and memo != ''">
235 memo=#{memo,jdbcType=VARCHAR}
236 </if>
237 </set>
238 where med_code = #{medCode,jdbcType=BIGINT}
239 </update>
240
241
242 <!-- 查询HisCtMedicineMaterial详情 -->
243 <select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
244 select
245 <include refid="Base_Column_List"/>
246 from med_hli_medicine_material material
247 <where>
248 <if test="goodsCode!=null and goodsCode!=''">
249 And goods_code = #{goodsCode,jdbcType=VARCHAR}
250 </if>
251 </where>
252 </select>
253
254 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao">
4
5 <insert id="insert">
6 INSERT INTO med_interface_log(
7 id,
8 request_time,
9 request_method,
10 request_param
11 ) VALUES (
12 #{id},
13 #{requestTime},
14 #{requestMethod},
15 #{requestParam}
16 )
17 </insert>
18
19 <!-- 更新接口请求结果信息-->
20 <update id="update" parameterType="com.phxl.modules.goods.entity.interfaceLog.InterfaceLog">
21 update med_interface_log
22 <set>
23 <if test="resultCode != null and resultCode != ''">
24 result_code = #{resultCode,jdbcType=VARCHAR},
25 </if>
26 <if test="resultContent != null and resultContent != ''">
27 result_content = #{resultContent,jdbcType=VARCHAR},
28 </if>
29 <if test="exception != null and exception != ''">
30 exception = #{exception,jdbcType=VARCHAR}
31 </if>
32 </set>
33 where id = #{id,jdbcType=BIGINT}
34 </update>
35
36 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="producer_name" property="producerName" jdbcType="VARCHAR" />
15 <result column="regist_key" property="registKey" jdbcType="VARCHAR" />
16 <result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
17 <result column="unit" property="unit" jdbcType="VARCHAR" />
18 <result column="settle_price" property="settlePrice" jdbcType="DECIMAL" />
19 <result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
20 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
21 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
22 <result column="invoice_no" property="invoiceNo" jdbcType="VARCHAR" />
23 <result column="invoice_code" property="invoiceCode" jdbcType="VARCHAR" />
24 <result column="invoice_time" property="invoiceTime" jdbcType="DECIMAL" />
25 <result column="invoice_amount" property="invoiceAmount" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,settle_bill_no,row_no,goods_code,goods_name,goods_spec,producer_name,regist_key,settle_qty,unit,settle_price,settle_amount,create_time,update_time,invoice_no,invoice_code,invoice_time,invoice_amount</sql>
30
31 <!--批量插入MedPlanDetail -->
32 <insert id="batchInsert" parameterType="list">
33 insert into med_supplier_invoice_back_detail (id,settle_bill_no,row_no,goods_code,goods_name,goods_spec,producer_name,regist_key,settle_qty,unit,settle_price,settle_amount,create_time,update_time,invoice_no,invoice_code,invoice_time,invoice_amount)
34 values
35 <foreach collection ="list" item="obj" separator =",">
36 <trim prefix=" (" suffix=")" suffixOverrides=",">
37 #{obj.id},
38 #{obj.settleBillNo},
39 #{obj.rowNo},
40 #{obj.goodsCode},
41 #{obj.goodsName},
42 #{obj.goodsSpec},
43 #{obj.producerName},
44 #{obj.registKey},
45 #{obj.settleQty},
46 #{obj.unit},
47 #{obj.settlePrice},
48 #{obj.settleAmount},
49 #{obj.create_time},
50 #{obj.update_time},
51 #{obj.invoiceNo},
52 #{obj.invoiceCode},
53 #{obj.invoiceTime},
54 #{obj.invoiceAmount}
55 </trim>
56 </foreach>
57 </insert>
58
59
60 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
10 <result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
11 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
12 <result column="med_name" property="medName" jdbcType="VARCHAR" />
13 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
14 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
15 <result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
16 <result column="amount" property="amount" jdbcType="DECIMAL" />
17 <result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
18 <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
19 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
20 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
21 </resultMap>
22
23 <!--Base_Column_List -->
24 <sql id="Base_Column_List">id,settle_bill_no,settle_date,med_code,med_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,create_time,update_time</sql>
25
26 <!-- 新增invoiceback-->
27 <insert id="insert" parameterType="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
28 insert into med_supplier_invoice_back (id,settle_bill_no,settle_date,med_code,med_name,supplier_code,supplier_name,goods_sum,amount,begin_date,end_date,create_time,update_time)
29 values (
30 #{id,jdbcType=VARCHAR}
31 ,#{settleBillNo,jdbcType=VARCHAR}
32 ,#{settleDate,jdbcType=TIMESTAMP}
33 ,#{medCode,jdbcType=VARCHAR}
34 ,#{medName,jdbcType=VARCHAR}
35 ,#{supplierCode,jdbcType=VARCHAR}
36 ,#{supplierName,jdbcType=VARCHAR}
37 ,#{goodsSum,jdbcType=TINYINT}
38 ,#{amount,jdbcType=DECIMAL}
39 ,#{beginDate,jdbcType=TIMESTAMP}
40 ,#{endDate,jdbcType=TIMESTAMP}
41 ,#{create_time,jdbcType=TIMESTAMP}
42 ,#{update_time,jdbcType=TIMESTAMP}
43 )
44 </insert>
45
46 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medinstore.MedInStoreDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
12 <result column="supplier_do_no" property="supplierDoNo" jdbcType="VARCHAR" />
13 <result column="supplier_do_row_no" property="supplierDoRowNo" jdbcType="TINYINT" />
14 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
15 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
16 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
17 <result column="unit" property="unit" jdbcType="VARCHAR" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
20 <result column="amount" property="amount" jdbcType="DECIMAL" />
21 <result column="lot" property="lot" jdbcType="VARCHAR" />
22 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
23 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
24 <result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
25 <result column="mvqty" property="mvqty" jdbcType="DECIMAL" />
26 <result column="memo" property="memo" jdbcType="VARCHAR" />
27 </resultMap>
28
29 <!--Base_Column_List -->
30 <sql id="Base_Column_List">id,bill_no,row_no,med_plan_row_no,supplier_do_no,supplier_do_row_no,goods_code,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,arrivalqty,mvqty,memo</sql>
31
32 <!--批量插入MedInStoreDetail -->
33 <insert id="batchInsert" parameterType="list">
34 insert into med_hli_in_store_detail (id,bill_no,row_no,med_plan_row_no,supplier_do_no,supplier_do_row_no,goods_code,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,arrivalqty,mvqty,memo)
35 values
36 <foreach collection ="list" item="obj" separator =",">
37 <trim prefix=" (" suffix=")" suffixOverrides=",">
38 #{obj.id},
39 #{obj.billNo},
40 #{obj.rowNo},
41 #{obj.medPlanRowNo},
42 #{obj.supplierDoNo},
43 #{obj.supplierDoRowNo},
44 #{obj.goodsCode},
45 #{obj.goodsName},
46 #{obj.goodsSpec},
47 #{obj.unit},
48 #{obj.manufacturer},
49 #{obj.purchaserPrice},
50 #{obj.amount},
51 #{obj.lot},
52 #{obj.productionDate},
53 #{obj.expireDate},
54 #{obj.arrivalqty},
55 #{obj.mvqty},
56 #{obj.memo}
57 </trim>
58 </foreach>
59 </insert>
60
61
62 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medinstore.MedInStore">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
11 <result column="med_name" property="medName" jdbcType="VARCHAR" />
12 <result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
13 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
14 <result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
15 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
16 <result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
17 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
18 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
19 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
20 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
21 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
22 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
25 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
30
31 <!-- 新增MedInStore-->
32 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medinstore.MedInStore">
33 insert into med_hli_in_store (id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
34 values (
35 #{id,jdbcType=VARCHAR}
36 ,#{billNo,jdbcType=VARCHAR}
37 ,#{medGuid,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{medDeptGuid,jdbcType=VARCHAR}
40 ,#{medDeptName,jdbcType=VARCHAR}
41 ,#{medStoreGuid,jdbcType=VARCHAR}
42 ,#{medStoreName,jdbcType=VARCHAR}
43 ,#{supplierGuid,jdbcType=VARCHAR}
44 ,#{supplierName,jdbcType=VARCHAR}
45 ,#{billDate,jdbcType=TIMESTAMP}
46 ,#{countSum,jdbcType=TINYINT}
47 ,#{detailSum,jdbcType=DECIMAL}
48 ,#{operaterName,jdbcType=VARCHAR}
49 ,#{inputDate,jdbcType=TIMESTAMP}
50 ,#{memo,jdbcType=VARCHAR}
51 ,#{create_time,jdbcType=TIMESTAMP}
52 ,#{update_time,jdbcType=TIMESTAMP}
53 )
54 </insert>
55
56
57 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medplan.MedPlanDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
15 <result column="po_qty" property="poQty" jdbcType="DECIMAL" />
16 <result column="unit" property="unit" jdbcType="VARCHAR" />
17 <result column="taxprice" property="taxprice" jdbcType="DECIMAL" />
18 <result column="taxsum" property="taxsum" jdbcType="DECIMAL" />
19 </resultMap>
20
21 <!--Base_Column_List -->
22 <sql id="Base_Column_List">id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum</sql>
23
24 <!--批量插入MedPlanDetail -->
25 <insert id="batchInsert" parameterType="list">
26 insert into med_hli_plan_detail (id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum)
27 values
28 <foreach collection ="list" item="obj" separator =",">
29 <trim prefix=" (" suffix=")" suffixOverrides=",">
30 #{obj.id},
31 #{obj.billNo},
32 #{obj.rowNo},
33 #{obj.goodsCode},
34 #{obj.goodsName},
35 #{obj.goodsSpec},
36 #{obj.manufacturer},
37 #{obj.poQty},
38 #{obj.unit},
39 #{obj.taxprice},
40 #{obj.taxsum}
41 </trim>
42 </foreach>
43 </insert>
44
45
46 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medplan.MedPlan">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
10 <result column="med_name" property="medName" jdbcType="VARCHAR" />
11 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
12 <result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
13 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
14 <result column="bill_type" property="billType" jdbcType="VARCHAR" />
15 <result column="settle_type" property="settleType" jdbcType="VARCHAR" />
16 <result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
17 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
18 <result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
19 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
20 <result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
21 <result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
22 <result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
25 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
26 <result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
27 <result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
28 </resultMap>
29
30 <!--Base_Column_List -->
31 <sql id="Base_Column_List">id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time</sql>
32
33 <!--批量插入 -->
34 <insert id="batchInsert" parameterType="list">
35 insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
36 values
37 <foreach collection ="list" item="obj" separator =",">
38 <trim prefix=" (" suffix=")" suffixOverrides=",">
39 #{obj.id},
40 #{obj.medCode},
41 #{obj.medName},
42 #{obj.supplierCode},
43 #{obj.suppliername},
44 #{obj.billNo},
45 #{obj.billType},
46 #{obj.medDeptCode},
47 #{obj.medDeptName},
48 #{obj.medStoreCode},
49 #{obj.medStoreName},
50 #{obj.firstFlag},
51 #{obj.planBeginDate},
52 #{obj.planEndDate},
53 #{obj.memo},
54 #{obj.operaterName},
55 #{obj.inputDate},
56 #{obj.create_time},
57 #{obj.update_time}
58 </trim>
59 </foreach>
60 </insert>
61
62 <!-- 新增MedPlan-->
63 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
64 insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,settle_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
65 values (
66 #{id,jdbcType=VARCHAR}
67 ,#{medCode,jdbcType=VARCHAR}
68 ,#{medName,jdbcType=VARCHAR}
69 ,#{supplierCode,jdbcType=VARCHAR}
70 ,#{suppliername,jdbcType=VARCHAR}
71 ,#{billNo,jdbcType=VARCHAR}
72 ,#{billType,jdbcType=VARCHAR}
73 ,#{settleType,jdbcType=VARCHAR}
74 ,#{medDeptCode,jdbcType=VARCHAR}
75 ,#{medDeptName,jdbcType=VARCHAR}
76 ,#{medStoreCode,jdbcType=VARCHAR}
77 ,#{medStoreName,jdbcType=VARCHAR}
78 ,#{firstFlag,jdbcType=VARCHAR}
79 ,#{planBeginDate,jdbcType=TIMESTAMP}
80 ,#{planEndDate,jdbcType=TIMESTAMP}
81 ,#{memo,jdbcType=VARCHAR}
82 ,#{operaterName,jdbcType=VARCHAR}
83 ,#{inputDate,jdbcType=TIMESTAMP}
84 ,#{create_time,jdbcType=TIMESTAMP}
85 ,#{update_time,jdbcType=TIMESTAMP}
86 )
87 </insert>
88
89 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.medstock.MedStockDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.medstock.MedStock">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
10 <result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
11 <result column="store_code" property="storeCode" jdbcType="VARCHAR" />
12 <result column="store_name" property="storeName" jdbcType="VARCHAR" />
13 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
14 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
15 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
16 <result column="lot" property="lot" jdbcType="VARCHAR" />
17 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
18 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
19 <result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
20 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
21 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
22 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
23 <result column="med_name" property="medName" jdbcType="VARCHAR" />
24
25 </resultMap>
26
27 <!--Base_Column_List -->
28 <sql id="Base_Column_List">id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name</sql>
29
30 <!--批量插入 -->
31 <insert id="batchInsert" parameterType="list">
32 insert into med_stock (id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name)
33 values
34 <foreach collection ="list" item="obj" separator =",">
35 <trim prefix=" (" suffix=")" suffixOverrides=",">
36 #{obj.id},
37 #{obj.medSuppliercode},
38 #{obj.medSuppliername},
39 #{obj.storeCode},
40 #{obj.storeName},
41 #{obj.goodsCode},
42 #{obj.goodsSpec},
43 #{obj.goodsName},
44 #{obj.lot},
45 #{obj.productionDate},
46 #{obj.expireDate},
47 #{obj.stockQty},
48 #{obj.createTime},
49 #{obj.updateTime},
50 #{obj.medCode},
51 #{obj.medName},
52 </trim>
53 </foreach>
54 </insert>
55 <!-- 新增HisSpills-->
56 <insert id="insert" parameterType="com.phxl.modules.goods.entity.medstock.MedStock">
57 insert into med_stock (id,med_suppliercode,med_suppliername,store_code,store_name,goods_code,goods_spec,goods_name,lot,production_date,expire_date,stock_qty,create_time,update_time,med_code,med_name)
58 values (
59 #{id,jdbcType=VARCHAR}
60 ,#{medSuppliercode,jdbcType=VARCHAR}
61 ,#{medSuppliername,jdbcType=VARCHAR}
62 ,#{storeCode,jdbcType=VARCHAR}
63 ,#{storeName,jdbcType=VARCHAR}
64 ,#{goodsCode,jdbcType=TIMESTAMP}
65 ,#{goodsSpec,jdbcType=VARCHAR}
66 ,#{goodsName,jdbcType=VARCHAR}
67 ,#{lot,jdbcType=VARCHAR}
68 ,#{productionDate,jdbcType=VARCHAR}
69 ,#{expireDate,jdbcType=DECIMAL}
70 ,#{stockQty,jdbcType=DECIMAL}
71 ,#{createTime,jdbcType=DECIMAL}
72 ,#{updateTime,jdbcType=TIMESTAMP}
73 ,#{medCode,jdbcType=VARCHAR}
74 ,#{medName,jdbcType=VARCHAR}
75 )
76 </insert>
77
78 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.spills.HisSpillsDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.spills.HisSpills">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_code" property="medCode" jdbcType="VARCHAR" />
10 <result column="med_name" property="medName" jdbcType="VARCHAR" />
11 <result column="depot_code" property="depotCode" jdbcType="VARCHAR" />
12 <result column="depot_name" property="depotName" jdbcType="VARCHAR" />
13 <result column="tack_stockdate" property="tackStockDate" jdbcType="TIMESTAMP" />
14 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
15 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
16 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
17 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
18 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
19 <result column="lot" property="lot" jdbcType="VARCHAR" />
20 <result column="unit" property="unit" jdbcType="VARCHAR" />
21 <result column="number" property="number" jdbcType="DECIMAL" />
22 <result column="storck_num" property="storckNum" jdbcType="DECIMAL" />
23 <result column="difference_num" property="differenceNum" jdbcType="DECIMAL" />
24 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
25 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
26 <result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
27 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
28 <result column="tackstock_billno" property="tackStockBillNo" jdbcType="VARCHAR" />
29 <result column="price" property="price" jdbcType="DECIMAL" />
30
31 </resultMap>
32
33 <!--Base_Column_List -->
34 <sql id="Base_Column_List">id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price</sql>
35
36 <!--批量插入 -->
37 <insert id="batchInsert" parameterType="list">
38 insert into med_hli_spills (id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price)
39 values
40 <foreach collection ="list" item="obj" separator =",">
41 <trim prefix=" (" suffix=")" suffixOverrides=",">
42 #{obj.id},
43 #{obj.medCode},
44 #{obj.medName},
45 #{obj.depotCode},
46 #{obj.depotName},
47 #{obj.tackStockDate},
48 #{obj.operaterName},
49 #{obj.goodsCode},
50 #{obj.goodsName},
51 #{obj.goodsSpec},
52 #{obj.manufacturer},
53 #{obj.lot},
54 #{obj.unit},
55 #{obj.number},
56 #{obj.storckNum},
57 #{obj.differenceNum},
58 #{obj.productionDate},
59 #{obj.expireDate},
60 #{obj.supplierCode},
61 #{obj.supplierName},
62 #{obj.tackStockBillNo},
63 #{obj.price}
64 </trim>
65 </foreach>
66 </insert>
67
68 <!-- 新增HisSpills-->
69 <insert id="insert" parameterType="com.phxl.modules.goods.entity.spills.HisSpills">
70 insert into med_hli_spills (id,med_code,med_name,depot_code,depot_name,tack_stockdate,operater_name,goods_code,goods_name,goods_spec,manufacturer,lot,unit,number,storck_num,difference_num,production_date,expire_date,supplier_code,supplier_name,tackstock_billno,price)
71 values (
72 #{id,jdbcType=VARCHAR}
73 ,#{medCode,jdbcType=VARCHAR}
74 ,#{medName,jdbcType=VARCHAR}
75 ,#{depotCode,jdbcType=VARCHAR}
76 ,#{depotName,jdbcType=VARCHAR}
77 ,#{tackStockDate,jdbcType=TIMESTAMP}
78 ,#{operaterName,jdbcType=VARCHAR}
79 ,#{goodsCode,jdbcType=VARCHAR}
80 ,#{goodsName,jdbcType=VARCHAR}
81 ,#{goodsSpec,jdbcType=VARCHAR}
82 ,#{manufacturer,jdbcType=VARCHAR}
83 ,#{lot,jdbcType=VARCHAR}
84 ,#{unit,jdbcType=VARCHAR}
85 ,#{number,jdbcType=DECIMAL}
86 ,#{storckNum,jdbcType=DECIMAL}
87 ,#{differenceNum,jdbcType=DECIMAL}
88 ,#{productionDate,jdbcType=TIMESTAMP}
89 ,#{expireDate,jdbcType=TIMESTAMP}
90 ,#{supplierCode,jdbcType=VARCHAR}
91 ,#{supplierName,jdbcType=VARCHAR}
92 ,#{tackStockBillNo,jdbcType=VARCHAR}
93 ,#{price,jdbcType=DECIMAL}
94 )
95 </insert>
96
97 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="row_no" property="rowNo" jdbcType="TINYINT" />
11 <result column="med_plan_no" property="medPlanNo" jdbcType="VARCHAR" />
12 <result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
13 <result column="goods_guid" property="goodsGuid" jdbcType="VARCHAR" />
14 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
15 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
16 <result column="unit" property="unit" jdbcType="VARCHAR" />
17 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
18 <result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
19 <result column="amount" property="amount" jdbcType="DECIMAL" />
20 <result column="lot" property="lot" jdbcType="VARCHAR" />
21 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
22 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
23 <result column="poqty" property="poqty" jdbcType="DECIMAL" />
24 <result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
25 <result column="memo" property="memo" jdbcType="VARCHAR" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,row_no,med_plan_no,med_plan_row_no,goods_guid,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,poqty,arrivalqty,memo</sql>
30
31 <!--批量插入MedPlanDetail -->
32 <insert id="batchInsert" parameterType="list">
33 insert into med_supplier_out_store_detail (id,bill_no,row_no,med_plan_no,med_plan_row_no,goods_guid,goods_name,goods_spec,unit,manufacturer,purchaser_price,amount,lot,production_date,expire_date,poqty,arrivalqty,memo)
34 values
35 <foreach collection ="list" item="obj" separator =",">
36 <trim prefix=" (" suffix=")" suffixOverrides=",">
37 #{obj.id},
38 #{obj.billNo},
39 #{obj.rowNo},
40 #{obj.medPlanNo},
41 #{obj.medPlanRowNo},
42 #{obj.goodsGuid},
43 #{obj.goodsName},
44 #{obj.goodsSpec},
45 #{obj.unit},
46 #{obj.manufacturer},
47 #{obj.purchaserPrice},
48 #{obj.amount},
49 #{obj.lot},
50 #{obj.productionDate},
51 #{obj.expireDate},
52 #{obj.poqty},
53 #{obj.arrivalqty},
54 #{obj.memo}
55 </trim>
56 </foreach>
57 </insert>
58
59
60 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="bill_no" property="billNo" jdbcType="VARCHAR" />
10 <result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
11 <result column="med_name" property="medName" jdbcType="VARCHAR" />
12 <result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
13 <result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
14 <result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
15 <result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
16 <result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
17 <result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
18 <result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
19 <result column="count_sum" property="countSum" jdbcType="TINYINT" />
20 <result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
21 <result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
22 <result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
23 <result column="memo" property="memo" jdbcType="VARCHAR" />
24 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
25 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
26 </resultMap>
27
28 <!--Base_Column_List -->
29 <sql id="Base_Column_List">id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time</sql>
30
31 <!-- 新增MedPlan-->
32 <insert id="insert" parameterType="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
33 insert into med_supplier_out_store (id,bill_no,med_guid,med_name,med_dept_guid,med_dept_name,med_store_guid,med_store_name,supplier_guid,supplier_name,bill_date,count_sum,detail_sum,operater_name,input_date,memo,create_time,update_time)
34 values (
35 #{id,jdbcType=VARCHAR}
36 ,#{billNo,jdbcType=VARCHAR}
37 ,#{medGuid,jdbcType=VARCHAR}
38 ,#{medName,jdbcType=VARCHAR}
39 ,#{medDeptGuid,jdbcType=VARCHAR}
40 ,#{medDeptName,jdbcType=VARCHAR}
41 ,#{medStoreGuid,jdbcType=VARCHAR}
42 ,#{medStoreName,jdbcType=VARCHAR}
43 ,#{supplierGuid,jdbcType=VARCHAR}
44 ,#{supplierName,jdbcType=VARCHAR}
45 ,#{billDate,jdbcType=TIMESTAMP}
46 ,#{countSum,jdbcType=TINYINT}
47 ,#{detailSum,jdbcType=DECIMAL}
48 ,#{operaterName,jdbcType=VARCHAR}
49 ,#{inputDate,jdbcType=TIMESTAMP}
50 ,#{memo,jdbcType=VARCHAR}
51 ,#{createTime,jdbcType=TIMESTAMP}
52 ,#{updateTime,jdbcType=TIMESTAMP}
53 )
54 </insert>
55
56 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.supplierstock.SupplierStockDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="supplier_code" property="suppliercode" jdbcType="VARCHAR" />
10 <result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
14 <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
15 <result column="lot" property="lot" jdbcType="VARCHAR" />
16 <result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
17 <result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
18 <result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
19 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
20 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
21 </resultMap>
22
23 <!--Base_Column_List -->
24 <sql id="Base_Column_List">id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time</sql>
25
26
27 <!--批量插入 -->
28 <insert id="batchInsert" parameterType="list">
29 insert into med_supplier_stock (id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time)
30 values
31 <foreach collection ="list" item="obj" separator =",">
32 <trim prefix=" (" suffix=")" suffixOverrides=",">
33 #{obj.id},
34 #{obj.suppliercode},
35 #{obj.suppliername},
36 #{obj.goodsCode},
37 #{obj.goodsName},
38 #{obj.goodsSpec},
39 #{obj.manufacturer},
40 #{obj.lot},
41 #{obj.productionDate},
42 #{obj.expireDate},
43 #{obj.stockQty},
44 #{obj.createTime},
45 #{obj.updateTime}
46 </trim>
47 </foreach>
48 </insert>
49 <!-- 新增SupplierStock-->
50 <insert id="insert" parameterType="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
51 insert into med_supplier_stock (id,supplier_code,supplier_name,goods_code,goods_name,goods_spec,manufacturer,lot,production_date,expire_date,stock_qty,create_time,update_time)
52 values (
53 #{id,jdbcType=VARCHAR}
54 ,#{suppliercode,jdbcType=VARCHAR}
55 ,#{suppliername,jdbcType=VARCHAR}
56 ,#{goodsCode,jdbcType=VARCHAR}
57 ,#{goodsName,jdbcType=VARCHAR}
58 ,#{goodsSpec,jdbcType=TIMESTAMP}
59 ,#{manufacturer,jdbcType=VARCHAR}
60 ,#{lot,jdbcType=VARCHAR}
61 ,#{productionDate,jdbcType=TIMESTAMP}
62 ,#{expireDate,jdbcType=TIMESTAMP}
63 ,#{stockQty,jdbcType=DECIMAL}
64 ,#{createTime,jdbcType=TIMESTAMP}
65 ,#{updateTime,jdbcType=TIMESTAMP}
66 )
67 </insert>
68
69 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao">
4
5 <!--BaseResultMap -->
6 <resultMap id="BaseResultMap"
7 type="com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods">
8 <id column="id" property="id" jdbcType="BIGINT" />
9 <result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
10 <result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
11 <result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
12 <result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
13 <result column="producer" property="producer" jdbcType="VARCHAR" />
14 <result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
15 <result column="unit_style" property="unitStyle" jdbcType="VARCHAR" />
16 <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
17 <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
18 <result column="price" property="price" jdbcType="DECIMAL" />
19 </resultMap>
20
21 <!--Base_Column_List -->
22 <sql id="Base_Column_List">id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price</sql>
23
24 <!--批量插入 -->
25 <insert id="batchInsert" parameterType="list">
26 insert into med_supply_catalog (id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price)
27 values
28 <foreach collection ="list" item="obj" separator =",">
29 <trim prefix=" (" suffix=")" suffixOverrides=",">
30 #{obj.id},
31 #{obj.medSuppliercode},
32 #{obj.medSuppliername},
33 #{obj.goodsCode},
34 #{obj.goodsName},
35 #{obj.producer},
36 #{obj.goodsSpec},
37 #{obj.unitStyle},
38 #{obj.createTime},
39 #{obj.updateTime},
40 #{obj.price}
41 </trim>
42 </foreach>
43 </insert>
44
45 </mapper>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
3 <configuration>
4
5
6 </configuration>
1 <beans xmlns="http://www.springframework.org/schema/beans"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
3 xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context"
4 xmlns:aop="http://www.springframework.org/schema/aop"
5 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
6 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
7 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
8 <!-- 定时器开关 -->
9 <task:annotation-driven />
10 <bean id="weChat" class="com.phxl.modules.wechat.utils.WeChatUtils"></bean>
11 <task:scheduled-tasks>
12 <!--
13 每隔5秒执行一次:*/5 * * * * ?
14 每隔1分钟执行一次:0 */1 * * * ?
15 每天23点执行一次:0 0 23 * * ?
16 每天凌晨1点执行一次:0 0 1 * * ?
17 每天凌晨2点执行一次:0 0 2 * * ?
18 -->
19 <task:scheduled ref="weChat" method="getAccessToken" cron="0 */118 * * * ?" />
20 </task:scheduled-tasks>
21 <context:component-scan base-package="com.phxl.modules" />
22
23
24
25
26
27 </beans>
28
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
4 xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
5 xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
6 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
7 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
8 http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
9 http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
10 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
11 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
12 http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
13 default-lazy-init="true">
14 <!-- 启用注解 -->
15 <context:component-scan base-package="com.phxl.modules" />
16
17 <!-- 引入属性文件 -->
18 <context:property-placeholder location="classpath:config.properties"/>
19
20
21 <!-- 配置数据源 -->
22 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
23 <property name="driverClassName" value="${jdbc.driver}" />
24 <property name="url" value="${jdbc.url}" />
25 <property name="username" value="${jdbc.username}"/>
26 <property name="password" value="${jdbc.password}"/>
27 </bean>
28
29 <!-- 配置sqlsessionFactory -->
30 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
31 <property name="dataSource" ref="dataSource"/>
32 <property name="configLocation" value="classpath:mybatis-config.xml"/>
33 <property name="mapperLocations">
34 <list>
35 <value>classpath:/mappings/**/*.xml</value>
36 </list>
37 </property>
38 </bean>
39
40 <!-- 扫描Mapper -->
41 <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
42 <property name="basePackage" value="com.phxl.modules"/>
43 </bean>
44
45 <!-- 配置事务管理器 -->
46 <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
47 <property name="dataSource" ref="dataSource"/>
48 </bean>
49
50 <!-- 缓存配置 -->
51 <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
52 <property name="cacheManagerConfigFile" value="classpath:${ehcache.configFile}" />
53 </bean>
54
55 <!-- 启用注解事务 -->
56 <tx:annotation-driven/>
57
58 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:util="http://www.springframework.org/schema/util"
6 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
7 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
8 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
9
10 <context:annotation-config />
11
12
13
14 <context:component-scan base-package="com.phxl.modules.goods.web.spd">
15 <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
16 </context:component-scan>
17
18 <util:properties id="config" location="classpath:config.properties"/>
19
20 </beans>
1 ALTER TABLE med_hli_plan ADD COLUMN settle_type VARCHAR(10) COMMENT '0:零库存 1:非零库存' AFTER bill_type;
...\ No newline at end of file ...\ No newline at end of file
1 ALTER TABLE med_bill_settlement ADD COLUMN use_bill_no LONGTEXT COMMENT '发药单号';
2 ALTER TABLE med_bill_settlement_detail DROP use_bill_no;
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:aop="http://www.springframework.org/schema/aop"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:mvc="http://www.springframework.org/schema/mvc"
6 xmlns:tx="http://www.springframework.org/schema/tx"
7 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8 xsi:schemaLocation="http://www.springframework.org/schema/aop
9 http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
10 http://www.springframework.org/schema/beans
11 http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
12 http://www.springframework.org/schema/context
13 http://www.springframework.org/schema/context/spring-context-4.1.xsd
14 http://www.springframework.org/schema/mvc
15 http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
16 http://www.springframework.org/schema/tx
17 http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
18
19 <mvc:annotation-driven>
20 <mvc:message-converters register-defaults="true">
21 <bean class="org.springframework.http.converter.StringHttpMessageConverter">
22 <constructor-arg value="UTF-8" />
23 </bean>
24 </mvc:message-converters>
25 </mvc:annotation-driven>
26
27 <mvc:default-servlet-handler/>
28 <context:component-scan base-package="com.phxl.*" />
29
30
31
32 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
33 <property name="prefix" value="/WEB-INF/views/" />
34 <property name="suffix" value=".jsp" />
35 </bean>
36
37 <bean id="multipartResolver"
38 class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
39 <!--设置最大上传文件501M-->
40 <property name="maxUploadSize" value="525336576"/>
41
42 <property name="resolveLazily" value="true"/>
43 </bean>
44
45
46
47
48 <!-- 处理JSON数据转换的 -->
49 <bean id="mappingJacksonHttpMessageConverter"
50 class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
51 <property name="supportedMediaTypes">
52 <list>
53 <value>text/html;charset=UTF-8</value>
54 <value>text/xml;charset=UTF-8</value>
55 <value>application/xml;charset=UTF-8</value>
56 </list>
57 </property>
58 </bean>
59
60
61
62
63 <!-- SpringMVC在超出上传文件限制时,会抛出org.springframework.web.multipart.MaxUploadSizeExceededException -->
64 <!-- 该异常是SpringMVC在检查上传的文件信息时抛出来的,而且此时还没有进入到Controller方法中 -->
65 <!-- <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
66 <property name="exceptionMappings">
67 <props>
68 遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面
69 <prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">error</prop>
70 </props>
71 </property>
72 </bean> -->
73 </beans>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>送货单打印(普通A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}送货单</h3></td>
13 <td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">供应商:${fOrgName}</td>
17 <td width="25%" height="30">订单号:${orderNo}</td>
18 <td width="25%" height="30">送货单号:${sendNo}</td>
19 <!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
20 </tr>
21 <tr>
22 <td height="30">制单人:${sendUsername}</td>
23 <td height="30" colspan="2">制单时间:${sendDate}</td>
24 </tr>
25 <tr>
26 <td height="30" >收货科室:${deptName}</td>
27 <td height="30" colspan="2">收货地址:${tfAddress}</td>
28 </tr>
29 <tr>
30
31 </tr>
32 </table>
33 </div>
34 <div>
35 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
36 <tr style="height: 25px;">
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
42 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
43 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
44 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
45 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80;">有效期至</td>
46 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
47 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
48 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;" width="80">金额</td>
49 </tr>
50 ${tableContent}
51 </table>
52 </div>
53 <div>
54 ${afterTable
55 <table width="100%" border="0" cellspacing="0" cellpadding="0">
56 <tr height="35px;">
57 <td width="30%" align="left">验收人:</td>
58 <td width="30%" align="left">收货人:</td>
59 <td width="20%" align="left">总金额:${totalPrice}</td>
60 </tr>
61 </table>
62 }
63 </div>
64 </div>
65 </body>
66 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>入库单打印(三联单)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}验收入库单</h3></td>
13 </tr>
14 </table>
15 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
16 <tr>
17 <td width="21%" height="15">供应商:${forgName}</td>
18 <td width="17%" height="15">入库日期:${inTime}</td>
19 <td width="26%" height="15">入库单号:${InNo}</td>
20 </tr>
21 <tr>
22 <td width="21%" height="15">发票号:${invoiceNo}</td>
23 <td width="17%" height="15">送货单号:${Send_Id}</td>
24 <td width="26%" height="15">单位:元</td>
25 </tr>
26 <tr>
27
28 </tr>
29 </table>
30 </div>
31 <div>
32 <table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
33 <tr style="height: 18px;">
34 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
35 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
36 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-right:1px solid #000000;border-top:1px solid #000000;" width="130">财务分类</td>
42 </tr>
43 ${tableContent}
44 </table>
45 </div>
46 <div>
47 ${afterTable
48 <table width="100%" border="0" cellspacing="0" cellpadding="0">
49 <tr height="20px;">
50 <td width="25%" align="left"></td>
51 <td width="25%" align="left"></td>
52 <td width="21%" align="left"></td>
53 <td width="28%" align="left">合计金额:${totalPrice}</td>
54 </tr>
55 <tr height="20px;">
56 <td width="25%" align="left">制单人:${userName}</td>
57 <td width="25%" align="left">会计:</td>
58 <td width="21%" align="left">审核人:</td>
59 <td width="28%" align="left">备注:</td>
60 </tr>
61 </table>
62 }
63 </div>
64 </div>
65 </body>
66 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>出库单打印(三联单)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}物资出库单</h3></td>
13 </tr>
14 </table>
15 <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
16 <tr>
17 <td width="21%" height="15">领用科室:${deptName}</td>
18 <td width="17%" height="15">出库日期:${outTime}</td>
19 <td width="27%" height="15">出库单号:${outNo}</td>
20 </tr>
21 <tr>
22 <td width="21%" height="15">拣货单号:${pickNo}</td>
23 <td width="17%" height="15">送货单号:${sendNo}</td>
24 <td width="27%" height="15">单位:元</td>
25 </tr>
26 <tr>
27
28 </tr>
29 </table>
30 </div>
31 <div>
32 <table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
33 <tr style="height: 18px;">
34 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
35 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
36 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-right:1px solid #000000;border-top:1px solid #000000;" width="130">财务分类</td>
42 </tr>
43 ${tableContent}
44 </table>
45 </div>
46 <div>
47 ${afterTable
48 <table width="100%" border="0" cellspacing="0" cellpadding="0">
49 <tr height="20px;">
50 <td width="25%" align="left"></td>
51 <td width="25%" align="left"></td>
52 <td width="21%" align="left"></td>
53 <td width="28%" align="left">合计金额:${totalPrice}</td>
54 </tr>
55 <tr height="20px;">
56 <td width="25%" align="left">制单人:${userName}</td>
57 <td width="25%" align="left">会计:</td>
58 <td width="21%" align="left">保管:</td>
59 <td width="28%" align="left">经办人:</td>
60 </tr>
61 </table>
62 }
63 </div>
64 </div>
65 </body>
66 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>送货单打印(普通A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}设备送货单</h3></td>
13 <td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">供应商:${fOrgName}</td>
17 <td width="25%" height="30">送货单号:${sendNo}</td>
18 <!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
19 </tr>
20 <tr>
21 <td height="30">制单人:${sendUserName}</td>
22 <td height="30" colspan="2">制单时间:${sendDate}</td>
23 </tr>
24 <tr>
25 <td height="30" >收货科室:${tDeptName}</td>
26 <td height="30" colspan="2">收货地址:${tfAddress}</td>
27 </tr>
28 <tr>
29
30 </tr>
31 </table>
32 </div>
33 <div>
34 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
35 <tr style="height: 25px;">
36 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
37 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
38 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
39 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
40 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
42 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
43 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;" width="80">金额</td>
44 </tr>
45 ${tableContent}
46 </table>
47 </div>
48 <div>
49 ${afterTable
50 <table width="100%" border="0" cellspacing="0" cellpadding="0">
51 <tr height="35px;">
52 <td width="30%" align="left">验收人:</td>
53 <td width="30%" align="left">收货人:</td>
54 <td width="20%" align="left">总金额:${totalPrice}</td>
55 </tr>
56 </table>
57 }
58 </div>
59 </div>
60 </body>
61 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>送货单打印(手术A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${fOrgName}医用耗材送货单</h3></td>
13 <td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">送货单号:${sendNo}</td>
17 <td width="25%" height="30">订单号:${orderNo}</td>
18 <td width="25%" height="30">医疗机构:${rOrgName}</td>
19 </tr>
20 <tr>
21 <td height="30" colspan="2">收货地址:${tfAddress}</td>
22 <td height="30" >期望到货时间:${expectDate}</td>
23 </tr>
24 <tr>
25 <td height="30">制单人:${sendUsername}</td>
26 <td height="30" colspan="2">制单时间:${sendDate}</td>
27 </tr>
28 <tr>
29
30 </tr>
31 </table>
32 <table width="100%" border="0" cellspacing="0" cellpadding="0">
33 <tr><td height="30" colspan='4'><hr width='100%' color='#65a6be' /></td></tr>
34 <tr>
35 <td width="25%" height="30">就诊号:${treatmentNo}</td>
36 <td width="25%" height="30">患者姓名:${name}</td>
37 <td width="25%" height="30">性别:${gender}</td>
38 <td width="25%" height="30">年龄:${age}</td>
39 </tr>
40 <tr>
41 <td width="25%" height="30">手术名称:${operName}</td>
42 <td width="25%" height="30">手术日期:${operDate}</td>
43 <td width="25%" height="30">品牌:${tfBrand}</td>
44 <td width="25%" height="30">备注:${tfRemark}</td>
45 </tr>
46 </table>
47 </div>
48 <div>
49 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
50 ${tableContent}
51 </table>
52 </div>
53 <div>
54 ${afterTable
55 <table width="100%" border="0" cellspacing="0" cellpadding="0">
56 <tr height="35px;">
57 <td width="20%" align="left">验收人:</td>
58 <td width="20%" align="left">收货人:</td>
59 <td width="15%" align="left">产品总数量:${materailAmount}</td>
60 <td width="15%" align="left">外来植入物总数量:${outerImpAmount}</td>
61 <td width="15%" align="left">灭菌总数量:${sterilizeAmount}</td>
62 <td width="15%" align="left">工具总数量:${toolAmount}</td>
63 </tr>
64 </table>
65 }
66 </div>
67 </div>
68 </body>
69 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
6 <title>二维码模板页面</title>
7 </head>
8 <body>
9 <div style="width: 265px;height: 130px; margin: 0px auto;">
10 <div style="text-align:center;font-size: 12px;font-family:宋体,SimSun;font-weight:900;"><span>
11 ${title}
12 </span></div>
13
14 <div style="font-size: 9px;">
15 <table border="0" cellspacing="0" cellpadding="0" style="margin-top:4px;">
16 <tr>
17 <td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">名称:</td>
18 <td valign="top" style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="106" height="15px">${materialName}</td>
19 <td style="text-align: center;" width="106" rowspan="6" >
20 ${qrImage}
21 <div style="width:106px;"><span style="width:100%;font-size:10px;font-family:宋体,SimSun;font-weight:900;">${qrcode}</span></div>
22 </td>
23 </tr>
24 <tr>
25 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">型号:</td>
26 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${fmodel}</td>
27 </tr>
28 <tr>
29 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">规格:</td>
30 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${spec}</td>
31 </tr>
32 <tr>
33 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">批号:</td>
34 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${flot}</td>
35 </tr>
36 <tr>
37 <td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">效期:</td>
38 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${prodDate}-${usefulDate}</td>
39 </tr>
40 <tr>
41 <td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">注册证:</td>
42 <td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${registerNo}</td>
43 </tr>
44 </table>
45 </div>
46 </div>
47
48
49 </body>
50 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
6 <title>微信绑定页面</title>
7 </head>
8 <body>
9 <div style="width: 240px;">
10 <div style="height: 240px;width: 240px;">
11 ${qrImage}
12 </div>
13 </div>
14
15 </body>
16 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>使用登记明细打印(普通A4)</title>
6 </head>
7 <body>
8 <div>
9 <div>
10 <table width="100%" border="0" cellspacing="0" cellpadding="0">
11 <tr>
12 <td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${jgName}</h3></td>
13 <td width="12%" height="30" rowspan="4">${qrImage}</td>
14 </tr>
15 <tr>
16 <td width="25%" height="30">使用清单号:${useNo}</td>
17 <td width="25%" height="30">送货单号:${sendNo}</td>
18 <td width="25%" height="30">供应商:${fOrgName}</td>
19 <td></td>
20 </tr>
21 <tr>
22 <td width="25%" height="30">登记科室:${deptName}</td>
23 <td width="25%" height="30">登记人:${createUserName}</td>
24 <td width="25%" height="30">登记时间:${createTime}</td>
25 <td></td>
26 </tr>
27 <tr>
28 <td width="25%" height="30">就诊号:${treatmentNo}</td>
29 <td width="25%" height="30">患者姓名:${hzName}</td>
30 <td width="25%" height="30">手术名称:${operName}</td>
31 <td></td>
32 </tr>
33 <tr>
34
35 </tr>
36 </table>
37 </div>
38 <div>
39 <table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
40 <tr style="height: 25px;">
41 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
42 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
43 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
44 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
45 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
46 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
47 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">价格</td>
48 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
49 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">金额</td>
50 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
51 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
52 <td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;" width="80;">有效期至</td>
53 </tr>
54 ${tableContent}
55 </table>
56 </div>
57 <div>
58 ${afterTable
59 <table width="80%" border="0" cellspacing="0" cellpadding="0">
60 <tr height="35px;">
61 <td width="30%" align="left">医生签字:</td>
62 <td width="20%" align="right">总金额:${zje}</td>
63 </tr>
64 </table>
65 }
66 </div>
67 </div>
68 </body>
69 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <%-- <%@ page contentType="text/html;charset=UTF-8"%>
2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 <%
4 String path = request.getContextPath();
5 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
6 %>
7 <html>
8 <head>
9 <script type="text/javascript" src="<%=basePath%>js/jquery.js" charset="utf-8"></script>
10 <style>
11 html,body{text-align:center;margin:0px auto;}
12 </style>
13
14
15 <script type="text/javascript">
16 $(document).ready(function() {
17
18 $("#select").change(function(){
19 var value = $('#select option:selected') .val();
20 debugger;
21 if(value == '0'){
22 $("#form").attr('action','<%=basePath%>oss/uploadImage');
23 }else if(value == '1'){
24 $("#form").attr('action','<%=basePath%>oss/uploadHeadImage');
25 }else if(value == '2'){
26 $("#form").attr('action','<%=basePath%>oss/uploadAudio');
27 }else if(value == '3'){
28 $("#form").attr('action','<%=basePath%>oss/uploadVideo');
29 }
30 });
31 });
32 </script>
33 </head>
34 <body>
35
36 <div style="width:auto;height:20;margin-left:auto;margin-left:auto;">
37 ${msg}
38 </div>
39
40 <form name="form" id="form" aligin="ceter" action="<%=basePath%>oss/uploadImage" enctype="multipart/form-data" method="post"">
41
42 <div id="newUpload2">
43 <select id="select">
44 <option value ="0">图片</option>
45 <option value ="1">头像</option>
46 <option value="2">音频</option>
47 <option value="3">视频</option>
48 </select>
49 <input type="file" name="fileUpload">
50 </div>
51 <input type="submit" value="上传" >
52 </form>
53
54
55
56 </body>
57 </html> --%>
58
59
60 <%@ page contentType="text/html;charset=UTF-8"%>
61 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
62 <%
63 String path = request.getContextPath();
64 String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
65 + path + "/";
66 %>
67 <html>
68 <head>
69 <script type="text/javascript" src="<%=basePath%>js/jquery.js"
70 charset="utf-8"></script>
71 <title>搜索词自动完成</title>
72 <style type="text/css">
73 #search {
74 text-align: center;
75 position: relative;
76 }
77
78 .autocomplete {
79 border: 1px solid #9ACCFB;
80 background-color: white;
81 text-align: left;
82 }
83
84 .autocomplete li {
85 list-style-type: none;
86 }
87
88 .clickable {
89 cursor: default;
90 }
91
92 .highlight {
93 background-color: #9ACCFB;
94 }
95
96
97 </style>
98
99 <script type="text/javascript">
100
101 $(document).ready(function(){
102 sendxml();
103 });
104
105 function sendxml(){
106 var xmlData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><name>王森勇</name><author>tiger</author></book>";
107
108
109 var url = "<%=basePath%>bookInfo/sendxml";
110
111 $.ajax({
112 type: 'POST',
113 url: url ,
114 data: xmlData ,
115 dataType:"xml",
116
117 'success': function (data) {
118 alert(data);
119 } ,
120 'error': function (reslut) {
121 alert(reslut);
122 },
123 contentType:"application/xml"
124 });
125
126 }
127
128
129 $(function(){
130 //取得div层
131 var $search = $('#search');
132 //取得输入框JQuery对象
133 var $searchInput = $search.find('#search-text');
134 //关闭浏览器提供给输入框的自动完成
135 $searchInput.attr('autocomplete','off');
136 //创建自动完成的下拉列表,用于显示服务器返回的数据,插入在搜索按钮的后面,等显示的时候再调整位置
137 var $autocomplete = $('<div class="autocomplete"></div>').hide().insertAfter('#submit');
138 //清空下拉列表的内容并且隐藏下拉列表区
139 var clear = function(){
140 $autocomplete.empty().hide();
141 };
142 //注册事件,当输入框失去焦点的时候清空下拉列表并隐藏
143 $searchInput.blur(function(){
144 setTimeout(clear,500);
145 });
146 //下拉列表中高亮的项目的索引,当显示下拉列表项的时候,移动鼠标或者键盘的上下键就会移动高亮的项目,想百度搜索那样
147 var selectedItem = null;
148 //timeout的ID
149 var timeoutid = null;
150 //设置下拉项的高亮背景
151 var setSelectedItem = function(item){
152 //更新索引变量
153 selectedItem = item ;
154 //按上下键是循环显示的,小于0就置成最大的值,大于最大值就置成0
155 if(selectedItem < 0){
156 selectedItem = $autocomplete.find('li').length - 1;
157 }
158 else if(selectedItem > $autocomplete.find('li').length-1 ) {
159 selectedItem = 0;
160 }
161 //首先移除其他列表项的高亮背景,然后再高亮当前索引的背景
162 $autocomplete.find('li').removeClass('highlight')
163 .eq(selectedItem).addClass('highlight');
164 };
165 var ajax_request = function(){
166 //ajax服务端通信
167 $.ajax({
168 'url':'<%=basePath%>oss/datas', //服务器的地址
169 'data' : {
170 'search-text' : $searchInput.val()
171 }, //参数
172 'dataType' : 'json', //返回数据类型
173 'type' : 'POST', //请求类型
174 'success' : function(data) {
175 if (data.length) {
176 $autocomplete.empty();
177 //遍历data,添加到自动完成区
178 $.each(data, function(index, term) {
179 //创建li标签,添加到下拉列表中
180 $('<li></li>').text(term).appendTo($autocomplete)
181 .addClass('clickable').hover(
182 function() {
183 //下拉列表每一项的事件,鼠标移进去的操作
184 $(this).siblings().removeClass(
185 'highlight');
186 $(this).addClass('highlight');
187 selectedItem = index;
188 },
189 function() {
190 //下拉列表每一项的事件,鼠标离开的操作
191 $(this).removeClass('highlight');
192 //当鼠标离开时索引置-1,当作标记
193 selectedItem = -1;
194 }).click(function() {
195 //鼠标单击下拉列表的这一项的话,就将这一项的值添加到输入框中
196 $searchInput.val(term);
197 //清空并隐藏下拉列表
198 $autocomplete.empty().hide();
199 });
200 });//事件注册完毕
201 //设置下拉列表的位置,然后显示下拉列表
202 var ypos = $searchInput.position().top;
203 var xpos = $searchInput.position().left;
204 $autocomplete.css('width', );
205 $autocomplete.css({
206 'position' : 'relative',
207 'left' : xpos + "px",
208 'top' : ypos + "px"
209 });
210 setSelectedItem(0);
211 //显示下拉列表
212 $autocomplete.show();
213 }
214 }
215 });
216 };
217 //对输入框进行事件注册
218 $searchInput
219 .keyup(
220 function(event) {
221 //字母数字,退格,空格
222 if (event.keyCode > 40 || event.keyCode == 8
223 || event.keyCode == 32) {
224 //首先删除下拉列表中的信息
225 $autocomplete.empty().hide();
226 clearTimeout(timeoutid);
227 timeoutid = setTimeout(ajax_request, 100);
228 } else if (event.keyCode == 38) {
229 //上
230 //selectedItem = -1 代表鼠标离开
231 if (selectedItem == -1) {
232 setSelectedItem($autocomplete.find('li').length - 1);
233 } else {
234 //索引减1
235 setSelectedItem(selectedItem - 1);
236 }
237 event.preventDefault();
238 } else if (event.keyCode == 40) {
239 //下
240 //selectedItem = -1 代表鼠标离开
241 if (selectedItem == -1) {
242 setSelectedItem(0);
243 } else {
244 //索引加1
245 setSelectedItem(selectedItem + 1);
246 }
247 event.preventDefault();
248 }
249 }).keypress(
250 function(event) {
251 //enter键
252 if (event.keyCode == 13) {
253 //列表为空或者鼠标离开导致当前没有索引值
254 if ($autocomplete.find('li').length == 0
255 || selectedItem == -1) {
256 return;
257 }
258 $searchInput.val($autocomplete.find('li').eq(
259 selectedItem).text());
260 $autocomplete.empty().hide();
261 event.preventDefault();
262 }
263 }).keydown(function(event) {
264 //esc键
265 if (event.keyCode == 27) {
266 $autocomplete.empty().hide();
267 event.preventDefault();
268 }
269 });
270 //注册窗口大小改变的事件,重新调整下拉列表的位置
271 $(window).resize(function() {
272 var ypos = $searchInput.position().top;
273 var xpos = $searchInput.position().left;
274 $autocomplete.css('width', $searchInput.css('width'));
275 $autocomplete.css({
276 'position' : 'relative',
277 'left' : xpos+2 + "px",
278 'top' : ypos + "px"
279 });
280 });
281 });
282
283
284 function fileUpload() {
285 var fileName = $("#upfile").val();
286 if (fileName == null || fileName == "") {
287 alert("请选择文件");
288 } else {
289 debugger;
290 var fileType = fileName
291 .substr(fileName.length - 4, fileName.length);
292 if (fileType == ".xls" || fileType == "xlsx") {
293
294 var formData = new FormData();
295 formData.append("file", $("#upfile").prop("files")[0]);
296 $.ajax({
297 type : "post",
298 url : "<%=basePath%>exports/inLeadExcel",
299 data : formData,
300 cache : false,
301 processData : false,
302 contentType : false,
303 dataType : 'json', //返回数据类型
304 success : function(data) {
305 alert(data);
306 }
307 })
308 } else {
309 alert("导入文件类型错误!");
310 }
311 }
312 }
313
314 </script>
315 </head>
316 <body>
317 <div id="search">
318 <label for="search-text">请输入关键词</label><input type="text"
319 id="search-text" name="search-text" /> <input type="button"
320 id="submit" value="搜索" />
321
322 <a href="<%=basePath%>exports/printDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF" target="_blank"><button type="button" class="ant-btn ant-btn-primary"><span>打 印</span></button></a>
323 <a href="<%=basePath%>exports/exportDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF"><button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;"><span>导 出</span></button></a>
324 <button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;" onclick="$('#upfile').click();"><span>导 入</span></button>
325 <input type="file" class="file_input" id="upfile" onchange="fileUpload();" title=" " style="display:none">
326 </div>
327 </body>
328 </html>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
6 version="2.5" >
7
8 <!-- 区分项目名称,防止默认重名 -->
9 <context-param>
10 <param-name>webAppRootKey</param-name>
11 <param-value>maven.example.root</param-value>
12 </context-param>
13
14 <!-- 设置Spring容器加载配置文件路径 -->
15 <context-param>
16 <param-name>contextConfigLocation</param-name>
17 <param-value>classpath*:spring/app*.xml</param-value>
18 </context-param>
19
20 <!-- Spring的log4j监听器 -->
21 <!-- <listener>
22 <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
23 </listener>-->
24
25
26 <!-- spring监听器 -->
27 <listener>
28 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
29 </listener>
30 <!-- Spring 刷新Introspector防止内存泄露 -->
31 <listener>
32 <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
33 </listener>
34
35
36 <listener>
37 <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
38 </listener>
39
40 <!-- filter -->
41 <filter>
42 <filter-name>encodingFilter</filter-name>
43 <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
44 <init-param>
45 <param-name>encoding</param-name>
46 <param-value>utf-8</param-value>
47 </init-param>
48 <init-param>
49 <param-name>forceEncoding</param-name>
50 <param-value>true</param-value>
51 </init-param>
52 </filter>
53 <filter-mapping>
54 <filter-name>encodingFilter</filter-name>
55 <url-pattern>/*</url-pattern>
56 </filter-mapping>
57
58
59 <!-- Spring view分发器 -->
60 <servlet>
61 <servlet-name>dispatcher</servlet-name>
62 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
63 <init-param>
64 <param-name>contextConfigLocation</param-name>
65 <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
66 </init-param>
67 <load-on-startup>1</load-on-startup>
68 </servlet>
69
70 <servlet-mapping>
71 <servlet-name>dispatcher</servlet-name>
72 <url-pattern>/</url-pattern>
73 </servlet-mapping>
74
75
76
77
78
79
80 <welcome-file-list>
81 <welcome-file>/WEB-INF/views/index.jsp</welcome-file>
82 </welcome-file-list>
83
84 </web-app>
1 // JavaScript Document
2 jQuery.extend({
3
4 createUploadIframe: function(id, uri)
5 {
6 //create frame
7 var frameId = 'jUploadFrame' + id;
8
9 if(window.ActiveXObject) {
10 var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
11 if(typeof uri== 'boolean'){
12 io.src = 'javascript:false';
13 }
14 else if(typeof uri== 'string'){
15 io.src = uri;
16 }
17 }
18 else {
19 var io = document.createElement('iframe');
20 io.id = frameId;
21 io.name = frameId;
22 }
23 io.style.position = 'absolute';
24 io.style.top = '-1000px';
25 io.style.left = '-1000px';
26
27 document.body.appendChild(io);
28
29 return io;
30 },
31 createUploadForm: function(id, fileElementId)
32 {
33 //create form
34 var formId = 'jUploadForm' + id;
35 var fileId = 'jUploadFile' + id;
36 var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
37 var oldElement = jQuery('#' + fileElementId);
38 var newElement = jQuery(oldElement).clone();
39 jQuery(oldElement).attr('id', fileId);
40 jQuery(oldElement).before(newElement);
41 jQuery(oldElement).appendTo(form);
42 //set attributes
43 jQuery(form).css('position', 'absolute');
44 jQuery(form).css('top', '-1200px');
45 jQuery(form).css('left', '-1200px');
46 jQuery(form).appendTo('body');
47 return form;
48 },
49
50 ajaxFileUpload: function(s) {
51 // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
52 s = jQuery.extend({}, jQuery.ajaxSettings, s);
53 var id = s.fileElementId;
54 var form = jQuery.createUploadForm(id, s.fileElementId);
55 var io = jQuery.createUploadIframe(id, s.secureuri);
56 var frameId = 'jUploadFrame' + id;
57 var formId = 'jUploadForm' + id;
58
59 if( s.global && ! jQuery.active++ )
60 {
61 // Watch for a new set of requests
62 jQuery.event.trigger( "ajaxStart" );
63 }
64 var requestDone = false;
65 // Create the request object
66 var xml = {};
67 if( s.global )
68 {
69 jQuery.event.trigger("ajaxSend", [xml, s]);
70 }
71
72 var uploadCallback = function(isTimeout)
73 {
74 // Wait for a response to come back
75 var io = document.getElementById(frameId);
76 try
77 {
78 if(io.contentWindow)
79 {
80 xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
81 xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
82
83 }else if(io.contentDocument)
84 {
85 xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
86 xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
87 }
88 }catch(e)
89 {
90 jQuery.handleError(s, xml, null, e);
91 }
92 if( xml || isTimeout == "timeout")
93 {
94 requestDone = true;
95 var status;
96 try {
97 status = isTimeout != "timeout" ? "success" : "error";
98 // Make sure that the request was successful or notmodified
99 if( status != "error" )
100 {
101 // process the data (runs the xml through httpData regardless of callback)
102 var data = jQuery.uploadHttpData( xml, s.dataType );
103 if( s.success )
104 {
105 // ifa local callback was specified, fire it and pass it the data
106 s.success( data, status );
107 };
108 if( s.global )
109 {
110 // Fire the global callback
111 jQuery.event.trigger( "ajaxSuccess", [xml, s] );
112 };
113 } else
114 {
115 jQuery.handleError(s, xml, status);
116 }
117
118 } catch(e)
119 {
120 status = "error";
121 jQuery.handleError(s, xml, status, e);
122 };
123 if( s.global )
124 {
125 // The request was completed
126 jQuery.event.trigger( "ajaxComplete", [xml, s] );
127 };
128
129
130 // Handle the global AJAX counter
131 if(s.global && ! --jQuery.active)
132 {
133 jQuery.event.trigger("ajaxStop");
134 };
135 if(s.complete)
136 {
137 s.complete(xml, status);
138 } ;
139
140 jQuery(io).unbind();
141
142 setTimeout(function()
143 { try
144 {
145 jQuery(io).remove();
146 jQuery(form).remove();
147
148 } catch(e)
149 {
150 jQuery.handleError(s, xml, null, e);
151 }
152
153 }, 100);
154
155 xml = null;
156
157 };
158 }
159 // Timeout checker
160 if( s.timeout > 0 )
161 {
162 setTimeout(function(){
163
164 if( !requestDone )
165 {
166 // Check to see ifthe request is still happening
167 uploadCallback( "timeout" );
168 }
169
170 }, s.timeout);
171 }
172 try
173 {
174 var form = jQuery('#' + formId);
175 jQuery(form).attr('action', s.url);
176 jQuery(form).attr('method', 'POST');
177 jQuery(form).attr('target', frameId);
178 if(form.encoding)
179 {
180 form.encoding = 'multipart/form-data';
181 }
182 else
183 {
184 form.enctype = 'multipart/form-data';
185 }
186 jQuery(form).submit();
187
188 } catch(e)
189 {
190 jQuery.handleError(s, xml, null, e);
191 }
192 if(window.attachEvent){
193 document.getElementById(frameId).attachEvent('onload', uploadCallback);
194 }
195 else{
196 document.getElementById(frameId).addEventListener('load', uploadCallback, false);
197 }
198 return {abort: function () {}};
199
200 },
201
202
203 handleError: function( s, xhr, status, e ) {
204 // If a local callback was specified, fire it
205 if ( s.error ) {
206 s.error.call( s.context || s, xhr, status, e );
207 }
208
209 // Fire the global callback
210 if ( s.global ) {
211 (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
212 }
213 },
214
215 uploadHttpData: function( r, type ) {
216 var data = !type;
217 data = type == "xml" || data ? r.responseXML : r.responseText;
218 // ifthe type is "script", eval it in global context
219 if( type == "script" )
220 {
221 jQuery.globalEval( data );
222 }
223
224 // Get the JavaScript object, ifJSON is used.
225 if( type == "json" )
226 {
227 eval( "data = " + data );
228 }
229
230 // evaluate scripts within html
231 if( type == "html" )
232 {
233 jQuery("<div>").html(data).evalScripts();
234 }
235
236 return data;
237 }
238 });
239
240
This diff could not be displayed because it is too large.
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!