8ffc3d11 by Quilan

删除部分

1 parent de191d42
Showing 549 changed files with 0 additions and 24319 deletions
package com.phxl.modules.goods.entity.supplierstock;
import java.math.BigDecimal;
import java.util.Date;
/**
* 供应商库存信息
*/
public class SupplierStock{
private String suppliercode; //供应商代码
private String suppliername; //供应商名称
private String goodsCode; //商品编码
private String goodsName; //商品名称
private String goodsSpec; //商品规格
private String manufacturer; //生产厂商
private String lot; //批号
private Date productionDate; //生产日期
private Date expireDate; //有效期至
private BigDecimal stockQty; //库存数量
private Date createTime; //创建时间
private Date updateTime; //更新时间
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSuppliercode() {
return suppliercode;
}
public void setSuppliercode(String suppliercode) {
this.suppliercode = suppliercode;
}
public String getSuppliername() {
return suppliername;
}
public void setSuppliername(String suppliername) {
this.suppliername = suppliername;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
public BigDecimal getStockQty() {
return stockQty;
}
public void setStockQty(BigDecimal stockQty) {
this.stockQty = stockQty;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
package com.phxl.common.response;
import com.alibaba.fastjson.annotation.JSONField;
public class PlatFormResponse{
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
/**
* 平台接口返回状态码
*/
@JSONField(name="FLAG")
private String flag;
/**
* 平台接口返回信息
*/
@JSONField(name="MSG")
private String msg;
}
package com.phxl.modules.goods.service.interfaceLog;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao;
import com.phxl.modules.goods.entity.interfaceLog.InterfaceLog;
@Service
public class InterfaceLogService {
@Autowired
private InterfaceLogDao interfaceLogDao;
public void saveLog(String method, String params, String id){
InterfaceLog interfaceLog = new InterfaceLog();
interfaceLog.setId(id);
interfaceLog.setRequestMethod(method);
interfaceLog.setRequestTime(new Date());
interfaceLog.setRequestParam(params);
interfaceLogDao.insert(interfaceLog);
}
public void setResultLog(PlatFormResponse hisResponse, String id, String exception){
InterfaceLog interfaceLog = new InterfaceLog();
interfaceLog.setId(id);
interfaceLog.setResultCode(hisResponse.getFlag());
interfaceLog.setResultContent(hisResponse.getMsg());
if(exception != null){
interfaceLog.setException(exception);
}
interfaceLogDao.update(interfaceLog);
}
}
package com.phxl.modules.goods.web.spd;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.phxl.common.constants.PlatformConstant;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
import com.phxl.common.util.HTTPClient;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
import com.phxl.modules.goods.service.billback.BillBackService;
import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
import com.phxl.modules.goods.service.medinstore.MedInStoreService;
import com.phxl.modules.goods.service.medplan.MedPlanService;
import com.phxl.modules.goods.service.medstock.MedStockService;
import com.phxl.modules.goods.service.spills.HisSpillsService;
import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
@Controller
@RequestMapping(value = "/Api")
public class SpdControlller {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HisCtMedicineMaterialService ctMedicineMaterialService;
@Autowired
private InterfaceLogService interfaceLogService;
@Autowired
private HisCtDeptService hisCtDeptService;
@Autowired
private CTCareProvService cTCareProvService;
@Autowired
private MedSupplyGoodsService supplyGoodsService;
@Autowired
private MedStockService stockService;
@Autowired
private MedPlanService medPlanService;
@Autowired
private MedInStoreService medInStoreService;
@Autowired
private BillBackService backService;
@Autowired
private BillSettlementService billSettlementService;
@Autowired
private SupplierStockService supplierStockService;
@Autowired
private SuOutStoreService suOutStoreService;
@Autowired
private HisSpillsService hisSpillsService;
@Autowired
private SuInvoiceBackService suInvoiceBackService;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
logger.debug("药品目录接口请求参数:{}",medgoodsList);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
try {
materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
}
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
result = JSON.toJSONString(response);
//medgoodsList = ctMedicineMaterialService.createRequest();
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
@RequestMapping(value="/setHDept")
@ResponseBody
public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院科室资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtDept> depts = new ArrayList<HisCtDept>();
try {
depts = JSONObject.parseArray(params, HisCtDept.class);
int end = hisCtDeptService.batchSaveOrUpdate(depts);
if(end==1){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院人员资料接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedStaff")
@ResponseBody
public String setMedStaff(HttpServletRequest request, @RequestBody String params){
logger.debug("医院人员资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
boolean end = false;
try {
careProvs = JSONObject.parseArray(params, CTCareProv.class);
end = cTCareProvService.batchSaveOrUpdate(careProvs);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院采购目录接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMFSupplyGoods")
@ResponseBody
public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
logger.debug("医院采购目录接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
boolean end = false;
try {
supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
end = supplyGoodsService.batchSave(supplyGoods);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院库存接口
* @param request
* @param params
* @return
*/
@ResponseBody
@RequestMapping(value="/setMedStock",method = RequestMethod.POST)
public String setMedStock(HttpServletRequest request, @RequestBody String params){
logger.debug("HLI同步医院库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedStockList> stocks = new ArrayList<MedStockList>();
boolean end = false;
try {
stocks = JSONObject.parseArray(params, MedStockList.class);
end = stockService.batchSave(stocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院补货计划接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedPlan")
@ResponseBody
public String setMedPlan(HttpServletRequest request, @RequestBody String params){
logger.debug("补货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
boolean end = false;
try {
//改成批量的操作
medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
end = medPlanService.batchSave(medPlans);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院退货接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRMedRPI")
@ResponseBody
public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
logger.debug("医院退货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
boolean end = false;
try {
billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
end = backService.batchSave(billBacks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 结算单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRSettle")
@ResponseBody
public String setTRSettle(HttpServletRequest request, @RequestBody String params){
logger.debug("同步医院结算单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
boolean end = false;
try {
settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
end = billSettlementService.batchSave(settlementWithDetails);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商库存接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setStock")
@ResponseBody
public String setStock(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商同步库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
boolean end = false;
try {
supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
end = supplierStockService.batchSave(supplierStocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商出库单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTrmedwv")
@ResponseBody
public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
logger.debug("同步供应商出库单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
boolean end = false;
try {
suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
end = suOutStoreService.batchSave(suOutStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院盘点损溢接口
* @param request
* @param params
* @return
*/
@RequestMapping(value="/setTrDiff")
@ResponseBody
public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院盘点损溢接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
boolean end = false;
try {
spills = JSONObject.parseArray(params, HisSpillsList.class);
end = hisSpillsService.batchSave(spills);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商发票回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setInvoice")
@ResponseBody
public String setInvoice(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商发票回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
boolean end = false;
try {
suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/*
* 医院入库单回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedInStore")
@ResponseBody
public String setMedInStore(HttpServletRequest request, @RequestBody String params){
logger.debug("医院入库单回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
boolean end = false;
try {
//改成批量的操作
medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
end = medInStoreService.batchSave(medInStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/***
* 推送对账数据到平台
* @param params
* @return
*/
@RequestMapping("/pushBalance")
@ResponseBody
public String pushBalance(@RequestBody String params) {
logger.debug("推送对账数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送对账数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送发药数据到平台
* @param params
* @return
*/
@RequestMapping("/pushDispensing")
@ResponseBody
public String pushDispensing(@RequestBody String params){
logger.debug("推送发药数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送库存数据到平台
* @param params
* @return
*/
@RequestMapping("/pushStock")
@ResponseBody
public String pushStock(@RequestBody String params){
logger.debug("推送库存数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送库存数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicinfo")
@ResponseBody
public String pushlicinfo(@RequestBody String params){
logger.debug("证照数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照图片数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicpicinfo")
@ResponseBody
public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
String result = "";
String logId = IdUtil.uuid();
String exception = "";
PlatFormResponse response = new PlatFormResponse();
try {
if (file!=null) {
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
String fileName = file.getOriginalFilename();
String prefix = fileName.substring(fileName.lastIndexOf("."));
File newfile = File.createTempFile(System.currentTimeMillis() + "", prefix);
file.transferTo(newfile);
FileBody bin = new FileBody(newfile);
HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
post.setEntity(reqEntity);
HttpResponse htppresponse = client.execute(post);
HttpEntity resEntity = htppresponse.getEntity();
result = EntityUtils.toString(resEntity, "UTF-8");
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:参数为空");
}
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
}
package com.phxl.common.utils;
public class BaseException extends RuntimeException {
/**
*/
private static final long serialVersionUID = 1L;
private int code;
private String msg;
private Object[] param=null;
public Object[] getParam() {
return param;
}
public void setParam(Object[] param) {
this.param = param;
}
public BaseException(String msg) {
super(msg);
this.code = ReturnCode.ERROR;
this.msg = msg;
}
public BaseException(int code) {
this.code = code;
}
public BaseException(int code, String msg) {
super(msg);
this.code = code;
this.msg = msg;
}
public BaseException(int code, Object ...agrs) {
param = agrs;
this.code = code;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
eclipse.preferences.version=1
encoding//conf/prod=UTF-8
encoding//conf/prod/config.properties=UTF-8
encoding//conf/stg/config.properties=UTF-8
encoding//conf/test=UTF-8
encoding//conf/test/config.properties=UTF-8
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
package com.phxl.modules.goods.entity.supplierstock;
public class SupplierStockList {
public SupplierStock getData() {
return data;
}
public void setData(SupplierStock data) {
this.data = data;
}
private SupplierStock data;
}
package com.phxl.modules.goods.dao.spills;
import com.phxl.modules.goods.entity.spills.HisSpills;
public interface HisSpillsDao {
void insert(HisSpills hisSpills);
}
package com.phxl.modules.goods.dao.medinstore;
import com.phxl.modules.goods.entity.medinstore.MedInStore;
public interface MedInStoreDao {
void insert(MedInStore medInStore);
}
<?xml version="1.0" ?>
<!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="600 seconds" debug="false">
<!-- 定义日志文件 输入位置 -->
<property name="log_dir" value="d://supplierlog"/>
<!-- 日志最大的历史-->
<property name="maxHistory" value="90"/>
<property name="normal-pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
<!-- ConsoleAppender 控制台输出日志 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- 对日志进行格式化 -->
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- ERROR级别日志 -->
<!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 过滤器,只记录WARN级别的日志 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${log_dir}/error.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/error-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- INFO级别日志 appender -->
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<file>${log_dir}/info.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/info-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- DEBUG级别日志 appender -->
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
<file>${log_dir}/debug.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/debug-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<logger name="org.apache.zookeeper.ClientCnxn" level="ERROR" additivity="false"/>
<logger name="com.phxl.modules.goods.dao" level="debug" additivity="false">
<appender-ref ref="debug" />
</logger>
<!-- root级别 DEBUG -->
<root level="DEBUG">
<!-- 控制台输出 -->
<appender-ref ref="STDOUT" />
<!-- 文件输出 -->
<appender-ref ref="ERROR" />
<appender-ref ref="INFO" />
<appender-ref ref="DEBUG" />
</root>
</configuration>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>送货单打印(普通A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}设备送货单</h3></td>
<td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
</tr>
<tr>
<td width="25%" height="30">供应商:${fOrgName}</td>
<td width="25%" height="30">送货单号:${sendNo}</td>
<!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
</tr>
<tr>
<td height="30">制单人:${sendUserName}</td>
<td height="30" colspan="2">制单时间:${sendDate}</td>
</tr>
<tr>
<td height="30" >收货科室:${tDeptName}</td>
<td height="30" colspan="2">收货地址:${tfAddress}</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 25px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="30%" align="left">验收人:</td>
<td width="30%" align="left">收货人:</td>
<td width="20%" align="left">总金额:${totalPrice}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.phxl.modules.goods.entity.medinstore;
public class MedInStoreWithDetail {
public MedInStore getBill() {
return bill;
}
public void setBill(MedInStore bill) {
this.bill = bill;
}
private MedInStore bill;
}
/**
* 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.
*/
package com.phxl.common.util;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Image;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.ColumnText;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfPageEventHelper;
import com.itextpdf.text.pdf.PdfTemplate;
import com.itextpdf.text.pdf.PdfWriter;
/**
* ClassName:PdfReportHeaderFooter <br/>
* Function: TODO ADD FUNCTION. <br/>
* Reason: TODO ADD REASON. <br/>
* Date: 2015年11月18日 下午4:36:17 <br/>
*
* @author
* @version
* @since JDK 1.6
* @see
*/
public class PdfReportHeaderFooter extends PdfPageEventHelper {
public String header = "";
public int presentFontSize = 12;
public Rectangle pageSize = PageSize.A4;
public PdfTemplate total;
public BaseFont bf = null;
public Font fontDetail = null;
public String waterMarkImgSrc = "";
public PdfReportHeaderFooter() {
}
public PdfReportHeaderFooter(String header, int presentFontSize, Rectangle pageSize) {
this.header = header;
this.presentFontSize = presentFontSize;
this.pageSize = pageSize;
}
public PdfReportHeaderFooter(String waterMarkImgSrc) {
this.waterMarkImgSrc = waterMarkImgSrc;
}
public void setHeader(String header) {
this.header = header;
}
public void setPresentFontSize(int presentFontSize) {
this.presentFontSize = presentFontSize;
}
public String getWaterMarkImgSrc() {
return waterMarkImgSrc;
}
public void setWaterMarkImgSrc(String waterMarkImgSrc) {
this.waterMarkImgSrc = waterMarkImgSrc;
}
public void onOpenDocument(PdfWriter writer, Document document) {
total = writer.getDirectContent().createTemplate(50, 50);
}
public void onEndPage(PdfWriter writer, Document document) {
try {
if (bf == null) {
bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
}
if (fontDetail == null) {
fontDetail = new Font(bf, presentFontSize, Font.NORMAL);// 数据体字体
}
} catch (DocumentException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// 1.写入页眉
ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_LEFT, new Phrase(header, fontDetail),
document.left(), document.top() + 20, 0);
// 2.写入前半部分的 第 X页/共
int pageS = writer.getPageNumber();
String foot1 = "第 " + pageS + " 页 /共";
Phrase footer = new Phrase(foot1, fontDetail);
// 3.计算前半部分的foot1的长度,后面好定位最后一部分的'Y页'这俩字的x轴坐标,字体长度也要计算进去 = len
float len = bf.getWidthPoint(foot1, presentFontSize);
// 4.拿到当前的PdfContentByte
PdfContentByte cb = writer.getDirectContent();
// 5.写入页脚1,x轴就是(右margin+左margin + right() -left()- len)/2.0F
// 再给偏移20F适合人类视觉感受,否则肉眼看上去就太偏左了
// ,y轴就是底边界-20,否则就贴边重叠到数据体里了就不是页脚了;注意Y轴是从下往上累加的,最上方的Top值是大于Bottom好几百开外的。
ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, footer,
(document.rightMargin() + document.right() + document.leftMargin() - document.left() - len) / 2.0F
+ 20F,
document.bottom() - 20, 0);
// 6.写入页脚2的模板(就是页脚的Y页这俩字)添加到文档中,计算模板的和Y轴,X=(右边界-左边界 - 前半部分的len值)/2.0F +
// len , y 轴和之前的保持一致,底边界-20
cb.addTemplate(total,
(document.rightMargin() + document.right() + document.leftMargin() - document.left()) / 2.0F + 20F,
document.bottom() - 20);
if(!waterMarkImgSrc.equals("")){
//增加水印图片
PdfContentByte canvas = writer.getDirectContentUnder();
Image image;
try {
image = Image.getInstance(waterMarkImgSrc);
image.scaleAbsolute(PageSize.A4.rotate());
image.setAbsolutePosition(0, 0);
canvas.addImage(image);
} catch (Exception e) {
e.printStackTrace();
}
}
}
public void onCloseDocument(PdfWriter writer, Document document) {
total.beginText();
total.setFontAndSize(bf, presentFontSize);// 生成的模版的字体、颜色
String foot2 = " " + (writer.getPageNumber() - 1) + " 页";
total.showText(foot2);// 模版显示的内容
total.endText();
total.closePath();
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao">
<!--BaseResultMap-->
<resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="med_code" property="medCode" jdbcType="VARCHAR"/>
<result column="med_name" property="medName" jdbcType="VARCHAR"/>
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
<result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
<result column="s_name" property="sName" jdbcType="VARCHAR"/>
<result column="p_name" property="pName" jdbcType="VARCHAR"/>
<result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
<result column="producer" property="producer" jdbcType="VARCHAR"/>
<result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
<result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
<result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
<result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
<result column="price" property="price" jdbcType="DECIMAL"/>
<result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
<result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
<result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
<result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
<result column="length" property="length" jdbcType="DECIMAL"/>
<result column="width" property="width" jdbcType="DECIMAL"/>
<result column="height" property="height" jdbcType="DECIMAL"/>
<result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
<result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
<result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
<result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
<result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
<result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
<result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
<result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
<result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
<result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
<result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
<result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
<result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
<result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
<result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
<result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
<result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
<result column="brand" property="brand" jdbcType="VARCHAR"/>
<result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
<result column="memo" property="memo" jdbcType="VARCHAR"/>
</resultMap>
<!--Base_Column_List-->
<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>
<!-- 新增HisCtMedicineMaterial-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{sName,jdbcType=VARCHAR}
,#{pName,jdbcType=VARCHAR}
,#{helpCode,jdbcType=VARCHAR}
,#{producer,jdbcType=VARCHAR}
,#{agentName,jdbcType=VARCHAR}
,#{medGoodsCateGUID,jdbcType=VARCHAR}
,#{medGoodsCateName,jdbcType=VARCHAR}
,#{registKey,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL}
,#{salePrice,jdbcType=DECIMAL}
,#{batSalePrice,jdbcType=DECIMAL}
,#{productionAddress,jdbcType=VARCHAR}
,#{dosageForm,jdbcType=VARCHAR}
,#{length,jdbcType=DECIMAL}
,#{width,jdbcType=DECIMAL}
,#{height,jdbcType=DECIMAL}
,#{grossWeight,jdbcType=DECIMAL}
,#{netWeight,jdbcType=DECIMAL}
,#{unitStyle,jdbcType=VARCHAR}
,#{bigUnitStyle,jdbcType=VARCHAR}
,#{bigUnitQty,jdbcType=DECIMAL}
,#{bigBcd,jdbcType=VARCHAR}
,#{minUnitStyle,jdbcType=VARCHAR}
,#{minUnitQty,jdbcType=DECIMAL}
,#{litBcd,jdbcType=VARCHAR}
,#{isLotCtrlInput,jdbcType=VARCHAR}
,#{bizState,jdbcType=VARCHAR}
,#{importedFlag,jdbcType=VARCHAR}
,#{reportFlag,jdbcType=VARCHAR}
,#{noxiousFlag,jdbcType=VARCHAR}
,#{drugNerveFlag,jdbcType=VARCHAR}
,#{productStandardCode,jdbcType=VARCHAR}
,#{specStandardCode,jdbcType=VARCHAR}
,#{brand,jdbcType=VARCHAR}
,#{coldFlag,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{memo,jdbcType=VARCHAR}
)
</insert>
<!-- 按需修改HisCtMedicineMaterial-->
<update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
update med_hli_medicine_material
<set>
<if test="medName != null and medName != ''">
med_name = #{medName,jdbcType=VARCHAR},
</if>
<if test="goodsCode != null and goodsCode != ''">
goods_code = #{goodsCode,jdbcType=VARCHAR},
</if>
<if test="goodsSpec != null and goodsSpec != ''">
goods_spec = #{goodsSpec,jdbcType=VARCHAR},
</if>
<if test="goodsName != null and goodsName != ''">
goods_name = #{goodsName,jdbcType=VARCHAR},
</if>
<if test="sName != null and sName != ''">
s_name = #{sName,jdbcType=VARCHAR},
</if>
<if test="pName != null and pName != ''">
p_name = #{pName,jdbcType=VARCHAR},
</if>
<if test="helpCode != null and helpCode != ''">
help_code = #{helpCode,jdbcType=VARCHAR},
</if>
<if test="producer != null and producer != ''">
producer = #{producer,jdbcType=VARCHAR},
</if>
<if test="agentName != null and agentName != ''">
agent_name = #{agentName,jdbcType=VARCHAR},
</if>
<if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
</if>
<if test="medGoodsCateName != null and medGoodsCateName != ''">
med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
</if>
<if test="registKey != null and registKey != ''">
regist_key = #{registKey,jdbcType=VARCHAR},
</if>
<if test="price != null and price != ''">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="salePrice != null and salePrice != ''">
sale_price = #{salePrice,jdbcType=DECIMAL},
</if>
<if test="batSalePrice != null and batSalePrice != ''">
bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
</if>
<if test="productionAddress != null and productionAddress != ''">
production_address = #{productionAddress,jdbcType=VARCHAR},
</if>
<if test="dosageForm != null and dosageForm != ''">
dosage_form = #{dosageForm,jdbcType=VARCHAR},
</if>
<if test="length != null and length != ''">
length = #{length,jdbcType=DECIMAL},
</if>
<if test="width != null and width != ''">
width = #{width,jdbcType=DECIMAL},
</if>
<if test="height != null and height != ''">
height = #{height,jdbcType=DECIMAL},
</if>
<if test="grossWeight != null and grossWeight != ''">
gross_weight = #{grossWeight,jdbcType=DECIMAL},
</if>
<if test="netWeight != null and netWeight != ''">
net_weight = #{netWeight,jdbcType=DECIMAL},
</if>
<if test="unitStyle != null and unitStyle != ''">
unit_style = #{unitStyle,jdbcType=VARCHAR},
</if>
<if test="bigUnitStyle != null and bigUnitStyle != ''">
big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
</if>
<if test="bigUnitQty != null and bigUnitQty != ''">
big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
</if>
<if test="bigBcd != null and bigBcd != ''">
big_bcd = #{bigBcd,jdbcType=VARCHAR},
</if>
<if test="minUnitStyle != null and minUnitStyle != ''">
min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
</if>
<if test="minUnitQty != null and minUnitQty != ''">
min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
</if>
<if test="litBcd != null and litBcd != ''">
lit_bcd = #{litBcd,jdbcType=VARCHAR},
</if>
<if test="isLotCtrlInput != null and isLotCtrlInput != ''">
is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
</if>
<if test="bizState != null and bizState != ''">
biz_state = #{bizState,jdbcType=VARCHAR},
</if>
<if test="importedFlag != null and importedFlag != ''">
imported_flag = #{importedFlag,jdbcType=VARCHAR},
</if>
<if test="reportFlag != null and reportFlag != ''">
report_flag = #{reportFlag,jdbcType=VARCHAR},
</if>
<if test="noxiousFlag != null and noxiousFlag != ''">
noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
</if>
<if test="drugNerveFlag != null and drugNerveFlag != ''">
drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
</if>
<if test="productStandardCode != null and productStandardCode != ''">
product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
</if>
<if test="specStandardCode != null and specStandardCode != ''">
spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
</if>
<if test="brand != null and brand != ''">
brand = #{brand,jdbcType=VARCHAR},
</if>
<if test="coldFlag != null and coldFlag != ''">
cold_flag = #{coldFlag,jdbcType=VARCHAR},
</if>
<if test="supplierCode != null and supplierCode != ''">
supplier_code = #{supplierCode,jdbcType=VARCHAR},
</if>
<if test="supplierName != null and supplierName != ''">
supplier_name=#{supplierName,jdbcType=VARCHAR},
</if>
<if test="memo != null and memo != ''">
memo=#{memo,jdbcType=VARCHAR}
</if>
</set>
where med_code = #{medCode,jdbcType=BIGINT}
</update>
<!-- 查询HisCtMedicineMaterial详情 -->
<select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
select
<include refid="Base_Column_List"/>
from med_hli_medicine_material material
<where>
<if test="goodsCode!=null and goodsCode!=''">
And goods_code = #{goodsCode,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.entity.billsettlement;
import java.math.BigDecimal;
import java.util.Date;
/**
* 医院结算单明细信息
*/
public class BillSettlementDetail{
private String id;
private String settleBillNo; //结算单号
private int rowNo; //行号
private String goodsCode; //采购方_商品编码
private String goodsName; //采购方_商品名称
private String goodsSpec;
private String producerName;
private String goodsCate;
private BigDecimal settleQty; //采购方_结算数量
private String unit; //采购方_包装单位
private BigDecimal settlePrice; //结算价格
private BigDecimal settleAmount; //结算金额
private String registKey; //批准文号
private String lot;
private Date productionDate;
private Date expireDate;
private Date create_time;
private Date update_time;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSettleBillNo() {
return settleBillNo;
}
public void setSettleBillNo(String settleBillNo) {
this.settleBillNo = settleBillNo;
}
public int getRowNo() {
return rowNo;
}
public void setRowNo(int rowNo) {
this.rowNo = rowNo;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getProducerName() {
return producerName;
}
public void setProducerName(String producerName) {
this.producerName = producerName;
}
public String getGoodsCate() {
return goodsCate;
}
public void setGoodsCate(String goodsCate) {
this.goodsCate = goodsCate;
}
public BigDecimal getSettleQty() {
return settleQty;
}
public void setSettleQty(BigDecimal settleQty) {
this.settleQty = settleQty;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public BigDecimal getSettlePrice() {
return settlePrice;
}
public void setSettlePrice(BigDecimal settlePrice) {
this.settlePrice = settlePrice;
}
public BigDecimal getSettleAmount() {
return settleAmount;
}
public void setSettleAmount(BigDecimal settleAmount) {
this.settleAmount = settleAmount;
}
public String getRegistKey() {
return registKey;
}
public void setRegistKey(String registKey) {
this.registKey = registKey;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medinstore.MedInStoreDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
<result column="supplier_do_no" property="supplierDoNo" jdbcType="VARCHAR" />
<result column="supplier_do_row_no" property="supplierDoRowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
<result column="mvqty" property="mvqty" jdbcType="DECIMAL" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedInStoreDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medPlanRowNo},
#{obj.supplierDoNo},
#{obj.supplierDoRowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.unit},
#{obj.manufacturer},
#{obj.purchaserPrice},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.arrivalqty},
#{obj.mvqty},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.dao.suoutstore;
import java.util.List;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail;
public interface SuOutStoreDetailDao {
void batchInsert(List<SuOutStoreDetail> details);
}
package com.phxl.modules.goods.entity.medplan;
import java.util.Date;
import java.util.List;
/**
* 补货计划
*/
public class MedPlan{
public List<MedPlanDetail> getTrmedplandetails() {
return trmedplandetails;
}
public void setTrmedplandetails(List<MedPlanDetail> trmedplandetails) {
this.trmedplandetails = trmedplandetails;
}
private String medCode; //医疗机构代码
private String medName; //医疗机构名称
private String supplierCode; //平台供应商代码
private String suppliername; //平台供应商名称
private String billNo; //单据编号
private String billType; //单据类型
private String settleType; //结算方式(0:零库存 1:非零库存)
private String medDeptCode; //订货科室编码
private String medDeptName; //订货科室名称
private String medStoreCode; //订货库房编码
private String medStoreName; //订货库房名称
private String firstFlag; //是否优先
private Date planBeginDate; //订货日期
private Date planEndDate; //要求到货日期
private String memo; //备注
private String operaterName; //操作人员姓名
private Date inputDate; //制单日期
private Date create_time; //创建时间
private Date update_time; //更新时间
private List<MedPlanDetail> trmedplandetails;
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMedCode() {
return medCode;
}
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSuppliername() {
return suppliername;
}
public void setSuppliername(String suppliername) {
this.suppliername = suppliername;
}
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getBillType() {
return billType;
}
public void setBillType(String billType) {
this.billType = billType;
}
public String getMedDeptCode() {
return medDeptCode;
}
public void setMedDeptCode(String medDeptCode) {
this.medDeptCode = medDeptCode;
}
public String getMedDeptName() {
return medDeptName;
}
public void setMedDeptName(String medDeptName) {
this.medDeptName = medDeptName;
}
public String getMedStoreCode() {
return medStoreCode;
}
public void setMedStoreCode(String medStoreCode) {
this.medStoreCode = medStoreCode;
}
public String getMedStoreName() {
return medStoreName;
}
public void setMedStoreName(String medStoreName) {
this.medStoreName = medStoreName;
}
public String getFirstFlag() {
return firstFlag;
}
public void setFirstFlag(String firstFlag) {
this.firstFlag = firstFlag;
}
public Date getPlanBeginDate() {
return planBeginDate;
}
public void setPlanBeginDate(Date planBeginDate) {
this.planBeginDate = planBeginDate;
}
public Date getPlanEndDate() {
return planEndDate;
}
public void setPlanEndDate(Date planEndDate) {
this.planEndDate = planEndDate;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getOperaterName() {
return operaterName;
}
public void setOperaterName(String operaterName) {
this.operaterName = operaterName;
}
public Date getInputDate() {
return inputDate;
}
public void setInputDate(Date inputDate) {
this.inputDate = inputDate;
}
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
public String getSettleType() {
return settleType;
}
public void setSettleType(String settleType) {
this.settleType = settleType;
}
}
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6
package com.phxl.modules.goods.service.medinstore;
import java.math.BigDecimal;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.medinstore.MedInStoreDao;
import com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao;
import com.phxl.modules.goods.entity.medinstore.MedInStore;
import com.phxl.modules.goods.entity.medinstore.MedInStoreDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
@Service
public class MedInStoreService {
@Autowired
private MedInStoreDao inStoreDao;
@Autowired
private MedInStoreDetailDao inStoreDetailDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
private void checkMedInStore(List<MedInStoreWithDetail> instores) {
if(instores == null || instores.size() == 0){
logger.error("无相应入库单单据信息");
throw new BaseException("无相应入库单单据信息");
}
for (MedInStoreWithDetail medinstore : instores) {
String medCode = medinstore.getBill().getMedGuid();
String medName = medinstore.getBill().getMedName();
if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
logger.error("入库单医疗机构编码以及医疗机构名称不能为空");
throw new BaseException("入库单医疗机构编码以及医疗机构名称不能为空");
}
String supplierCode = medinstore.getBill().getSupplierGuid();
String suppliername = medinstore.getBill().getSupplierName();
if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(suppliername)) {
logger.error("入库单平台供应商代码以及平台供应商名称不能为空");
throw new BaseException("入库单平台供应商代码以及平台供应商名称不能为空");
}
String billNo = medinstore.getBill().getBillNo();
if (StringUtils.isEmpty(billNo)) {
logger.error("入库单单据编号不能为空");
throw new BaseException("入库单单据编号不能为空");
}
String billType = medinstore.getBill().getBillType();
if (StringUtils.isEmpty(billType)) {
logger.error("入库单单据类型不能为空");
throw new BaseException("入库单单据类型不能为空");
}
List<MedInStoreDetail> details = medinstore.getBill().getBilldetaillist();
if(details == null || details.size() == 0){
logger.error("入库单单据编号:"+billNo+"入库明细不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细不能为空");
}
for (MedInStoreDetail medInStoreDetail : details) {
String detailBillNo = medInStoreDetail.getBillNo();
if (StringUtils.isEmpty(detailBillNo)) {
logger.error("入库单单据编号:"+billNo+"入库明细单据编号不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细单据编号不能为空");
}
String goodsCode = medInStoreDetail.getGoodsCode();
String goodsName = medInStoreDetail.getGoodsName();
if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
logger.error("入库单单据编号:"+billNo+"入库明细商品编码以及商品名称不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细商品编码以及商品名称不能为空");
}
BigDecimal mvQty = medInStoreDetail.getMvqty();
if (mvQty == null) {
logger.error("入库单单据编号:"+billNo+"入库明细商品入库实收数不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细商品入库实收数不能为空");
}
BigDecimal arrivalQty = medInStoreDetail.getArrivalqty();
if (arrivalQty == null) {
logger.error("入库单单据编号:"+billNo+"入库明细商品出库数量不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"入库明细商品出库数量不能为空");
}
BigDecimal amount = medInStoreDetail.getAmount();
if (amount == null) {
logger.error("入库单单据编号:"+billNo+"入库明细商品金额不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细商品金额不能为空");
}
String unit = medInStoreDetail.getUnit();
if (StringUtils.isEmpty(unit)) {
logger.error("入库单单据编号:"+billNo+"入库明细商品单位不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细商品单位不能为空");
}
BigDecimal purchaserPrice = medInStoreDetail.getPurchaserPrice();
if (purchaserPrice == null) {
logger.error("入库单单据编号:"+billNo+"入库明细商品采购价格不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细商品采购价格不能为空");
}
String medPlanRowNo = medInStoreDetail.getMedPlanRowNo();
if (StringUtils.isEmpty(medPlanRowNo)) {
logger.error("入库单单据编号:"+billNo+"入库明细补货计划单据原行号不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细补货计划单据原行号不能为空");
}
String supplierDoNo = medInStoreDetail.getSupplierDoNo();
if (StringUtils.isEmpty(supplierDoNo)) {
logger.error("入库单单据编号:"+billNo+"入库明细供应商出库单号不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细供应商出库单号不能为空");
}
String supplierDoRowNo = medInStoreDetail.getSupplierDoRowNo();
if (StringUtils.isEmpty(supplierDoRowNo)) {
logger.error("入库单单据编号:"+billNo+"入库明细供应商出库单行号不能为空");
throw new BaseException("入库单单据编号:"+billNo+"入库明细供应商出库单行号不能为空");
}
}
}
}
public boolean batchSave(List<MedInStoreWithDetail> instores) {
boolean result = true;
try {
checkMedInStore(instores);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
for (MedInStoreWithDetail medInStoreWithDetail : instores) {
MedInStore medinstore = medInStoreWithDetail.getBill();
List<MedInStoreDetail> details = medinstore.getBilldetaillist();
String id = IdUtil.uuid();
medInStoreWithDetail.getBill().setId(id);
if(details != null && details.size() != 0){
for (MedInStoreDetail medinstoredetail : details) {
medinstoredetail.setBillNo(medInStoreWithDetail.getBill().getBillNo());
medinstoredetail.setId(id);
}
inStoreDao.insert(medinstore);
inStoreDetailDao.batchInsert(details);
}
}
return result;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medplan.MedPlanDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="po_qty" property="poQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="taxprice" property="taxprice" jdbcType="DECIMAL" />
<result column="taxsum" property="taxsum" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<sql id="Base_Column_List">id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum</sql>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
insert into med_hli_plan_detail (id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.poQty},
#{obj.unit},
#{obj.taxprice},
#{obj.taxsum}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.service.supplygoods;
import java.math.BigDecimal;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
@Service
public class MedSupplyGoodsService{
@Autowired
private MedSupplyGoodsDao medSupplyGoodsDao;
private static Log log = LogFactory.getLog(MedSupplyGoodsService.class);
@Transactional
public boolean batchSave(List<MedSupplyGoods> supplyGoods) {
boolean result = false;
if(supplyGoods != null && supplyGoods.size() != 0){
for (MedSupplyGoods medSupplyGoods : supplyGoods) {
try {
checkGoods(medSupplyGoods);
} catch (Exception e) {
String json = JsonMapper.toJsonString(medSupplyGoods);
log.error("采购目录:"+json+"信息异常");
throw new BaseException(e.getMessage());
}
medSupplyGoods.setId(IdUtil.uuid());
}
medSupplyGoodsDao.batchInsert(supplyGoods);
result = true;
}
return result;
}
/**
* 采购目录信息校验
* @param medSupplyGoods
*/
private void checkGoods(MedSupplyGoods medSupplyGoods) {
//获取采购目录供应商信息
String medSuppliercode = medSupplyGoods.getMedSuppliercode();
String medSuppliername = medSupplyGoods.getMedSuppliername();
if(StringUtils.isEmpty(medSuppliercode) || StringUtils.isEmpty(medSuppliername)){
log.error("采购目录信息供应商编号以及供应商名称不能为空");
throw new BaseException("采购目录信息供应商编号以及供应商名称不能为空");
}
//获取采购目录商品信息
String goodsCode = medSupplyGoods.getGoodsCode();
String goodsName = medSupplyGoods.getGoodsName();
if(StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)){
log.error("采购目录信息商品编号以及商品名称不能为空");
throw new BaseException("采购目录信息商品编号以及商品名称不能为空");
}
//对应商品规格
String goodsSpec = medSupplyGoods.getGoodsSpec();
if(StringUtils.isEmpty(goodsSpec)){
log.error("采购目录信息商品规格以及商品名称不能为空");
throw new BaseException("采购目录信息商品规格以及商品名称不能为空");
}
BigDecimal price = medSupplyGoods.getPrice();
if (price == null) {
log.error("采购目录信息采购价不能为空");
throw new BaseException("采购目录信息采购价不能为空");
}
}
}
package com.phxl.modules.goods.service.ctcareprov;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import java.util.*;
@Service
public class CTCareProvService{
@Autowired
private CTCareProvDao cTCareProvDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public boolean batchSaveOrUpdate(List<CTCareProv> careProvs) {
boolean success = false;
try {
checkCTCareProv(careProvs);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
if (CollectionUtils.isNotEmpty(careProvs)) {
List<String> codes = new ArrayList<String>();
for (CTCareProv ctCareProv : careProvs) {
String ryCode = ctCareProv.getMfmedStaffCode();
codes.add(ryCode);
}
Map<String,Object> map = new HashMap<String, Object>();
map.put("ryCodes",codes);
List<CTCareProv> exsitList = cTCareProvDao.batchSelect(map);
List<CTCareProv> insertList = new ArrayList<CTCareProv>();
List<CTCareProv> updateList = new ArrayList<CTCareProv>();
for (CTCareProv ctCareProv : careProvs) {
boolean flag = false;
for (CTCareProv exsitCtCareProv : exsitList) {
if (ctCareProv.getMfmedStaffCode().equals(exsitCtCareProv.getMfmedStaffCode())) {
ctCareProv.setId(exsitCtCareProv.getId());
flag = true;
}
}
if (!flag) {
ctCareProv.setId(IdUtil.uuid());
insertList.add(ctCareProv);
}else{
updateList.add(ctCareProv);
}
}
if(CollectionUtils.isNotEmpty(updateList)){
cTCareProvDao.batchUpdate(updateList);
}
if(CollectionUtils.isNotEmpty(insertList)){
cTCareProvDao.batchInsert(insertList);
}
success = true;
}
return success;
}
private void checkCTCareProv(List<CTCareProv> careProvs) {
if(careProvs == null || careProvs.size() == 0){
logger.error("无相应人员资料信息");
throw new BaseException("无相应人员资料信息");
}
for (CTCareProv ctCareProv : careProvs) {
String mfmedStaffCode = ctCareProv.getMfmedStaffCode();
if (StringUtils.isEmpty(mfmedStaffCode)) {
logger.error("人员资料人员代码不能为空");
throw new BaseException("人员资料人员代码不能为空");
}
String logonUser = ctCareProv.getLogonUser();
if (StringUtils.isEmpty(logonUser)) {
logger.error("人员资料登陆账号不能为空");
throw new BaseException("人员资料登陆账号不能为空");
}
String realName = ctCareProv.getRealName();
if (StringUtils.isEmpty(realName)) {
logger.error("人员资料真实账号不能为空");
throw new BaseException("人员资料真实账号不能为空");
}
}
}
}
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://114.115.184.70:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=Puhua888@com
spd_service_url = http://localhost:8080/medicinal-web/a/spdrecvsupplier/
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<title>微信绑定页面</title>
</head>
<body>
<div style="width: 240px;">
<div style="height: 240px;width: 240px;">
${qrImage}
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增MedPlan-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medGuid,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{medDeptGuid,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreGuid,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{supplierGuid,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{createTime,jdbcType=TIMESTAMP}
,#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
package com.phxl.modules.goods.dao.hisCtMedicineMaterial;
import java.util.List;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
/**
*
* @ClassName: HisCtMedicineMaterialDao
* @Description: HisCtMedicineMaterial数据访问接口
* @author hehaihong
* @date 2018-08-06 14:44:26
*
*/
public interface HisCtMedicineMaterialDao {
List<HisCtMedicineMaterial> findLists(HisCtMedicineMaterial material);
HisCtMedicineMaterial getMedicine(HisCtMedicineMaterial material);
HisCtMedicineMaterial get(HisCtMedicineMaterial materials);
void update(HisCtMedicineMaterial materials);
void insert(HisCtMedicineMaterial materials);
}
\ No newline at end of file
package com.phxl.modules.goods.entity.suoutstore;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 供应商出库单信息
*/
public class SuOutStore{
private String billNo; //单据编号
private String medGuid; //医疗机构代码
private String medName; //医疗机构名称
private String medDeptGuid; //订货科室编码
private String medDeptName; //订货科室名称
private String medStoreGuid; //订货库房编码
private String medStoreName; //订货库房名称
private String supplierGuid; //供应商编码
private String supplierName; //供应商名称
private Date billDate; //出库日期
private int countSum; //明细条数
private BigDecimal detailSum; //明细金额
private String operaterName; //出库人员姓名
private Date inputDate; //制单日期
private String memo; //备注
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; //创建时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; //更新时间
private List<SuOutStoreDetail> billdetaillist; //出库单明细
private String id;
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getMedGuid() {
return medGuid;
}
public void setMedGuid(String medGuid) {
this.medGuid = medGuid;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getMedDeptGuid() {
return medDeptGuid;
}
public void setMedDeptGuid(String medDeptGuid) {
this.medDeptGuid = medDeptGuid;
}
public String getMedDeptName() {
return medDeptName;
}
public void setMedDeptName(String medDeptName) {
this.medDeptName = medDeptName;
}
public String getMedStoreGuid() {
return medStoreGuid;
}
public void setMedStoreGuid(String medStoreGuid) {
this.medStoreGuid = medStoreGuid;
}
public String getMedStoreName() {
return medStoreName;
}
public void setMedStoreName(String medStoreName) {
this.medStoreName = medStoreName;
}
public String getSupplierGuid() {
return supplierGuid;
}
public void setSupplierGuid(String supplierGuid) {
this.supplierGuid = supplierGuid;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getBillDate() {
return billDate;
}
public void setBillDate(Date billDate) {
this.billDate = billDate;
}
public int getCountSum() {
return countSum;
}
public void setCountSum(int countSum) {
this.countSum = countSum;
}
public BigDecimal getDetailSum() {
return detailSum;
}
public void setDetailSum(BigDecimal detailSum) {
this.detailSum = detailSum;
}
public String getOperaterName() {
return operaterName;
}
public void setOperaterName(String operaterName) {
this.operaterName = operaterName;
}
public Date getInputDate() {
return inputDate;
}
public void setInputDate(Date inputDate) {
this.inputDate = inputDate;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<SuOutStoreDetail> getBilldetaillist() {
return billdetaillist;
}
public void setBilldetaillist(List<SuOutStoreDetail> billdetaillist) {
this.billdetaillist = billdetaillist;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
package com.phxl.common.util;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.Iterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
public class JsonUtils {
private static final Log log = LogFactory.getLog(JsonUtils.class);
public static final String EMPTY = "";
/** 空的 {@code JSON} 数据 - <code>"{}"</code>。 */
public static final String EMPTY_JSON = "{}";
/** 空的 {@code JSON} 数组(集合)数据 - {@code "[]"}。 */
public static final String EMPTY_JSON_ARRAY = "[]";
/** 默认的 {@code JSON} 日期/时间字段的格式化模式。 */
public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss SSS";
/** {@code Google Gson} 的 {@literal @Since} 注解常用的版本号常量 - {@code 1.0}。 */
public static final Double SINCE_VERSION_10 = 1.0d;
/** {@code Google Gson} 的 {@literal @Since} 注解常用的版本号常量 - {@code 1.1}。 */
public static final Double SINCE_VERSION_11 = 1.1d;
/** {@code Google Gson} 的 {@literal @Since} 注解常用的版本号常量 - {@code 1.2}。 */
public static final Double SINCE_VERSION_12 = 1.2d;
/**
* 将给定的目标对象根据指定的条件参数转换成 {@code JSON} 格式的字符串。
* <p />
* <strong>该方法转换发生错误时,不会抛出任何异常。若发生错误时,曾通对象返回 <code>"{}"</code>; 集合或数组对象返回
* <code>"[]"</code></strong>
*
* @param target
* 目标对象。
* @param targetType
* 目标对象的类型。
* @param isSerializeNulls
* 是否序列化 {@code null} 值字段。
* @param version
* 字段的版本号注解。
* @param datePattern
* 日期字段的格式化模式。
* @param excludesFieldsWithoutExpose
* 是否排除未标注 {@literal @Expose} 注解的字段。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Type targetType,
boolean isSerializeNulls, Double version, String datePattern,
boolean excludesFieldsWithoutExpose) {
if (target == null)
return EMPTY_JSON;
GsonBuilder builder = new GsonBuilder();
if (isSerializeNulls)
builder.serializeNulls();
if (version != null)
builder.setVersion(version.doubleValue());
if (isEmpty(datePattern))
datePattern = DEFAULT_DATE_PATTERN;
builder.setDateFormat(datePattern);
if (excludesFieldsWithoutExpose)
builder.excludeFieldsWithoutExposeAnnotation();
String result = EMPTY;
Gson gson = builder.create();
try {
if (targetType != null) {
result = gson.toJson(target, targetType);
} else {
result = gson.toJson(target);
}
} catch (Exception ex) {
log.warn("目标对象 " + target.getClass().getName()
+ " 转换 JSON 字符串时,发生异常!", ex);
if (target instanceof Collection || target instanceof Iterator
|| target instanceof Enumeration
|| target.getClass().isArray()) {
result = EMPTY_JSON_ARRAY;
} else
result = EMPTY_JSON;
}
return result;
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
* 对象。</strong>
* <ul>
* <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target) {
return toJson(target, null, false, null, null, true);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
* 对象。</strong>
* <ul>
* <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param datePattern
* 日期字段的格式化模式。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, String datePattern) {
return toJson(target, null, false, null, datePattern, true);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
* 对象。</strong>
* <ul>
* <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param version
* 字段的版本号注解({@literal @Since})。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Double version) {
return toJson(target, null, false, version, null, true);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
* 对象。</strong>
* <ul>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param excludesFieldsWithoutExpose
* 是否排除未标注 {@literal @Expose} 注解的字段。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target,
boolean excludesFieldsWithoutExpose) {
return toJson(target, null, false, null, null,
excludesFieldsWithoutExpose);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法只用来转换普通的 {@code JavaBean}
* 对象。</strong>
* <ul>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param version
* 字段的版本号注解({@literal @Since})。
* @param excludesFieldsWithoutExpose
* 是否排除未标注 {@literal @Expose} 注解的字段。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Double version,
boolean excludesFieldsWithoutExpose) {
return toJson(target, null, false, version, null,
excludesFieldsWithoutExpose);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
* <ul>
* <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param targetType
* 目标对象的类型。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Type targetType) {
return toJson(target, targetType, false, null, null, true);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
* <ul>
* <li>该方法只会转换标有 {@literal @Expose} 注解的字段;</li>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param targetType
* 目标对象的类型。
* @param version
* 字段的版本号注解({@literal @Since})。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Type targetType, Double version) {
return toJson(target, targetType, false, version, null, true);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
* <ul>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法会转换所有未标注或已标注 {@literal @Since} 的字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param targetType
* 目标对象的类型。
* @param excludesFieldsWithoutExpose
* 是否排除未标注 {@literal @Expose} 注解的字段。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Type targetType,
boolean excludesFieldsWithoutExpose) {
return toJson(target, targetType, false, null, null,
excludesFieldsWithoutExpose);
}
/**
* 将给定的目标对象转换成 {@code JSON} 格式的字符串。<strong>此方法通常用来转换使用泛型的对象。</strong>
* <ul>
* <li>该方法不会转换 {@code null} 值字段;</li>
* <li>该方法转换时使用默认的 日期/时间 格式化模式 - {@code yyyy-MM-dd HH:mm:ss SSS};</li>
* </ul>
*
* @param target
* 要转换成 {@code JSON} 的目标对象。
* @param targetType
* 目标对象的类型。
* @param version
* 字段的版本号注解({@literal @Since})。
* @param excludesFieldsWithoutExpose
* 是否排除未标注 {@literal @Expose} 注解的字段。
* @return 目标对象的 {@code JSON} 格式的字符串。
*/
public static String toJson(Object target, Type targetType, Double version,
boolean excludesFieldsWithoutExpose) {
return toJson(target, targetType, false, version, null,
excludesFieldsWithoutExpose);
}
/**
* 将给定的 {@code JSON} 字符串转换成指定的类型对象。
*
* @param <T>
* 要转换的目标类型。
* @param json
* 给定的 {@code JSON} 字符串。
* @param token
* {@code com.google.gson.reflect.TypeToken} 的类型指示类对象。
* @param datePattern
* 日期格式模式。
* @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
*/
public static <T> T fromJson(String json, TypeToken<T> token,
String datePattern) {
if (isEmpty(json)) {
return null;
}
GsonBuilder builder = new GsonBuilder();
if (isEmpty(datePattern)) {
datePattern = DEFAULT_DATE_PATTERN;
}
Gson gson = builder.create();
try {
return gson.fromJson(json, token.getType());
} catch (Exception ex) {
log.error(json + " 无法转换为 " + token.getRawType().getName() + " 对象!",
ex);
return null;
}
}
/**
* 将给定的 {@code JSON} 字符串转换成指定的类型对象。
*
* @param <T>
* 要转换的目标类型。
* @param json
* 给定的 {@code JSON} 字符串。
* @param token
* {@code com.google.gson.reflect.TypeToken} 的类型指示类对象。
* @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
*/
public static <T> T fromJson(String json, TypeToken<T> token) {
return fromJson(json, token, null);
}
/**
* 将给定的 {@code JSON} 字符串转换成指定的类型对象。<strong>此方法通常用来转换普通的 {@code JavaBean}
* 对象。</strong>
*
* @param <T>
* 要转换的目标类型。
* @param json
* 给定的 {@code JSON} 字符串。
* @param clazz
* 要转换的目标类。
* @param datePattern
* 日期格式模式。
* @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
*/
public static <T> T fromJson(String json, Class<T> clazz, String datePattern) {
if (isEmpty(json)) {
return null;
}
/* GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, new ImprovedDateTypeAdapter());*/
if (isEmpty(datePattern)) {
datePattern = DEFAULT_DATE_PATTERN;
}
/* Gson gson = builder.create(); */
Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonDateDeserializer()).create();
try {
return gson.fromJson(json, clazz);
} catch (Exception ex) {
log.error(json + " 无法转换为 " + clazz.getName() + " 对象!", ex);
return null;
}
}
/**
* 将给定的 {@code JSON} 字符串转换成指定的类型对象。<strong>此方法通常用来转换普通的 {@code JavaBean}
* 对象。</strong>
*
* @param <T>
* 要转换的目标类型。
* @param json
* 给定的 {@code JSON} 字符串。
* @param clazz
* 要转换的目标类。
* @return 给定的 {@code JSON} 字符串表示的指定的类型对象。
*/
public static <T> T fromJson(String json, Class<T> clazz) {
return fromJson(json, clazz, null);
}
public static boolean isEmpty(String inStr) {
boolean reTag = false;
if (inStr == null || "".equals(inStr)) {
reTag = true;
}
return reTag;
}
public static void main(String[] args) {
System.out.println(new Date(1474176253000l));
}
}
package com.phxl.modules.goods.entity.billback;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.util.Date;
/**
* 医院退货单明细信息
*/
public class BillBackDetail{
@JSONField(name = "BillNo")
private String billNo; //单据编号
@JSONField(name = "RowNo")
private int rowNo; //行号
@JSONField(name = "MedMVBillNo")
private String medMVBillNo; //入库单据编号
@JSONField(name = "MedMVRowNo")
private int medMVRowNo; //入库单据原行号
@JSONField(name = "GoodsCode")
private String goodsCode; //商品编码
@JSONField(name = "GoodsName")
private String goodsName; //商品名称
@JSONField(name = "GoodsSpec")
private String goodsSpec; //商品规格
@JSONField(name = "Returns_Unit")
private String returns_Unit; //包装单位
@JSONField(name = "Returns_Price")
private BigDecimal returns_Price; //退货价格
@JSONField(name = "Manufacturer")
private String manufacturer; //生产厂商
@JSONField(name = "RpiQty")
private BigDecimal rpiQty; //退货数量
@JSONField(name = "Amount")
private BigDecimal amount; //金额
@JSONField(name = "Lot")
private String lot; //批号
@JSONField(name = "ProductionDate")
private Date productionDate; //生产日期
@JSONField(name = "ExpireDate")
private Date expireDate; //有效期至
@JSONField(name = "Memo")
private String memo; //备注
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public int getRowNo() {
return rowNo;
}
public void setRowNo(int rowNo) {
this.rowNo = rowNo;
}
public String getMedMVBillNo() {
return medMVBillNo;
}
public void setMedMVBillNo(String medMVBillNo) {
this.medMVBillNo = medMVBillNo;
}
public int getMedMVRowNo() {
return medMVRowNo;
}
public void setMedMVRowNo(int medMVRowNo) {
this.medMVRowNo = medMVRowNo;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getReturns_Unit() {
return returns_Unit;
}
public void setReturns_Unit(String returns_Unit) {
this.returns_Unit = returns_Unit;
}
public BigDecimal getReturns_Price() {
return returns_Price;
}
public void setReturns_Price(BigDecimal returns_Price) {
this.returns_Price = returns_Price;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public BigDecimal getRpiQty() {
return rpiQty;
}
public void setRpiQty(BigDecimal rpiQty) {
this.rpiQty = rpiQty;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
}
package com.phxl.modules.goods.service.hisCtMedicineMaterial;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
@Service
public class HisCtMedicineMaterialService{
@Autowired
private HisCtMedicineMaterialDao hisCtMedicineMaterialDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
/**
* 同步药品目录信息
*/
@Transactional
public String saveMedicine(HisCtMedicineMaterial materials) {
try {
checkMaterial(materials);
if(hisCtMedicineMaterialDao.get(materials)!=null){
hisCtMedicineMaterialDao.update(materials);
}else{
materials.setId(IdUtil.uuid());
hisCtMedicineMaterialDao.insert(materials);
}
} catch (Exception e) {
logger.error(e.getMessage());
throw new BaseException(e.getMessage());
}
return "1";
}
private void checkMaterial(HisCtMedicineMaterial materials) {
String medCode = materials.getMedCode();
String medName = materials.getMedName();
if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
logger.error("前置机:药品目录医疗机构编码以及医疗机构名称不能为空");
throw new BaseException("前置机:药品目录医疗机构编码以及医疗机构名称不能为空");
}
String goodsCode = materials.getGoodsCode();
String goodsName = materials.getGoodsName();
if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
logger.error("前置机:药品目录商品编码以及商品名称不能为空");
throw new BaseException("前置机:药品目录商品编码以及商品名称不能为空");
}
String goodsSpec = materials.getGoodsSpec();
if (StringUtils.isEmpty(goodsSpec)) {
logger.error("前置机:药品目录商品规格不能为空");
throw new BaseException("前置机:药品目录商品规格不能为空");
}
}
public String createRequest() {
return null;
}
}
package com.phxl.common.constants;
public class HisResponseConstant {
public static class ResponseBodyMsg{
public static final String success_ResultCode = "001";
public static final String getSuccess_ResultContent = "成功";
}
public static class ResponseHeaderMsg{
public static final String SUPPLYGOODS_MESSAGEID = "004";
public static final String SUPPLYGOODS_SOURCESYSTEM = "医院采购目录";
}
}
package com.phxl.modules.goods.entity.billsettlement;
public class BillSettlementWithDetail {
private BillSettlement TRSettle;
public BillSettlement getTRSettle() {
return TRSettle;
}
public void setTRSettle(BillSettlement tRSettle) {
TRSettle = tRSettle;
}
}
package com.phxl.common.response;
public class PlatFormResponseConstant {
public static class ResponseBodyMsg{
public static final String success_ResultCode = "Y";
public static final String fail_ResultCode = "E";
public static final String getSuccess_ResultContent = "成功";
public static final String getFail_ResultContent = "失败";
}
public static class ResponseHeaderMsg{
public static final String SUPPLYGOODS_MESSAGEID = "004";
public static final String SUPPLYGOODS_SOURCESYSTEM = "医院采购目录";
}
}
package com.phxl.common.util;
import com.thoughtworks.xstream.XStream;
public class XMLUtil {
private static final XStream xStream = new XStream();
// 将对象转为XML字符串
public static <T> String toXML(T obj) {
Class<?> cls = obj.getClass();
xStream.alias(cls.getSimpleName().toLowerCase(), cls);
xStream.aliasSystemAttribute(null, "class");
return xStream.toXML(obj);
}
// 将XML字符串转为对象
@SuppressWarnings({"unchecked"})
public static <T> T fromXML(String xml) {
return (T) xStream.fromXML(xml);
}
}
package com.phxl.modules.goods.entity.invoiceback;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
public class SuInvoiceBack{
@JSONField(name = "SettleBillNo")
private String settleBillNo; //结算单号
@JSONField(name = "SettleDate")
private Date settleDate; //结算单日期
@JSONField(name = "MedCode")
private String medCode; //医疗机构编码
@JSONField(name = "MedName")
private String medName; //医疗机构名称
@JSONField(name = "SupplierCode")
private String supplierCode; //供应商编码
@JSONField(name = "SupplierName")
private String supplierName; //供应商名称
@JSONField(name = "GoodsSum")
private int goodsSum; //商品条目/品规数
@JSONField(name = "Amount")
private BigDecimal amount; //结算金额
@JSONField(name = "BeginDate")
private Date beginDate; //业务开始日期
@JSONField(name = "EndDate")
private Date endDate; //业务结束日期
@JSONField(name = "CREATE_TIME")
private Date create_time; //创建时间
@JSONField(name = "UPDATE_TIME")
private Date update_time; //更新时间
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
private List<SuInvoiceBackDetail> billdetaillist; //回传发票明细
private String id;
public String getSettleBillNo() {
return settleBillNo;
}
public void setSettleBillNo(String settleBillNo) {
this.settleBillNo = settleBillNo;
}
public Date getSettleDate() {
return settleDate;
}
public void setSettleDate(Date settleDate) {
this.settleDate = settleDate;
}
public String getMedCode() {
return medCode;
}
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public int getGoodsSum() {
return goodsSum;
}
public void setGoodsSum(int goodsSum) {
this.goodsSum = goodsSum;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<SuInvoiceBackDetail> getBilldetaillist() {
return billdetaillist;
}
public void setBilldetaillist(List<SuInvoiceBackDetail> billdetaillist) {
this.billdetaillist = billdetaillist;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billback.BillBack">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplierb_name" property="supplierbName" jdbcType="VARCHAR" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="reason" property="reason" jdbcType="VARCHAR" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增BillBack-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.billback.BillBack">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medMVBillNo,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierbName,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{reason,jdbcType=VARCHAR}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.dao.interfaceLog;
import com.phxl.modules.goods.entity.interfaceLog.InterfaceLog;
/**
* 接口日志DAO接口
* @author zhangbing
* @version 2018-08-20
*/
public interface InterfaceLogDao{
void insert(InterfaceLog interfaceLog);
void update(InterfaceLog interfaceLog);
}
package com.phxl.modules.goods.entity.medinstore;
import java.math.BigDecimal;
import java.util.Date;
public class MedInStoreDetail {
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getRowNo() {
return rowNo;
}
public void setRowNo(String rowNo) {
this.rowNo = rowNo;
}
public String getMedPlanRowNo() {
return medPlanRowNo;
}
public void setMedPlanRowNo(String medPlanRowNo) {
this.medPlanRowNo = medPlanRowNo;
}
public String getSupplierDoNo() {
return supplierDoNo;
}
public void setSupplierDoNo(String supplierDoNo) {
this.supplierDoNo = supplierDoNo;
}
public String getSupplierDoRowNo() {
return supplierDoRowNo;
}
public void setSupplierDoRowNo(String supplierDoRowNo) {
this.supplierDoRowNo = supplierDoRowNo;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public BigDecimal getPurchaserPrice() {
return purchaserPrice;
}
public void setPurchaserPrice(BigDecimal purchaserPrice) {
this.purchaserPrice = purchaserPrice;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
public BigDecimal getArrivalqty() {
return arrivalqty;
}
public void setArrivalqty(BigDecimal arrivalqty) {
this.arrivalqty = arrivalqty;
}
public BigDecimal getMvqty() {
return mvqty;
}
public void setMvqty(BigDecimal mvqty) {
this.mvqty = mvqty;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
private String billNo;
private String rowNo;
private String medPlanRowNo;
private String supplierDoNo;
private String supplierDoRowNo;
private String goodsCode;
private String goodsName;
private String goodsSpec;
private String unit;
private String manufacturer;
private BigDecimal purchaserPrice;
private BigDecimal amount;
private String lot;
private Date productionDate;
private Date expireDate;
private BigDecimal arrivalqty;
private BigDecimal mvqty;
private String memo;
}
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://114.115.184.70:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=Puhua888@com
spd_service_url = http://localhost:8080/medicinal-web/a/spdrecvsupplier/
package com.phxl.common.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class VideoThumbTaker {
static Log log = LogFactory.getLog(VideoThumbTaker.class);
protected String ffmpegApp;
public VideoThumbTaker(String ffmpegApp) {
this.ffmpegApp = ffmpegApp;
}
@SuppressWarnings("unused")
/****
* 获取指定时间内的图片
*
* @param videoFilename:视频路径
* @param thumbFilename:图片保存路径
* @param width:图片长
* @param height:图片宽
* @param hour:指定时
* @param min:指定分
* @param sec:指定秒
* @throws IOException
* @throws InterruptedException
*/
public void getThumb(String videoFilename, String thumbFilename, int width, int height, int hour, int min,
float sec) throws IOException, InterruptedException {
ProcessBuilder processBuilder = new ProcessBuilder(ffmpegApp, "-y", "-i", videoFilename, "-vframes", "1", "-ss",
hour + ":" + min + ":" + sec, "-f", "mjpeg", "-s", width + "*" + height, "-an", thumbFilename);
Process process = processBuilder.start();
InputStream stderr = process.getErrorStream();
InputStreamReader isr = new InputStreamReader(stderr);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null)
;
process.waitFor();
if (br != null)
br.close();
if (isr != null)
isr.close();
if (stderr != null)
stderr.close();
}
/****
* 获取指定时间内的图片
*
* @param ffmpeg:ffmpeg插件路径
* @param localMp4:本地mp4保存路径
* @param localMp4Img:本地mp4图片保存路径
* @throws IOException
* @throws InterruptedException
*/
public static void getVidioImg(String ffmpeg,String localMp4,String localMp4Img) throws Exception{
VideoThumbTaker videoThumbTaker = new VideoThumbTaker(ffmpeg);
videoThumbTaker.getThumb(localMp4, localMp4Img, 800,600, 0, 0, 0.5f);
}
/**
* 获取视频总时间
* @param viedo_path 视频路径
* @param ffmpeg_path ffmpeg路径
* @return
*/
public static int getVideoTime(String video_path, String ffmpeg_path) {
List<String> commands = new java.util.ArrayList<String>();
commands.add(ffmpeg_path);
commands.add("-i");
commands.add(video_path);
try {
ProcessBuilder builder = new ProcessBuilder();
builder.command(commands);
final Process p = builder.start();
//从输入流中读取视频信息
BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream()));
StringBuffer sb = new StringBuffer();
String line = "";
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
//从视频信息中解析时长
String regexDuration = "Duration: (.*?), start: (.*?), bitrate: (\\d*) kb\\/s";
Pattern pattern = Pattern.compile(regexDuration);
Matcher m = pattern.matcher(sb.toString());
if (m.find()) {
int time = getTimelen(m.group(1));
//log.info(video_path+",视频时长:"+time+", 开始时间:"+m.group(2)+",比特率:"+m.group(3)+"kb/s");
return time;
}
} catch (Exception e) {
log.error("获取音频时长失败:"+e);
}
return 0;
}
//格式:"00:00:10.68"
private static int getTimelen(String timelen){
int min=0;
String strs[] = timelen.split(":");
if (strs[0].compareTo("0") > 0) {
min+=Integer.valueOf(strs[0])*60*60;//秒
}
if(strs[1].compareTo("0")>0){
min+=Integer.valueOf(strs[1])*60;
}
if(strs[2].compareTo("0")>0){
min+=Math.round(Float.valueOf(strs[2]));
}
return min;
}
//测试方法
public static void main(String[] args) {
String ffmpegPath = "D:\\software\\ffmpeg\\bin\\ffmpeg.exe";
//VideoThumbTaker videoThumbTaker = new VideoThumbTaker("D:\\software\\ffmpeg\\bin\\ffmpeg.exe");
try {
/*videoThumbTaker.getThumb("D:\\videoMp4sLoc\\114265ef-beb6-437f-9015-2e9af8fa2b9a.mp4", "D:\\thumbTest222.png", 800,600, 0, 0, 1);
System.out.println("over");*/
System.out.println(getVideoTime("D:\\jpg\\22.mp3",ffmpegPath));
} catch (Exception e) {
e.printStackTrace();
}
}
}
// JavaScript Document
jQuery.extend({
createUploadIframe: function(id, uri)
{
//create frame
var frameId = 'jUploadFrame' + id;
if(window.ActiveXObject) {
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
if(typeof uri== 'boolean'){
io.src = 'javascript:false';
}
else if(typeof uri== 'string'){
io.src = uri;
}
}
else {
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
io.style.top = '-1000px';
io.style.left = '-1000px';
document.body.appendChild(io);
return io;
},
createUploadForm: function(id, fileElementId)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = s.fileElementId;
var form = jQuery.createUploadForm(id, s.fileElementId);
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
if( s.global && ! jQuery.active++ )
{
// Watch for a new set of requests
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {};
if( s.global )
{
jQuery.event.trigger("ajaxSend", [xml, s]);
}
var uploadCallback = function(isTimeout)
{
// Wait for a response to come back
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if( xml || isTimeout == "timeout")
{
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if( status != "error" )
{
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData( xml, s.dataType );
if( s.success )
{
// ifa local callback was specified, fire it and pass it the data
s.success( data, status );
};
if( s.global )
{
// Fire the global callback
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
};
} else
{
jQuery.handleError(s, xml, status);
}
} catch(e)
{
status = "error";
jQuery.handleError(s, xml, status, e);
};
if( s.global )
{
// The request was completed
jQuery.event.trigger( "ajaxComplete", [xml, s] );
};
// Handle the global AJAX counter
if(s.global && ! --jQuery.active)
{
jQuery.event.trigger("ajaxStop");
};
if(s.complete)
{
s.complete(xml, status);
} ;
jQuery(io).unbind();
setTimeout(function()
{ try
{
jQuery(io).remove();
jQuery(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100);
xml = null;
};
}
// Timeout checker
if( s.timeout > 0 )
{
setTimeout(function(){
if( !requestDone )
{
// Check to see ifthe request is still happening
uploadCallback( "timeout" );
}
}, s.timeout);
}
try
{
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if(form.encoding)
{
form.encoding = 'multipart/form-data';
}
else
{
form.enctype = 'multipart/form-data';
}
jQuery(form).submit();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if(window.attachEvent){
document.getElementById(frameId).attachEvent('onload', uploadCallback);
}
else{
document.getElementById(frameId).addEventListener('load', uploadCallback, false);
}
return {abort: function () {}};
},
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || s, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
},
uploadHttpData: function( r, type ) {
var data = !type;
data = type == "xml" || data ? r.responseXML : r.responseText;
// ifthe type is "script", eval it in global context
if( type == "script" )
{
jQuery.globalEval( data );
}
// Get the JavaScript object, ifJSON is used.
if( type == "json" )
{
eval( "data = " + data );
}
// evaluate scripts within html
if( type == "html" )
{
jQuery("<div>").html(data).evalScripts();
}
return data;
}
});
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_cate" property="goodsCate" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="settle_price" property="settleUnit" jdbcType="DECIMAL" />
<result column="settle_amount" property="settlePrice" jdbcType="DECIMAL" />
<result column="regist_key" property="registKey" jdbcType="VARCHAR" />
<result column="producer_name" property="producerName" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入BillBackDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.settleBillNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.settleQty},
#{obj.unit},
#{obj.settlePrice},
#{obj.settleAmount},
#{obj.registKey},
#{obj.producerName},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.create_time},
#{obj.update_time},
#{obj.goodsCate}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.entity.medplan;
import java.util.List;
public class MedPlanDto {
private List<MedPlan> list;
public List<MedPlan> getList() {
return list;
}
public void setList(List<MedPlan> list) {
this.list = list;
}
}
package com.phxl.modules.goods.entity.suoutstore;
public class SuOutStoreWithDetail {
public SuOutStore getBill() {
return bill;
}
public void setBill(SuOutStore bill) {
this.bill = bill;
}
private SuOutStore bill;
}
package com.phxl.modules.goods.entity.hisCtMedicineMaterial;
import java.math.BigDecimal;
/**
*
* @ClassName: HisCtMedicineMaterial
* @Description: 药品目录表实体类
* @author zhangbing
* @date 2018-09-18 14:44:26
*
*/
public class HisCtMedicineMaterial{
private String id;
private String medCode; //HIS库房编码
private String medName; //HIS库房名称
public String getMedCode() {
return medCode;
}
private String goodsCode; //HIS商品编码
private String goodsSpec; //规格
private String goodsName; //商品名称
private String sName; //通用名称
private String pName; //打印名称
private String helpCode; //助记码
private String producer; //生产厂商
private String agentName; //代理商/售后服务机构
private String medGoodsCateGUID; //商品类别GUID
private String medGoodsCateName; //商品类别名称
private String registKey; //批准文号
private BigDecimal price; //采购价
private BigDecimal salePrice; //零售价
private BigDecimal batSalePrice; //批发价
private String productionAddress; //产地
private String dosageForm; //剂型
private BigDecimal length; //长
private BigDecimal width; //宽
private BigDecimal height; //高
private BigDecimal grossWeight; //毛重
private BigDecimal netWeight; //净重
private String unitStyle; //计量单位,最小单位:支、片等
private String bigUnitStyle; //大包装单位
private BigDecimal bigUnitQty; //大包装含量
private String bigBcd; //大包装条码
private String minUnitStyle; //小包装单位
private BigDecimal minUnitQty; //小包装含量
private String litBcd; //小包装条码
private String isLotCtrlInput; //批号必输检验
private String bizState; //业务状态
private String importedFlag; //生产来源
private String reportFlag; //报告药标识
private String noxiousFlag; //毒麻标识
private String drugNerveFlag; //精神药标识
private String productStandardCode; //产品本位码
private String specStandardCode; //规格本位码
private String brand; //品牌
private String coldFlag; //冷藏标识
private String supplierCode; //供应商编码
private String supplierName; //供应商名称
private String memo; //备注
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getsName() {
return sName;
}
public void setsName(String sName) {
this.sName = sName;
}
public String getpName() {
return pName;
}
public void setpName(String pName) {
this.pName = pName;
}
public String getHelpCode() {
return helpCode;
}
public void setHelpCode(String helpCode) {
this.helpCode = helpCode;
}
public String getProducer() {
return producer;
}
public void setProducer(String producer) {
this.producer = producer;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getMedGoodsCateGUID() {
return medGoodsCateGUID;
}
public void setMedGoodsCateGUID(String medGoodsCateGUID) {
this.medGoodsCateGUID = medGoodsCateGUID;
}
public String getMedGoodsCateName() {
return medGoodsCateName;
}
public void setMedGoodsCateName(String medGoodsCateName) {
this.medGoodsCateName = medGoodsCateName;
}
public String getRegistKey() {
return registKey;
}
public void setRegistKey(String registKey) {
this.registKey = registKey;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public BigDecimal getSalePrice() {
return salePrice;
}
public void setSalePrice(BigDecimal salePrice) {
this.salePrice = salePrice;
}
public BigDecimal getBatSalePrice() {
return batSalePrice;
}
public void setBatSalePrice(BigDecimal batSalePrice) {
this.batSalePrice = batSalePrice;
}
public String getProductionAddress() {
return productionAddress;
}
public void setProductionAddress(String productionAddress) {
this.productionAddress = productionAddress;
}
public String getDosageForm() {
return dosageForm;
}
public void setDosageForm(String dosageForm) {
this.dosageForm = dosageForm;
}
public BigDecimal getLength() {
return length;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public BigDecimal getWidth() {
return width;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public BigDecimal getHeight() {
return height;
}
public void setHeight(BigDecimal height) {
this.height = height;
}
public BigDecimal getGrossWeight() {
return grossWeight;
}
public void setGrossWeight(BigDecimal grossWeight) {
this.grossWeight = grossWeight;
}
public BigDecimal getNetWeight() {
return netWeight;
}
public void setNetWeight(BigDecimal netWeight) {
this.netWeight = netWeight;
}
public String getUnitStyle() {
return unitStyle;
}
public void setUnitStyle(String unitStyle) {
this.unitStyle = unitStyle;
}
public String getBigUnitStyle() {
return bigUnitStyle;
}
public void setBigUnitStyle(String bigUnitStyle) {
this.bigUnitStyle = bigUnitStyle;
}
public BigDecimal getBigUnitQty() {
return bigUnitQty;
}
public void setBigUnitQty(BigDecimal bigUnitQty) {
this.bigUnitQty = bigUnitQty;
}
public String getBigBcd() {
return bigBcd;
}
public void setBigBcd(String bigBcd) {
this.bigBcd = bigBcd;
}
public String getMinUnitStyle() {
return minUnitStyle;
}
public void setMinUnitStyle(String minUnitStyle) {
this.minUnitStyle = minUnitStyle;
}
public BigDecimal getMinUnitQty() {
return minUnitQty;
}
public void setMinUnitQty(BigDecimal minUnitQty) {
this.minUnitQty = minUnitQty;
}
public String getLitBcd() {
return litBcd;
}
public void setLitBcd(String litBcd) {
this.litBcd = litBcd;
}
public String getIsLotCtrlInput() {
return isLotCtrlInput;
}
public void setIsLotCtrlInput(String isLotCtrlInput) {
this.isLotCtrlInput = isLotCtrlInput;
}
public String getBizState() {
return bizState;
}
public void setBizState(String bizState) {
this.bizState = bizState;
}
public String getImportedFlag() {
return importedFlag;
}
public void setImportedFlag(String importedFlag) {
this.importedFlag = importedFlag;
}
public String getReportFlag() {
return reportFlag;
}
public void setReportFlag(String reportFlag) {
this.reportFlag = reportFlag;
}
public String getNoxiousFlag() {
return noxiousFlag;
}
public void setNoxiousFlag(String noxiousFlag) {
this.noxiousFlag = noxiousFlag;
}
public String getDrugNerveFlag() {
return drugNerveFlag;
}
public void setDrugNerveFlag(String drugNerveFlag) {
this.drugNerveFlag = drugNerveFlag;
}
public String getProductStandardCode() {
return productStandardCode;
}
public void setProductStandardCode(String productStandardCode) {
this.productStandardCode = productStandardCode;
}
public String getSpecStandardCode() {
return specStandardCode;
}
public void setSpecStandardCode(String specStandardCode) {
this.specStandardCode = specStandardCode;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getColdFlag() {
return coldFlag;
}
public void setColdFlag(String coldFlag) {
this.coldFlag = coldFlag;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<mvc:default-servlet-handler/>
<context:component-scan base-package="com.phxl.*" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!--设置最大上传文件501M-->
<property name="maxUploadSize" value="525336576"/>
<property name="resolveLazily" value="true"/>
</bean>
<!-- 处理JSON数据转换的 -->
<bean id="mappingJacksonHttpMessageConverter"
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
<value>text/xml;charset=UTF-8</value>
<value>application/xml;charset=UTF-8</value>
</list>
</property>
</bean>
<!-- SpringMVC在超出上传文件限制时,会抛出org.springframework.web.multipart.MaxUploadSizeExceededException -->
<!-- 该异常是SpringMVC在检查上传的文件信息时抛出来的,而且此时还没有进入到Controller方法中 -->
<!-- <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面
<prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">error</prop>
</props>
</property>
</bean> -->
</beans>
\ No newline at end of file
<root>
<facet id="jst.jaxrs">
<node name="libprov">
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
</node>
</facet>
</root>
package com.phxl.modules.goods.dao.invoiceback;
import java.util.List;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail;
public interface SuInvoiceBackDetailDao {
void batchInsert(List<SuInvoiceBackDetail> backDetails);
}
package com.phxl.modules.goods.web.spd;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.phxl.common.constants.PlatformConstant;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
import com.phxl.common.util.HTTPClient;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
import com.phxl.modules.goods.service.billback.BillBackService;
import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
import com.phxl.modules.goods.service.medinstore.MedInStoreService;
import com.phxl.modules.goods.service.medplan.MedPlanService;
import com.phxl.modules.goods.service.medstock.MedStockService;
import com.phxl.modules.goods.service.spills.HisSpillsService;
import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
@Controller
@RequestMapping(value = "/Api")
public class SpdControlller {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HisCtMedicineMaterialService ctMedicineMaterialService;
@Autowired
private InterfaceLogService interfaceLogService;
@Autowired
private HisCtDeptService hisCtDeptService;
@Autowired
private CTCareProvService cTCareProvService;
@Autowired
private MedSupplyGoodsService supplyGoodsService;
@Autowired
private MedStockService stockService;
@Autowired
private MedPlanService medPlanService;
@Autowired
private MedInStoreService medInStoreService;
@Autowired
private BillBackService backService;
@Autowired
private BillSettlementService billSettlementService;
@Autowired
private SupplierStockService supplierStockService;
@Autowired
private SuOutStoreService suOutStoreService;
@Autowired
private HisSpillsService hisSpillsService;
@Autowired
private SuInvoiceBackService suInvoiceBackService;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
logger.debug("药品目录接口请求参数:{}",medgoodsList);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
try {
materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
}
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
result = JSON.toJSONString(response);
//medgoodsList = ctMedicineMaterialService.createRequest();
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
@RequestMapping(value="/setHDept")
@ResponseBody
public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院科室资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtDept> depts = new ArrayList<HisCtDept>();
try {
depts = JSONObject.parseArray(params, HisCtDept.class);
int end = hisCtDeptService.batchSaveOrUpdate(depts);
if(end==1){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院人员资料接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedStaff")
@ResponseBody
public String setMedStaff(HttpServletRequest request, @RequestBody String params){
logger.debug("医院人员资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
boolean end = false;
try {
careProvs = JSONObject.parseArray(params, CTCareProv.class);
end = cTCareProvService.batchSaveOrUpdate(careProvs);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院采购目录接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMFSupplyGoods")
@ResponseBody
public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
logger.debug("医院采购目录接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
boolean end = false;
try {
supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
end = supplyGoodsService.batchSave(supplyGoods);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院库存接口
* @param request
* @param params
* @return
*/
@ResponseBody
@RequestMapping(value="/setMedStock",method = RequestMethod.POST)
public String setMedStock(HttpServletRequest request, @RequestBody String params){
logger.debug("HLI同步医院库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedStockList> stocks = new ArrayList<MedStockList>();
boolean end = false;
try {
stocks = JSONObject.parseArray(params, MedStockList.class);
end = stockService.batchSave(stocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院补货计划接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedPlan")
@ResponseBody
public String setMedPlan(HttpServletRequest request, @RequestBody String params){
logger.debug("补货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
boolean end = false;
try {
//改成批量的操作
medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
end = medPlanService.batchSave(medPlans);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院退货接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRMedRPI")
@ResponseBody
public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
logger.debug("医院退货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
boolean end = false;
try {
billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
end = backService.batchSave(billBacks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 结算单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRSettle")
@ResponseBody
public String setTRSettle(HttpServletRequest request, @RequestBody String params){
logger.debug("同步医院结算单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
boolean end = false;
try {
settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
end = billSettlementService.batchSave(settlementWithDetails);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商库存接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setStock")
@ResponseBody
public String setStock(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商同步库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
boolean end = false;
try {
supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
end = supplierStockService.batchSave(supplierStocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商出库单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTrmedwv")
@ResponseBody
public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
logger.debug("同步供应商出库单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
boolean end = false;
try {
suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
end = suOutStoreService.batchSave(suOutStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院盘点损溢接口
* @param request
* @param params
* @return
*/
@RequestMapping(value="/setTrDiff")
@ResponseBody
public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院盘点损溢接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
boolean end = false;
try {
spills = JSONObject.parseArray(params, HisSpillsList.class);
end = hisSpillsService.batchSave(spills);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商发票回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setInvoice")
@ResponseBody
public String setInvoice(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商发票回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
boolean end = false;
try {
suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/*
* 医院入库单回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedInStore")
@ResponseBody
public String setMedInStore(HttpServletRequest request, @RequestBody String params){
logger.debug("医院入库单回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
boolean end = false;
try {
//改成批量的操作
medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
end = medInStoreService.batchSave(medInStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/***
* 推送对账数据到平台
* @param params
* @return
*/
@RequestMapping("/pushBalance")
@ResponseBody
public String pushBalance(@RequestBody String params) {
logger.debug("推送对账数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送对账数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送发药数据到平台
* @param params
* @return
*/
@RequestMapping("/pushDispensing")
@ResponseBody
public String pushDispensing(@RequestBody String params){
logger.debug("推送发药数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送库存数据到平台
* @param params
* @return
*/
@RequestMapping("/pushStock")
@ResponseBody
public String pushStock(@RequestBody String params){
logger.debug("推送库存数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送库存数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicinfo")
@ResponseBody
public String pushlicinfo(@RequestBody String params){
logger.debug("证照数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照图片数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicpicinfo")
@ResponseBody
public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
String result = "";
String logId = IdUtil.uuid();
String exception = "";
PlatFormResponse response = new PlatFormResponse();
try {
if (file!=null) {
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
String fileName = file.getOriginalFilename();
String prefix = fileName.substring(fileName.lastIndexOf("."));
File newfile = File.createTempFile(System.currentTimeMillis() + "", prefix);
file.transferTo(newfile);
FileBody bin = new FileBody(newfile);
HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
post.setEntity(reqEntity);
HttpResponse htppresponse = client.execute(post);
HttpEntity resEntity = htppresponse.getEntity();
result = EntityUtils.toString(resEntity, "UTF-8");
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照图片数据给平台错误:参数为空");
}
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照图片数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
}
package com.phxl.modules.goods.entity.ctdept;
import java.util.Date;
/**
*
* @ClassName: HisCtDept
* @Description: 医院科室表实体类
* @author hehaihong
* @date 2018-08-08 09:28:47
*
*/
public class HisCtDept{
private String hdeptCode; //科室编码
private String hdeptName; //科室名称
private String helpCode; //助记码
private String upperGUID; //上级编号
private String isOrderRight; //是否有订货权限
private String category; //类别
private String director; //主管
private String state; //状态
private String isLastLevel; //是否末级
private Date create_time; //创建时间
private Date update_time; //更新时间
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHdeptCode() {
return hdeptCode;
}
public void setHdeptCode(String hdeptCode) {
this.hdeptCode = hdeptCode;
}
public String getHdeptName() {
return hdeptName;
}
public void setHdeptName(String hdeptName) {
this.hdeptName = hdeptName;
}
public String getHelpCode() {
return helpCode;
}
public void setHelpCode(String helpCode) {
this.helpCode = helpCode;
}
public String getUpperGUID() {
return upperGUID;
}
public void setUpperGUID(String upperGUID) {
this.upperGUID = upperGUID;
}
public String getIsOrderRight() {
return isOrderRight;
}
public void setIsOrderRight(String isOrderRight) {
this.isOrderRight = isOrderRight;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getIsLastLevel() {
return isLastLevel;
}
public void setIsLastLevel(String isLastLevel) {
this.isLastLevel = isLastLevel;
}
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medplan.MedPlan">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="bill_type" property="billType" jdbcType="VARCHAR" />
<result column="settle_type" property="settleType" jdbcType="VARCHAR" />
<result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
<result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
<result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medCode},
#{obj.medName},
#{obj.supplierCode},
#{obj.suppliername},
#{obj.billNo},
#{obj.billType},
#{obj.medDeptCode},
#{obj.medDeptName},
#{obj.medStoreCode},
#{obj.medStoreName},
#{obj.firstFlag},
#{obj.planBeginDate},
#{obj.planEndDate},
#{obj.memo},
#{obj.operaterName},
#{obj.inputDate},
#{obj.create_time},
#{obj.update_time}
</trim>
</foreach>
</insert>
<!-- 新增MedPlan-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{suppliername,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{billType,jdbcType=VARCHAR}
,#{settleType,jdbcType=VARCHAR}
,#{medDeptCode,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreCode,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{firstFlag,jdbcType=VARCHAR}
,#{planBeginDate,jdbcType=TIMESTAMP}
,#{planEndDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.entity.medplan;
public class MedPlanWithDetail {
public MedPlan getTrmedPlan() {
return trmedPlan;
}
public void setTrmedPlan(MedPlan trmedPlan) {
this.trmedPlan = trmedPlan;
}
private MedPlan trmedPlan;
}
package com.phxl.modules.goods.entity.invoiceback;
import java.math.BigDecimal;
import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
public class SuInvoiceBackDetail {
@JSONField(name="SettleBillNo")
private String settleBillNo; //结算单号
@JSONField(name="RowNo")
private int rowNo; //行号
@JSONField(name="GoodsCode")
private String goodsCode; //商品编码
public String getSettleBillNo() {
return settleBillNo;
}
public void setSettleBillNo(String settleBillNo) {
this.settleBillNo = settleBillNo;
}
public int getRowNo() {
return rowNo;
}
public void setRowNo(int rowNo) {
this.rowNo = rowNo;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getProducerName() {
return producerName;
}
public void setProducerName(String producerName) {
this.producerName = producerName;
}
public String getRegistKey() {
return registKey;
}
public void setRegistKey(String registKey) {
this.registKey = registKey;
}
public BigDecimal getSettleQty() {
return settleQty;
}
public void setSettleQty(BigDecimal settleQty) {
this.settleQty = settleQty;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public BigDecimal getSettlePrice() {
return settlePrice;
}
public void setSettlePrice(BigDecimal settlePrice) {
this.settlePrice = settlePrice;
}
public BigDecimal getSettleAmount() {
return settleAmount;
}
public void setSettleAmount(BigDecimal settleAmount) {
this.settleAmount = settleAmount;
}
public String getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(String invoiceNo) {
this.invoiceNo = invoiceNo;
}
public String getInvoiceCode() {
return invoiceCode;
}
public void setInvoiceCode(String invoiceCode) {
this.invoiceCode = invoiceCode;
}
public Date getInvoiceTime() {
return invoiceTime;
}
public void setInvoiceTime(Date invoiceTime) {
this.invoiceTime = invoiceTime;
}
public BigDecimal getInvoiceAmount() {
return invoiceAmount;
}
public void setInvoiceAmount(BigDecimal invoiceAmount) {
this.invoiceAmount = invoiceAmount;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getSettleDate() {
return settleDate;
}
public void setSettleDate(Date settleDate) {
this.settleDate = settleDate;
}
@JSONField(name="GoodsName")
private String goodsName; //商品名称
@JSONField(name="GoodsSpec")
private String goodsSpec; //商品规格
@JSONField(name="ProducerName")
private String producerName; //生产厂商名称
@JSONField(name="RegistKey")
private String registKey; //批准文号
@JSONField(name="SettleQty")
private BigDecimal settleQty; //结算数量
@JSONField(name="Unit")
private String unit; //包装单位
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
@JSONField(name="SettlePrice")
private BigDecimal settlePrice; //结算价格
@JSONField(name="SettleAmount")
private BigDecimal settleAmount; //结算金额
@JSONField(name="CREATE_TIME",format="yyyy-MM-dd HH:mm:ss")
private Date create_time; //创建时间
@JSONField(name="UPDATE_TIME",format="yyyy-MM-dd HH:mm:ss")
private Date update_time; //更新时间
@JSONField(name="InvoiceNo")
private String invoiceNo; //发票号
@JSONField(name="InvoiceCode")
private String invoiceCode; //发票代码
@JSONField(name="InvoiceTime")
private Date invoiceTime; //发票日期
@JSONField(name="InvoiceAmount")
private BigDecimal invoiceAmount; //发票金额
private String id;
//供应商code
@JSONField(name="SupplierCode")
private String supplierCode;
//供应商名称
@JSONField(name="SupplierName")
private String supplierName;
//结算日期
@JSONField(name="SettleDate")
private Date settleDate;
}
package com.phxl.modules.goods.entity.medinstore;
import java.util.Date;
import java.util.List;
public class MedInStore {
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getMedGuid() {
return medGuid;
}
public void setMedGuid(String medGuid) {
this.medGuid = medGuid;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getMedDeptGuid() {
return medDeptGuid;
}
public void setMedDeptGuid(String medDeptGuid) {
this.medDeptGuid = medDeptGuid;
}
public String getMedDeptName() {
return medDeptName;
}
public void setMedDeptName(String medDeptName) {
this.medDeptName = medDeptName;
}
public String getMedStoreGuid() {
return medStoreGuid;
}
public void setMedStoreGuid(String medStoreGuid) {
this.medStoreGuid = medStoreGuid;
}
public String getMedStoreName() {
return medStoreName;
}
public void setMedStoreName(String medStoreName) {
this.medStoreName = medStoreName;
}
public String getSupplierGuid() {
return supplierGuid;
}
public void setSupplierGuid(String supplierGuid) {
this.supplierGuid = supplierGuid;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getBillDate() {
return billDate;
}
public void setBillDate(Date billDate) {
this.billDate = billDate;
}
public String getBillType() {
return billType;
}
public void setBillType(String billType) {
this.billType = billType;
}
public String getCountSum() {
return countSum;
}
public void setCountSum(String countSum) {
this.countSum = countSum;
}
public String getDetailSum() {
return detailSum;
}
public void setDetailSum(String detailSum) {
this.detailSum = detailSum;
}
public String getOperaterName() {
return operaterName;
}
public void setOperaterName(String operaterName) {
this.operaterName = operaterName;
}
public Date getInputDate() {
return inputDate;
}
public void setInputDate(Date inputDate) {
this.inputDate = inputDate;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
public List<MedInStoreDetail> getBilldetaillist() {
return billdetaillist;
}
public void setBilldetaillist(List<MedInStoreDetail> billdetaillist) {
this.billdetaillist = billdetaillist;
}
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
private String billNo;
private String medGuid;
private String medName;
private String medDeptGuid;
private String medDeptName;
private String medStoreGuid;
private String medStoreName;
private String supplierGuid;
private String supplierName;
private Date billDate;
private String billType;
private String countSum;
private String detailSum;
private String operaterName;
private Date inputDate;
private String memo;
private Date create_time;
private Date update_time;
private List<MedInStoreDetail> billdetaillist;
}
package com.phxl.common.util;
import java.util.UUID;
/**
* 生成ID、流水号等标识串常用工具类 <br/>
*/
public class IdentifieUtil {
/**
* 获取GuId
* @return String
*/
public static String getGuId(){
UUID uuid = UUID.randomUUID();
// 得到对象产生的ID
String guId = uuid.toString();
// 转换为大写
guId = guId.toUpperCase();
// 替换 -
guId = guId.replaceAll("-", "");
return guId;
}
private final static char[] DIGITS64 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"
.toCharArray();
public static String get26GuId() {
UUID u = UUID.randomUUID();
// 转换为大写
String guId = toIDString(u.getMostSignificantBits()) + toIDString(u.getLeastSignificantBits());
guId = guId.toUpperCase();
if(guId.contains("-") || guId.contains("_")){
guId = get26GuId();
}
return guId;
}
private static String toIDString(long l) {
char[] buf = "0000000000000".toCharArray(); // 限定13位长度
int length = 11;
long least = 63L; // 0x0000003FL
do {
buf[--length] = DIGITS64[(int) (l & least)]; // l & least取低6位
l >>>= 6;
} while (l != 0);
return new String(buf);
}
/**
* 测试
*/
public static void main(String[] args) {
System.out.println(getGuId());
}
}
\ No newline at end of file
package com.phxl.modules.goods.service.billsettlement;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.Now;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.util.DateUtils;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.billsettlement.BillSettlementDao;
import com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
@Service
public class BillSettlementService{
@Autowired
private BillSettlementDao billSettlementDao;
@Autowired
private BillSettlementDetailDao billSettlementDetailDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public boolean batchSave(List<BillSettlementWithDetail> settlementWithDetails) {
boolean result = true;
try {
checkBillSettlement(settlementWithDetails);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
for (BillSettlementWithDetail settlement : settlementWithDetails) {
BillSettlement billSettlement = settlement.getTRSettle();
List<BillSettlementDetail> details = new ArrayList<BillSettlementDetail>();
details = settlement.getTRSettle().getTRSettleDetail();
String id = IdUtil.uuid();
Integer rowno = 1;
billSettlement.setId(id);
if(details != null && details.size() != 0){
for (BillSettlementDetail billSettlementDetail : details) {
billSettlementDetail.setSettleBillNo(billSettlement.getSettleBillNo());
billSettlementDetail.setId(id);
billSettlementDetail.setRowNo(rowno);
billSettlementDetail.setCreate_time(new Date());
billSettlementDetail.setUpdate_time(new Date());
rowno ++;
}
billSettlementDao.insert(billSettlement);
billSettlementDetailDao.batchInsert(details);
}
}
return result;
}
private void checkBillSettlement(List<BillSettlementWithDetail> settlementWithDetails) {
if(settlementWithDetails == null || settlementWithDetails.size() == 0){
logger.error("无相应结算单据信息");
throw new BaseException("无相应结算单据信息");
}
for (BillSettlementWithDetail billSettlementWithDetail : settlementWithDetails) {
BillSettlement billSettlement = billSettlementWithDetail.getTRSettle();
String settleBillNo = billSettlement.getSettleBillNo();
if (StringUtils.isEmpty(settleBillNo)) {
logger.error("结算单结算单号不能为空");
throw new BaseException("结算单结算单号不能为空");
}
Date settleDate = billSettlement.getSettleDate();
if (settleDate == null) {
logger.error("结算单结算单号:"+settleBillNo+"结算单结算单日期不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+"结算单结算单日期不能为空");
}
List<BillSettlementDetail> details = billSettlement.getTRSettleDetail();
if(details == null || details.size() == 0){
logger.error("结算单结算单号:"+settleBillNo+"无相应结算单据明细信息");
throw new BaseException("结算单结算单号:"+settleBillNo+"无相应结算单据明细信息");
}
String useBillNo = billSettlement.getUseBillNo();
if (StringUtils.isEmpty(useBillNo)) {
logger.error("结算单结算单号:"+settleBillNo+","+"结算单发药单据编号不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+", "+"结算单明细发药单据编号不能为空");
}
for (BillSettlementDetail billSettlementDetail : details) {
String detailSettleBillNo = billSettlementDetail.getSettleBillNo();
if (StringUtils.isEmpty(detailSettleBillNo)) {
logger.error("结算单结算单号:"+settleBillNo+"结算单明细结算单号不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+"结算单明细结算单号不能为空");
}
int rowNo = billSettlementDetail.getRowNo();
if (rowNo == 0) {
logger.error("结算单结算单号:"+settleBillNo+"结算单明细行号不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+"结算单明细行号不能为空");
}
String purchaser_GoodsCode = billSettlementDetail.getGoodsCode();
if (StringUtils.isEmpty(purchaser_GoodsCode)) {
logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品编码不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品编码不能为空");
}
String purchase_GoodsName = billSettlementDetail.getGoodsName();
if (StringUtils.isEmpty(purchase_GoodsName)) {
logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品名称不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_商品名称不能为空");
}
BigDecimal purchase_SettleQty = billSettlementDetail.getSettleQty();
if (purchase_SettleQty == null) {
logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_结算数量不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_结算数量不能为空");
}
String purchase_Unit = billSettlementDetail.getUnit();
if (StringUtils.isEmpty(purchase_Unit)) {
logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_包装单位不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细采购方_包装单位不能为空");
}
Date productionDate = billSettlementDetail.getProductionDate();
if (productionDate == null) {
logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细生产日期前不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细生产日期前不能为空");
}
Date expireDate = billSettlementDetail.getExpireDate();
if (expireDate == null) {
logger.error("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细有效日期不能为空");
throw new BaseException("结算单结算单号:"+settleBillNo+",行号:"+rowNo+"结算单明细有效日期不能为空");
}
}
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.ctdept.HisCtDeptDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.ctdept.HisCtDept">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
<result column="hdept_name" property="hdeptName" jdbcType="VARCHAR" />
<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
<result column="upper_GUID" property="upperGUID" jdbcType="VARCHAR" />
<result column="is_order_right" property="isOrderRight" jdbcType="VARCHAR" />
<result column="category" property="category" jdbcType="VARCHAR" />
<result column="director" property="director" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="VARCHAR" />
<result column="is_last_level" property="isLastLevel" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 批量查询 -->
<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from med_hli_dept
<if test="ctcpCodes != null">
where hdept_code in
<foreach item="item" index="index" collection="ctcpCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.hdeptCode},
#{obj.hdeptName},
#{obj.helpCode},
#{obj.upperGUID},
#{obj.isOrderRight},
#{obj.category},
#{obj.director},
#{obj.state},
#{obj.isLastLevel},
#{obj.create_time},
#{obj.update_time}
</trim>
</foreach>
</insert>
<update id="batchUpdate" parameterType="list">
update med_hli_dept
<trim prefix="set" suffixOverrides=",">
<trim prefix="hdept_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
when id = #{obj.id}
then #{obj.hdeptCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="hdept_name=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptName != null and obj.hdeptName != ''">
when id = #{obj.id}
then
#{obj.hdeptName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="upper_GUID=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.upperGUID != null and obj.upperGUID != ''">
when id = #{obj.id}
then #{obj.upperGUID,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="is_order_right=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.isOrderRight != null and obj.isOrderRight != ''">
when id = #{obj.id}
then #{obj.isOrderRight,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="director=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.director != null and obj.director != ''">
when id = #{obj.id}
then #{obj.director,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="state=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.state != null and obj.state != ''">
when id = #{obj.id}
then #{obj.state,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="is_last_level=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.isLastLevel != null and obj.isLastLevel != ''">
when id = #{obj.id}
then #{obj.isLastLevel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.create_time != null">
when id = #{obj.id}
then #{obj.create_time,jdbcType=DATE}
</if>
</foreach>
</trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.update_time != null">
when id = #{obj.id}
then #{obj.update_time,jdbcType=DATE}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="obj" index="index">
id
= #{obj.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
/**
* Copyright &copy; 2012-2016 <a href="https://github.com/phxl/medicinal">medicinal</a> All rights reserved.
*/
package com.phxl.common.util;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.io.DefaultResourceLoader;
/**
* 全局配置类
* @author phxl
* @version 2014-06-25
*/
public class Global {
/**
* 当前对象实例
*/
private static Global global = new Global();
/**
* 保存全局属性值
*/
private static Map<String, String> map = new HashMap<String,String>();
/**
* 属性文件加载对象
*/
private static PropertiesLoader loader = new PropertiesLoader("config.properties");
/**
* 显示/隐藏
*/
public static final String SHOW = "1";
public static final String HIDE = "0";
/**
* 是/否
*/
public static final String YES = "1";
public static final String NO = "0";
/**
* 对/错
*/
public static final String TRUE = "true";
public static final String FALSE = "false";
/**
* 上传文件基础虚拟路径
*/
public static final String USERFILES_BASE_URL = "/userfiles/";
/**
* 获取当前对象实例
*/
public static Global getInstance() {
return global;
}
/**
* 获取配置
* @see ${fns:getConfig('adminPath')}
*/
public static String getConfig(String key) {
String value = map.get(key);
if (value == null){
value = loader.getProperty(key);
map.put(key, value != null ? value : StringUtils.EMPTY);
}
return value;
}
/**
* 获取管理端根路径
*/
public static String getAdminPath() {
return getConfig("adminPath");
}
/**
* 获取前端根路径
*/
public static String getFrontPath() {
return getConfig("frontPath");
}
/**
* 获取URL后缀
*/
public static String getUrlSuffix() {
return getConfig("urlSuffix");
}
/**
* 是否是演示模式,演示模式下不能修改用户、角色、密码、菜单、授权
*/
public static Boolean isDemoMode() {
String dm = getConfig("demoMode");
return "true".equals(dm) || "1".equals(dm);
}
/**
* 在修改系统用户和角色时是否同步到Activiti
*/
public static Boolean isSynActivitiIndetity() {
String dm = getConfig("activiti.isSynActivitiIndetity");
return "true".equals(dm) || "1".equals(dm);
}
/**
* 页面获取常量
* @see ${fns:getConst('YES')}
*/
public static Object getConst(String field) {
try {
return Global.class.getField(field).get(null);
} catch (Exception e) {
// 异常代表无配置,这里什么也不做
}
return null;
}
/**
* 获取上传文件的根目录
* @return
*/
public static String getUserfilesBaseDir() {
String dir = getConfig("userfiles.basedir");
/* if (StringUtils.isBlank(dir)){
try {
dir = ServletContextFactory.getServletContext().getRealPath("/");
} catch (Exception e) {
return "";
}
}
if(!dir.endsWith("/")) {
dir += "/";
}*/
// System.out.println("userfiles.basedir: " + dir);
return dir;
}
/**
* 获取工程路径
* @return
*/
public static String getProjectPath(){
// 如果配置了工程路径,则直接返回,否则自动获取。
String projectPath = Global.getConfig("projectPath");
if (StringUtils.isNotBlank(projectPath)){
return projectPath;
}
try {
File file = new DefaultResourceLoader().getResource("").getFile();
if (file != null){
while(true){
File f = new File(file.getPath() + File.separator + "src" + File.separator + "main");
if (f == null || f.exists()){
break;
}
if (file.getParentFile() != null){
file = file.getParentFile();
}else{
break;
}
}
projectPath = file.toString();
}
} catch (IOException e) {
e.printStackTrace();
}
return projectPath;
}
}
/**
* 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.
*/
package com.phxl.common.util;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
/**
* 系统配置工具<br/>
* 加载系统Properties配置文件至内存中<br/>
* @Date 2015年6月29日 下午5:13:50
* @author shijingbang
* @version 1.0
* @since JDK 1.6
*/
@Component
public class SystemConfig {
private static final Logger logger = LoggerFactory.getLogger(SystemConfig.class);
private static final Properties properties = new Properties();
@PostConstruct
public void init() throws IOException {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(this.getClass().getClassLoader());
//Resource[] resources = resolver.getResources("classpath:**/spring/*.properties");
Resource[] resources = resolver.getResources("classpath:**/*.properties");
for (Resource resource : resources) {
if (logger.isDebugEnabled()) {
logger.debug("加载Properties配置文件{}", resource.getFilename());
}
properties.load(resource.getInputStream());
}
if(logger.isDebugEnabled()){
Map<String, Object> configuration = MapUtils.typedSortedMap(new TreeMap(properties), String.class, Object.class);
//logger.debug("****************系统配置参数表****************\n{}", JSONUtils.toPrettyJsonLoosely(configuration));
}
}
/**
* 根据key找出value值
* @param key 键
* @return String
* @author shijingbang
*/
public static String getProperty(String key) {
return properties.getProperty(key);
}
/**
* 根据key找出value值.没有找到则返回第二个参数的值
* @param key 键
* @param defaultValue 默认值
* @return String
* @author shijingbang
*/
public static String getProperty(String key, String defaultValue) {
return properties.getProperty(key, defaultValue);
}
/**
* 获取整数参数值
* @param key
* @return Integer
*/
public static Integer getIntProperty(String key){
String value = properties.getProperty(key);
if(StringUtils.isNotBlank(value)){
return Integer.parseInt(value);
}
return null;
}
/**
* 获取整数参数值,必需指定默认值
* @param key
* @param defaultValue
* @return int
*/
public static int getIntProperty(String key, Integer defaultValue){
//LocalAssert.notNull(defaultValue, "defaultValue,不能为空");
String value = properties.getProperty(key);
if(StringUtils.isBlank(value)){
return defaultValue;
}
return Integer.parseInt(value);
}
/**
* 检查是否包含指定key
* @param key
* @return boolean
* @author shijingbang
*/
public static boolean containsKey(Object key) {
return properties.containsKey(key);
}
/**
* 检查系统环境是否包含指定值
* @param value
* @return boolean
* @author shijingbang
*/
public static boolean containsValue(Object value) {
return properties.containsValue(value);
}
}
/**
* Copyright &copy; 2012-2016 <a href="https://github.com/phxl/medicinal">medicinal</a> All rights reserved.
*/
package com.phxl.common.util;
import java.io.IOException;
import java.util.TimeZone;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.util.JSONPObject;
/**
* 简单封装Jackson,实现JSON String<->Java Object的Mapper.
* 封装不同的输出风格, 使用不同的builder函数创建实例.
* @author phxl
* @version 2013-11-15
*/
public class JsonMapper extends ObjectMapper {
private static final long serialVersionUID = 1L;
private static Logger logger = LoggerFactory.getLogger(JsonMapper.class);
private static JsonMapper mapper;
public JsonMapper() {
this(Include.NON_EMPTY);
}
public JsonMapper(Include include) {
// 设置输出时包含属性的风格
if (include != null) {
this.setSerializationInclusion(include);
}
// 允许单引号、允许不带引号的字段名称
this.enableSimple();
// 设置输入时忽略在JSON字符串中存在但Java对象实际没有的属性
this.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
// 空值处理为空串
this.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>(){
@Override
public void serialize(Object value, JsonGenerator jgen,
SerializerProvider provider) throws IOException,
JsonProcessingException {
jgen.writeString("");
}
});
// 进行HTML解码。
this.registerModule(new SimpleModule().addSerializer(String.class, new JsonSerializer<String>(){
@Override
public void serialize(String value, JsonGenerator jgen,
SerializerProvider provider) throws IOException,
JsonProcessingException {
jgen.writeString(StringEscapeUtils.unescapeHtml4(value));
}
}));
// 设置时区
this.setTimeZone(TimeZone.getDefault());//getTimeZone("GMT+8:00")
/* try {
this.writerWithType(Void.TYPE).writeValueAsBytes(null);
} catch (JsonProcessingException e) {
e.printStackTrace();
}*/
}
/**
* 创建只输出非Null且非Empty(如List.isEmpty)的属性到Json字符串的Mapper,建议在外部接口中使用.
*/
public static JsonMapper getInstance() {
if (mapper == null){
mapper = new JsonMapper().enableSimple();
}
return mapper;
}
/**
* 创建只输出初始值被改变的属性到Json字符串的Mapper, 最节约的存储方式,建议在内部接口中使用。
*/
public static JsonMapper nonDefaultMapper() {
if (mapper == null){
mapper = new JsonMapper(Include.NON_DEFAULT);
}
return mapper;
}
/**
* Object可以是POJO,也可以是Collection或数组。
* 如果对象为Null, 返回"null".
* 如果集合为空集合, 返回"[]".
*/
public String toJson(Object object) {
try {
return this.writeValueAsString(object);
} catch (IOException e) {
logger.warn("write to json string error:" + object, e);
return null;
}
}
/**
* 反序列化POJO或简单Collection如List<String>.
*
* 如果JSON字符串为Null或"null"字符串, 返回Null.
* 如果JSON字符串为"[]", 返回空集合.
*
* 如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String,JavaType)
* @see #fromJson(String, JavaType)
*/
public <T> T fromJson(String jsonString, Class<T> clazz) {
if (StringUtils.isEmpty(jsonString)) {
return null;
}
try {
return this.readValue(jsonString, clazz);
} catch (IOException e) {
logger.warn("parse json string error:" + jsonString, e);
return null;
}
}
/**
* 反序列化复杂Collection如List<Bean>, 先使用函數createCollectionType构造类型,然后调用本函数.
* @see #createCollectionType(Class, Class...)
*/
@SuppressWarnings("unchecked")
public <T> T fromJson(String jsonString, JavaType javaType) {
if (StringUtils.isEmpty(jsonString)) {
return null;
}
try {
return (T) this.readValue(jsonString, javaType);
} catch (IOException e) {
logger.warn("parse json string error:" + jsonString, e);
return null;
}
}
/**
* 構造泛型的Collection Type如:
* ArrayList<MyBean>, 则调用constructCollectionType(ArrayList.class,MyBean.class)
* HashMap<String,MyBean>, 则调用(HashMap.class,String.class, MyBean.class)
*/
public JavaType createCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
return this.getTypeFactory().constructParametricType(collectionClass, elementClasses);
}
/**
* 當JSON裡只含有Bean的部分屬性時,更新一個已存在Bean,只覆蓋該部分的屬性.
*/
@SuppressWarnings("unchecked")
public <T> T update(String jsonString, T object) {
try {
return (T) this.readerForUpdating(object).readValue(jsonString);
} catch (JsonProcessingException e) {
logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
} catch (IOException e) {
logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
}
return null;
}
/**
* 輸出JSONP格式數據.
*/
public String toJsonP(String functionName, Object object) {
return toJson(new JSONPObject(functionName, object));
}
/**
* 設定是否使用Enum的toString函數來讀寫Enum,
* 為False時時使用Enum的name()函數來讀寫Enum, 默認為False.
* 注意本函數一定要在Mapper創建後, 所有的讀寫動作之前調用.
*/
public JsonMapper enableEnumUseToString() {
this.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
this.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
return this;
}
/**
* 允许单引号
* 允许不带引号的字段名称
*/
public JsonMapper enableSimple() {
this.configure(Feature.ALLOW_SINGLE_QUOTES, true);
this.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
return this;
}
/**
* 取出Mapper做进一步的设置或使用其他序列化API.
*/
public ObjectMapper getMapper() {
return this;
}
/**
* 对象转换为JSON字符串
* @param object
* @return
*/
public static String toJsonString(Object object){
return JsonMapper.getInstance().toJson(object);
}
/**
* JSON字符串转换为对象
* @param jsonString
* @param clazz
* @return
*/
public static Object fromJsonString(String jsonString, Class<?> clazz){
return JsonMapper.getInstance().fromJson(jsonString, clazz);
}
/**
* 测试
*/
public static void main(String[] args) {
/*List<Map<String, Object>> list = Lists.newArrayList();
Map<String, Object> map = Maps.newHashMap();
map.put("id", 1);
map.put("pId", -1);
map.put("name", "根节点");
list.add(map);
map = Maps.newHashMap();
map.put("id", 2);
map.put("pId", 1);
map.put("name", "你好");
map.put("open", true);
list.add(map);
String json = JsonMapper.getInstance().toJson(list);
System.out.println(json);*/
}
}
package com.phxl.common.constants;
public class HisRequestConstant {
public static final String APPLICATION_XML = "application/xml";
public static final String TEXT_XML = "text/xml";
}
package com.phxl.modules.goods.entity.billback;
import com.alibaba.fastjson.annotation.JSONField;
/**
* @ClassName BillBackWithDetail
* @Description TODO
* @Author json
* @Date 2018/11/1 19:22
**/
public class BillBackWithDetail {
@JSONField(name = "TRMedRPI")
private BillBack TRMedRPI;
public BillBack getTRMedRPI() {
return TRMedRPI;
}
public void setTRMedRPI(BillBack TRMedRPI) {
this.TRMedRPI = TRMedRPI;
}
}
package com.phxl.modules.goods.entity.invoiceback;
public class SuInvoiceBackWithDetail {
private SuInvoiceBack bill;
public SuInvoiceBack getBill() {
return bill;
}
public void setBill(SuInvoiceBack bill) {
this.bill = bill;
}
}
package com.phxl.modules.goods.entity.medstock;
public class MedStockList {
public MedStock getData() {
return data;
}
public void setData(MedStock data) {
this.data = data;
}
private MedStock data;
}
package com.phxl.modules.goods.service.supplierstock;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.supplierstock.SupplierStockDao;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
@Service
public class SupplierStockService{
@Autowired
private SupplierStockDao supplierStockDao;
private static Log log = LogFactory.getLog(SupplierStockService.class);
public boolean batchSave(List<SupplierStockList> supplierStocks) {
boolean result = false;
if (supplierStocks != null && supplierStocks.size() != 0) {
for (SupplierStockList supplierStockList : supplierStocks) {
SupplierStock supstock = supplierStockList.getData();
try {
checkStock(supstock);
} catch (Exception e) {
String json = JsonMapper.toJsonString(supstock);
log.error("同步医院库存:" + json + "信息异常");
throw new BaseException(e.getMessage());
}
supstock.setId(IdUtil.uuid());
supplierStockDao.insert(supstock);
}
result = true;
}
return result;
}
private void checkStock(SupplierStock supplierStock) {
//获取信息中供应商信息
String suppliercode = supplierStock.getSuppliercode();
String suppliername = supplierStock.getSuppliername();
if(StringUtils.isEmpty(suppliercode) || StringUtils.isEmpty(suppliername)){
log.error("供应商库存信息供应商编号以及供应商名称不能为空");
throw new BaseException("供应商库存信息供应商编号以及供应商名称不能为空");
}
//获取信息中商品信息
String goodsCode = supplierStock.getGoodsCode();
String goodsName = supplierStock.getGoodsName();
if(StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)){
log.error("供应商库存信息商品编码以及商品名称不能为空");
throw new BaseException("供应商库存信息商品编码以及商品名称不能为空");
}
//库存批号信息
String lot = supplierStock.getLot();
if(StringUtils.isEmpty(lot)){
log.error("供应商库存信息库存批号不能为空");
throw new BaseException("供应商库存信息库存批号不能为空");
}
Date productionDate = supplierStock.getProductionDate();
if(productionDate == null){
log.error("供应商库存信息库存生产日期不能为空");
throw new BaseException("供应商库存信息库存生产日期不能为空");
}
Date expireDate = supplierStock.getExpireDate();
if(expireDate == null){
log.error("供应商库存信息库存有效期至不能为空");
throw new BaseException("供应商库存信息库存有效期至不能为空");
}
}
}
package com.phxl.modules.goods.dao.ctdept;
import java.util.List;
import java.util.Map;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
/**
*
* @ClassName: HisCtDeptDao
* @Description: HisCtDept数据访问接口
* @author hehaihong
* @date 2018-08-08 09:28:47
*
*/
public interface HisCtDeptDao{
/**
* 批量获取数据
* @param map
* @return
*/
public List<HisCtDept> batchSelect(Map<String,Object> map);
public void batchUpdate(List<HisCtDept> updateList);
public void batchInsert(List<HisCtDept> insertList);
}
\ No newline at end of file
package com.phxl.modules.goods.service.medstock;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.medstock.MedStockDao;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
@Service
public class MedStockService{
@Autowired
private MedStockDao stockDao;
private static Log log = LogFactory.getLog(MedStockService.class);
public boolean batchSave(List<MedStockList> stockList) {
boolean result = false;
if (stockList != null && stockList.size() != 0) {
for (MedStockList medStockList : stockList) {
MedStock medStock = medStockList.getData();
try {
checkStock(medStock);
} catch (Exception e) {
String json = JsonMapper.toJsonString(medStock);
log.error("同步医院库存:" + json + "信息异常");
throw new BaseException(e.getMessage());
}
medStock.setId(IdUtil.uuid());
stockDao.insert(medStock);
}
result = true;
}
return result;
}
private void checkStock(MedStock medStock) {
// 获取库存信息中供应商信息
String medSuppliercode = medStock.getMedSuppliercode();
String medSuppliername = medStock.getMedSuppliername();
if (StringUtils.isEmpty(medSuppliercode) || StringUtils.isEmpty(medSuppliername)) {
log.error("同步库存信息供应商编号以及供应商名称不能为空");
throw new BaseException("同步库存信息供应商编号以及供应商名称不能为空");
}
// 获取库存信息中供应商信息
String medCode = medStock.getMedCode();
String medName = medStock.getMedName();
if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
log.error("同步库存信息医院编号以及医院名称不能为空");
throw new BaseException("同步库存信息医院编号以及医院名称不能为空");
}
// 获取同步库存信息录商品信息
String goodsCode = medStock.getGoodsCode();
String goodsName = medStock.getGoodsName();
if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
log.error("同步库存信息商品编号以及商品名称不能为空");
throw new BaseException("同步库存信息商品编号以及商品名称不能为空");
}
// 获取对应商品规格
String goodsSpec = medStock.getGoodsSpec();
if (StringUtils.isEmpty(goodsSpec)) {
log.error("同步库存信息商品规格不能为空");
throw new BaseException("同步库存信息商品规格不能为空");
}
// 获取同步库存信息商品信息
String storeCode = medStock.getStoreCode();
String storeName = medStock.getStoreName();
if (StringUtils.isEmpty(storeCode) || StringUtils.isEmpty(storeName)) {
log.error("同步库存信息库房编码以及库房名称不能为空");
throw new BaseException("同步库存信息库房编码以及库房名称不能为空");
}
// 获取库存信息批号记录
String lot = medStock.getLot();
if (StringUtils.isEmpty(lot)) {
log.error("同步库存信息批号信息不能为空");
throw new BaseException("同步库存信息批号信息不能为空");
}
// 获取同步库存信息商品信息
Date productionDate = medStock.getProductionDate();
Date expireDate = medStock.getExpireDate();
if (productionDate == null || expireDate == null) {
log.error("同步库存信息生产日期以及有效期信息不能为空");
throw new BaseException("同步库存信息生产日期以及有效期信息不能为空");
}
}
}
package com.phxl.modules.goods.dao.invoiceback;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
public interface SuInvoiceBackDao {
void insert(SuInvoiceBack invoiceBack);
}
package com.phxl.modules.goods.dao.billback;
import java.util.List;
import com.phxl.modules.goods.entity.billback.BillBackDetail;
public interface BillBackDetailDao{
void batchInsert(List<BillBackDetail> details);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
<result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增invoiceback-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
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)
values (
#{id,jdbcType=VARCHAR}
,#{settleBillNo,jdbcType=VARCHAR}
,#{settleDate,jdbcType=TIMESTAMP}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{goodsSum,jdbcType=TINYINT}
,#{amount,jdbcType=DECIMAL}
,#{beginDate,jdbcType=TIMESTAMP}
,#{endDate,jdbcType=TIMESTAMP}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<title>二维码模板页面</title>
</head>
<body>
<div style="width: 265px;height: 130px; margin: 0px auto;">
<div style="text-align:center;font-size: 12px;font-family:宋体,SimSun;font-weight:900;"><span>
${title}
</span></div>
<div style="font-size: 9px;">
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:4px;">
<tr>
<td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">名称:</td>
<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>
<td style="text-align: center;" width="106" rowspan="6" >
${qrImage}
<div style="width:106px;"><span style="width:100%;font-size:10px;font-family:宋体,SimSun;font-weight:900;">${qrcode}</span></div>
</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">型号:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${fmodel}</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">规格:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${spec}</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">批号:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${flot}</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">效期:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${prodDate}-${usefulDate}</td>
</tr>
<tr>
<td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">注册证:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${registerNo}</td>
</tr>
</table>
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.phxl.common.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* 提供一系列获取和校验MD5的方法
*
*/
public class MD5Util {
/**
* 获取该输入流的MD5值
*
* @param is
* @return
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public static String getMD5(InputStream is) throws NoSuchAlgorithmException, IOException {
StringBuffer md5 = new StringBuffer();
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] dataBytes = new byte[1024];
int nread = 0;
while ((nread = is.read(dataBytes)) != -1) {
md.update(dataBytes, 0, nread);
};
byte[] mdbytes = md.digest();
// convert the byte to hex format
for (int i = 0; i < mdbytes.length; i++) {
md5.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
}
return md5.toString();
}
/**
* 获取该文件的MD5值
*
* @param file
* @return
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public static String getMD5(File file) throws NoSuchAlgorithmException, IOException {
FileInputStream fis = new FileInputStream(file);
return getMD5(fis);
}
/**
* 获取指定路径文件的MD5值
*
* @param path
* @return
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public static String getMD5(String path) throws NoSuchAlgorithmException, IOException {
FileInputStream fis = new FileInputStream(path);
return getMD5(fis);
}
/**
* 校验该输入流的MD5值
*
* @param is
* @param toBeCheckSum
* @return
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public static boolean md5CheckSum(InputStream is, String toBeCheckSum) throws NoSuchAlgorithmException, IOException {
return getMD5(is).equals(toBeCheckSum);
}
/**
* 校验该文件的MD5值
*
* @param file
* @param toBeCheckSum
* @return
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public static boolean md5CheckSum(File file, String toBeCheckSum) throws NoSuchAlgorithmException, IOException {
return getMD5(file).equals(toBeCheckSum);
}
/**
* 校验指定路径文件的MD5值
*
* @param path
* @param toBeCheckSum
* @return
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public static boolean md5CheckSum(String path, String toBeCheckSum) throws NoSuchAlgorithmException, IOException {
return getMD5(path).equals(toBeCheckSum);
}
/* MD5 TEST
public static void main(String[] args) {
try {
System.out.println(getMD5("D:/work/BJ/ESB_CSS_CSS_ImportCustCompFormRejectInfoSrv.xml"));
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
*/
}
\ No newline at end of file
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
package com.phxl.modules.goods.entity.medstock;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 医院库存信息
*/
public class MedStock{
public String getMedCode() {
return medCode;
}
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
private String medCode;
private String medName;
private String medSuppliercode; //供应商代码
private String medSuppliername; //供应商名称
private String storeCode; //HIS库房编码
private String storeName; //HIS库房名称
private String goodsCode; //HIS商品编码
private String goodsSpec; //规格
private String goodsName; //商品名称
private String lot; //批号
private Date productionDate; //生产日期
private Date expireDate; //有效期至
private BigDecimal stockQty; //库存数量
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; //创建时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; //更新时间
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMedSuppliercode() {
return medSuppliercode;
}
public void setMedSuppliercode(String medSuppliercode) {
this.medSuppliercode = medSuppliercode;
}
public String getMedSuppliername() {
return medSuppliername;
}
public void setMedSuppliername(String medSuppliername) {
this.medSuppliername = medSuppliername;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
public BigDecimal getStockQty() {
return stockQty;
}
public void setStockQty(BigDecimal stockQty) {
this.stockQty = stockQty;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" >
<!-- 区分项目名称,防止默认重名 -->
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>maven.example.root</param-value>
</context-param>
<!-- 设置Spring容器加载配置文件路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring/app*.xml</param-value>
</context-param>
<!-- Spring的log4j监听器 -->
<!-- <listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>-->
<!-- spring监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring 刷新Introspector防止内存泄露 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring view分发器 -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/WEB-INF/views/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
package com.phxl.common.constants;
import com.phxl.common.util.Global;
public class PlatformConstant {
//平台接口地址
public static final String PlatForm_HUARUN_Url = Global.getConfig("huarun_service_url");
//SPD接口地址
public static final String PlatForm_SPD_Url = Global.getConfig("spd_service_url");
//推送对账,发药,库存平台地址
public static final String PlatForm_URL = Global.getConfig("platform_url");
}
package com.phxl.modules.goods.entity.billback;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 医院退货单信息
*/
public class BillBack{
@JSONField(name = "BillNo")
private String billNo; //单据编号
@JSONField(name = "MedMVBillNo")
private String medMVBillNo; //入库单据编号
@JSONField(name = "SupplierCode")
private String supplierCode; //供应商编码
@JSONField(name = "SupplierbName")
private String supplierbName; //供应商名称
@JSONField(name = "MedCode")
private String medCode; //医疗机构代码
@JSONField(name = "MedName")
private String medName; //医疗机构名称
@JSONField(name = "BillDate")
private Date billDate; //退货时间
@JSONField(name = "Reason")
private String reason; //退货理由
@JSONField(name = "CountSum")
private int countSum; //明细条数
@JSONField(name = "DetailSum")
private BigDecimal detailSum; //明细金额
@JSONField(name = "OperaterName")
private String operaterName; //操作人员姓名
@JSONField(name = "InputDate")
private Date inputDate; //制单日期
@JSONField(name = "Memo")
private String memo; //备注
@JSONField(name = "CREATE_TIME")
private Date create_time; //创建时间
@JSONField(name = "UPDATE_TIME")
private Date update_time; //更新时间
@JSONField(name = "TRMedRPIdetail")
private List<BillBackDetail> TRMedRPIdetail; //退货单明细
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getMedMVBillNo() {
return medMVBillNo;
}
public void setMedMVBillNo(String medMVBillNo) {
this.medMVBillNo = medMVBillNo;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierbName() {
return supplierbName;
}
public void setSupplierbName(String supplierbName) {
this.supplierbName = supplierbName;
}
public String getMedCode() {
return medCode;
}
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public Date getBillDate() {
return billDate;
}
public void setBillDate(Date billDate) {
this.billDate = billDate;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public int getCountSum() {
return countSum;
}
public void setCountSum(int countSum) {
this.countSum = countSum;
}
public BigDecimal getDetailSum() {
return detailSum;
}
public void setDetailSum(BigDecimal detailSum) {
this.detailSum = detailSum;
}
public String getOperaterName() {
return operaterName;
}
public void setOperaterName(String operaterName) {
this.operaterName = operaterName;
}
public Date getInputDate() {
return inputDate;
}
public void setInputDate(Date inputDate) {
this.inputDate = inputDate;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
public List<BillBackDetail> getTRMedRPIdetail() {
return TRMedRPIdetail;
}
public void setTRMedRPIdetail(List<BillBackDetail> TRMedRPIdetail) {
this.TRMedRPIdetail = TRMedRPIdetail;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="2.5"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="jst.jaxrs" version="1.1"/>
</faceted-project>
<%-- <%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<script type="text/javascript" src="<%=basePath%>js/jquery.js" charset="utf-8"></script>
<style>
html,body{text-align:center;margin:0px auto;}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("#select").change(function(){
var value = $('#select option:selected') .val();
debugger;
if(value == '0'){
$("#form").attr('action','<%=basePath%>oss/uploadImage');
}else if(value == '1'){
$("#form").attr('action','<%=basePath%>oss/uploadHeadImage');
}else if(value == '2'){
$("#form").attr('action','<%=basePath%>oss/uploadAudio');
}else if(value == '3'){
$("#form").attr('action','<%=basePath%>oss/uploadVideo');
}
});
});
</script>
</head>
<body>
<div style="width:auto;height:20;margin-left:auto;margin-left:auto;">
${msg}
</div>
<form name="form" id="form" aligin="ceter" action="<%=basePath%>oss/uploadImage" enctype="multipart/form-data" method="post"">
<div id="newUpload2">
<select id="select">
<option value ="0">图片</option>
<option value ="1">头像</option>
<option value="2">音频</option>
<option value="3">视频</option>
</select>
<input type="file" name="fileUpload">
</div>
<input type="submit" value="上传" >
</form>
</body>
</html> --%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<script type="text/javascript" src="<%=basePath%>js/jquery.js"
charset="utf-8"></script>
<title>搜索词自动完成</title>
<style type="text/css">
#search {
text-align: center;
position: relative;
}
.autocomplete {
border: 1px solid #9ACCFB;
background-color: white;
text-align: left;
}
.autocomplete li {
list-style-type: none;
}
.clickable {
cursor: default;
}
.highlight {
background-color: #9ACCFB;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
sendxml();
});
function sendxml(){
var xmlData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><name>王森勇</name><author>tiger</author></book>";
var url = "<%=basePath%>bookInfo/sendxml";
$.ajax({
type: 'POST',
url: url ,
data: xmlData ,
dataType:"xml",
'success': function (data) {
alert(data);
} ,
'error': function (reslut) {
alert(reslut);
},
contentType:"application/xml"
});
}
$(function(){
//取得div层
var $search = $('#search');
//取得输入框JQuery对象
var $searchInput = $search.find('#search-text');
//关闭浏览器提供给输入框的自动完成
$searchInput.attr('autocomplete','off');
//创建自动完成的下拉列表,用于显示服务器返回的数据,插入在搜索按钮的后面,等显示的时候再调整位置
var $autocomplete = $('<div class="autocomplete"></div>').hide().insertAfter('#submit');
//清空下拉列表的内容并且隐藏下拉列表区
var clear = function(){
$autocomplete.empty().hide();
};
//注册事件,当输入框失去焦点的时候清空下拉列表并隐藏
$searchInput.blur(function(){
setTimeout(clear,500);
});
//下拉列表中高亮的项目的索引,当显示下拉列表项的时候,移动鼠标或者键盘的上下键就会移动高亮的项目,想百度搜索那样
var selectedItem = null;
//timeout的ID
var timeoutid = null;
//设置下拉项的高亮背景
var setSelectedItem = function(item){
//更新索引变量
selectedItem = item ;
//按上下键是循环显示的,小于0就置成最大的值,大于最大值就置成0
if(selectedItem < 0){
selectedItem = $autocomplete.find('li').length - 1;
}
else if(selectedItem > $autocomplete.find('li').length-1 ) {
selectedItem = 0;
}
//首先移除其他列表项的高亮背景,然后再高亮当前索引的背景
$autocomplete.find('li').removeClass('highlight')
.eq(selectedItem).addClass('highlight');
};
var ajax_request = function(){
//ajax服务端通信
$.ajax({
'url':'<%=basePath%>oss/datas', //服务器的地址
'data' : {
'search-text' : $searchInput.val()
}, //参数
'dataType' : 'json', //返回数据类型
'type' : 'POST', //请求类型
'success' : function(data) {
if (data.length) {
$autocomplete.empty();
//遍历data,添加到自动完成区
$.each(data, function(index, term) {
//创建li标签,添加到下拉列表中
$('<li></li>').text(term).appendTo($autocomplete)
.addClass('clickable').hover(
function() {
//下拉列表每一项的事件,鼠标移进去的操作
$(this).siblings().removeClass(
'highlight');
$(this).addClass('highlight');
selectedItem = index;
},
function() {
//下拉列表每一项的事件,鼠标离开的操作
$(this).removeClass('highlight');
//当鼠标离开时索引置-1,当作标记
selectedItem = -1;
}).click(function() {
//鼠标单击下拉列表的这一项的话,就将这一项的值添加到输入框中
$searchInput.val(term);
//清空并隐藏下拉列表
$autocomplete.empty().hide();
});
});//事件注册完毕
//设置下拉列表的位置,然后显示下拉列表
var ypos = $searchInput.position().top;
var xpos = $searchInput.position().left;
$autocomplete.css('width', );
$autocomplete.css({
'position' : 'relative',
'left' : xpos + "px",
'top' : ypos + "px"
});
setSelectedItem(0);
//显示下拉列表
$autocomplete.show();
}
}
});
};
//对输入框进行事件注册
$searchInput
.keyup(
function(event) {
//字母数字,退格,空格
if (event.keyCode > 40 || event.keyCode == 8
|| event.keyCode == 32) {
//首先删除下拉列表中的信息
$autocomplete.empty().hide();
clearTimeout(timeoutid);
timeoutid = setTimeout(ajax_request, 100);
} else if (event.keyCode == 38) {
//上
//selectedItem = -1 代表鼠标离开
if (selectedItem == -1) {
setSelectedItem($autocomplete.find('li').length - 1);
} else {
//索引减1
setSelectedItem(selectedItem - 1);
}
event.preventDefault();
} else if (event.keyCode == 40) {
//下
//selectedItem = -1 代表鼠标离开
if (selectedItem == -1) {
setSelectedItem(0);
} else {
//索引加1
setSelectedItem(selectedItem + 1);
}
event.preventDefault();
}
}).keypress(
function(event) {
//enter键
if (event.keyCode == 13) {
//列表为空或者鼠标离开导致当前没有索引值
if ($autocomplete.find('li').length == 0
|| selectedItem == -1) {
return;
}
$searchInput.val($autocomplete.find('li').eq(
selectedItem).text());
$autocomplete.empty().hide();
event.preventDefault();
}
}).keydown(function(event) {
//esc键
if (event.keyCode == 27) {
$autocomplete.empty().hide();
event.preventDefault();
}
});
//注册窗口大小改变的事件,重新调整下拉列表的位置
$(window).resize(function() {
var ypos = $searchInput.position().top;
var xpos = $searchInput.position().left;
$autocomplete.css('width', $searchInput.css('width'));
$autocomplete.css({
'position' : 'relative',
'left' : xpos+2 + "px",
'top' : ypos + "px"
});
});
});
function fileUpload() {
var fileName = $("#upfile").val();
if (fileName == null || fileName == "") {
alert("请选择文件");
} else {
debugger;
var fileType = fileName
.substr(fileName.length - 4, fileName.length);
if (fileType == ".xls" || fileType == "xlsx") {
var formData = new FormData();
formData.append("file", $("#upfile").prop("files")[0]);
$.ajax({
type : "post",
url : "<%=basePath%>exports/inLeadExcel",
data : formData,
cache : false,
processData : false,
contentType : false,
dataType : 'json', //返回数据类型
success : function(data) {
alert(data);
}
})
} else {
alert("导入文件类型错误!");
}
}
}
</script>
</head>
<body>
<div id="search">
<label for="search-text">请输入关键词</label><input type="text"
id="search-text" name="search-text" /> <input type="button"
id="submit" value="搜索" />
<a href="<%=basePath%>exports/printDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF" target="_blank"><button type="button" class="ant-btn ant-btn-primary"><span>打 印</span></button></a>
<a href="<%=basePath%>exports/exportDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF"><button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;"><span>导 出</span></button></a>
<button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;" onclick="$('#upfile').click();"><span>导 入</span></button>
<input type="file" class="file_input" id="upfile" onchange="fileUpload();" title=" " style="display:none">
</div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
<context:annotation-config />
<context:component-scan base-package="com.phxl.modules.goods.web.spd">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<util:properties id="config" location="classpath:config.properties"/>
</beans>
ALTER TABLE med_bill_settlement ADD COLUMN use_bill_no LONGTEXT COMMENT '发药单号';
ALTER TABLE med_bill_settlement_detail DROP use_bill_no;
\ No newline at end of file
/**
* Copyright (c) 2005-2011 springside.org.cn
*
* $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
*/
package com.phxl.common.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.Properties;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
/**
* Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
* @author calvin
* @version 2013-05-15
*/
public class PropertiesLoader {
private static Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
private static ResourceLoader resourceLoader = new DefaultResourceLoader();
private final Properties properties;
public PropertiesLoader(String... resourcesPaths) {
properties = loadProperties(resourcesPaths);
}
public Properties getProperties() {
return properties;
}
/**
* 取出Property,但以System的Property优先,取不到返回空字符串.
*/
private String getValue(String key) {
String systemProperty = System.getProperty(key);
if (systemProperty != null) {
return systemProperty;
}
if (properties.containsKey(key)) {
return properties.getProperty(key);
}
return "";
}
/**
* 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
*/
public String getProperty(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return value;
}
/**
* 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
*/
public String getProperty(String key, String defaultValue) {
String value = getValue(key);
return value != null ? value : defaultValue;
}
/**
* 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
*/
public Integer getInteger(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Integer.valueOf(value);
}
/**
* 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
*/
public Integer getInteger(String key, Integer defaultValue) {
String value = getValue(key);
return value != null ? Integer.valueOf(value) : defaultValue;
}
/**
* 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
*/
public Double getDouble(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Double.valueOf(value);
}
/**
* 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
*/
public Double getDouble(String key, Integer defaultValue) {
String value = getValue(key);
return value != null ? Double.valueOf(value) : defaultValue;
}
/**
* 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/false则返回false.
*/
public Boolean getBoolean(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Boolean.valueOf(value);
}
/**
* 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/false则返回false.
*/
public Boolean getBoolean(String key, boolean defaultValue) {
String value = getValue(key);
return value != null ? Boolean.valueOf(value) : defaultValue;
}
/**
* 载入多个文件, 文件路径使用Spring Resource格式.
*/
private Properties loadProperties(String... resourcesPaths) {
Properties props = new Properties();
for (String location : resourcesPaths) {
// logger.debug("Loading properties file from:" + location);
InputStream is = null;
try {
Resource resource = resourceLoader.getResource(location);
is = resource.getInputStream();
props.load(is);
} catch (IOException ex) {
logger.info("Could not load properties from path:" + location + ", " + ex.getMessage());
} finally {
IOUtils.closeQuietly(is);
}
}
return props;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao">
<insert id="insert">
INSERT INTO med_interface_log(
id,
request_time,
request_method,
request_param
) VALUES (
#{id},
#{requestTime},
#{requestMethod},
#{requestParam}
)
</insert>
<!-- 更新接口请求结果信息-->
<update id="update" parameterType="com.phxl.modules.goods.entity.interfaceLog.InterfaceLog">
update med_interface_log
<set>
<if test="resultCode != null and resultCode != ''">
result_code = #{resultCode,jdbcType=VARCHAR},
</if>
<if test="resultContent != null and resultContent != ''">
result_content = #{resultContent,jdbcType=VARCHAR},
</if>
<if test="exception != null and exception != ''">
exception = #{exception,jdbcType=VARCHAR}
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.entity.interfaceLog;
import java.util.Date;
/**
* 接口日志Entity
* @author zhangbing
* @version 2018-8-20
*/
public class InterfaceLog{
private String id;
private Date requestTime; // 接口请求时间
private String requestMethod; // 请求方法
private String requestParam; // 接口请求参数
private String resultCode; // 接口请求结果状态
private String resultContent; // 接口请求结果内容
private String exception; //异常信息
public Date getRequestTime() {
return requestTime;
}
public void setRequestTime(Date requestTime) {
this.requestTime = requestTime;
}
public String getRequestMethod() {
return requestMethod;
}
public void setRequestMethod(String requestMethod) {
this.requestMethod = requestMethod;
}
public String getRequestParam() {
return requestParam;
}
public void setRequestParam(String requestParam) {
this.requestParam = requestParam;
}
public String getResultCode() {
return resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getResultContent() {
return resultContent;
}
public void setResultContent(String resultContent) {
this.resultContent = resultContent;
}
public String getException() {
return exception;
}
public void setException(String exception) {
this.exception = exception;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
package com.phxl.modules.goods.dao.medstock;
import com.phxl.modules.goods.entity.medstock.MedStock;
public interface MedStockDao{
void insert(MedStock stock);
}
package com.phxl.modules.goods.web.spd;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.phxl.common.constants.HisRequestConstant;
import com.phxl.common.util.XMLClient;
@Controller
@RequestMapping(value = "/hisproxy")
public class HisProxyController {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@ResponseBody
@RequestMapping(value="forward", method= RequestMethod.POST)
public Object setMFMedGoods(HttpServletRequest req, String method, String xmlInfo){
try{
String url = req.getScheme() + "://" + req.getServerName()
+ ":" + req.getServerPort() + req.getServletPath();
return XMLClient.sendXMLDataByPost(url+"/spd/"+method,xmlInfo,HisRequestConstant.APPLICATION_XML);
}catch (Exception e){
logger.error("转换错误",e);
}
return null;
}
}
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
package com.phxl.modules.goods.entity.spills;
import java.math.BigDecimal;
import java.util.Date;
/**
* 盘点损溢信息
*/
public class HisSpills {
private String medCode; //医疗机构编码
private String medName; //医疗机构名称
private String depotCode; //库房编码
private String depotName; //库房名称
private Date tackStockDate; //报溢日期
private String operaterName; //审核人
private String goodsCode; //商品编码
private String goodsName; //商品名称
private String goodsSpec; //规格
private String manufacturer; //厂商
private String lot; //批号
private String unit; //单位
private BigDecimal number; //库存数量
private BigDecimal storckNum; //盘点数量
private BigDecimal differenceNum; //损溢数量
private String tackStockBillNo;
private String supplierCode;
private String supplierName;
private BigDecimal price;
private Date productionDate; //生产日期
private Date expireDate; //有效日期
private String id;
public String getTackStockBillNo() {
return tackStockBillNo;
}
public void setTackStockBillNo(String tackStockBillNo) {
this.tackStockBillNo = tackStockBillNo;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getMedCode() {
return medCode;
}
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getDepotCode() {
return depotCode;
}
public void setDepotCode(String depotCode) {
this.depotCode = depotCode;
}
public String getDepotName() {
return depotName;
}
public void setDepotName(String depotName) {
this.depotName = depotName;
}
public Date getTackStockDate() {
return tackStockDate;
}
public void setTackStockDate(Date tackStockDate) {
this.tackStockDate = tackStockDate;
}
public String getOperaterName() {
return operaterName;
}
public void setOperaterName(String operaterName) {
this.operaterName = operaterName;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public BigDecimal getNumber() {
return number;
}
public void setNumber(BigDecimal number) {
this.number = number;
}
public BigDecimal getStorckNum() {
return storckNum;
}
public void setStorckNum(BigDecimal storckNum) {
this.storckNum = storckNum;
}
public BigDecimal getDifferenceNum() {
return differenceNum;
}
public void setDifferenceNum(BigDecimal differenceNum) {
this.differenceNum = differenceNum;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
}
package com.phxl.modules.goods.service.billback;
import java.util.List;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.billback.BillBackDao;
import com.phxl.modules.goods.dao.billback.BillBackDetailDao;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billback.BillBackDetail;
@Service
public class BillBackService{
@Autowired
private BillBackDao billBackDao;
@Autowired
private BillBackDetailDao billBackDetailDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public boolean batchSave(List<BillBackWithDetail> billBacks) {
boolean result = true;
try {
checkBillBack(billBacks);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
for (BillBackWithDetail backs : billBacks) {
BillBack billBack = backs.getTRMedRPI();
List<BillBackDetail> details = billBack.getTRMedRPIdetail();
billBack.setId(IdUtil.uuid());
if(details != null && details.size() != 0){
for (BillBackDetail billBackDetail : details) {
billBackDetail.setBillNo(billBack.getBillNo());
billBackDetail.setId(IdUtil.uuid());
}
billBackDao.insert(billBack);
billBackDetailDao.batchInsert(details);
}
}
return result;
}
private void checkBillBack(List<BillBackWithDetail> billBacks) {
if(billBacks == null || billBacks.size() == 0){
logger.error("无相应医院退货单据信息");
throw new BaseException("无相应医院退货单据信息");
}
for (BillBackWithDetail backs : billBacks) {
String billNo = backs.getTRMedRPI().getBillNo();
if (StringUtils.isEmpty(billNo)) {
logger.error("医院退货单单据编号不能为空");
throw new BaseException("医院退货单单据编号不能为空");
}
String supplierCode = backs.getTRMedRPI().getSupplierCode();
String supplierbName = backs.getTRMedRPI().getSupplierbName();
if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(supplierbName)) {
logger.error("医院退货单单据编号:"+billNo+"供应商编码以及供应商名称不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+"供应商编码以及供应商名称不能为空");
}
String medCode = backs.getTRMedRPI().getMedCode();
if (StringUtils.isEmpty(medCode)) {
logger.error("医院退货单单据编号:"+billNo+"医疗机构代码不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+"医疗机构代码不能为空");
}
List<BillBackDetail> details = backs.getTRMedRPI().getTRMedRPIdetail();
if(details == null || details.size() == 0){
logger.error("医院退货单单据编号:"+billNo+"无相应退货单明细信息");
throw new BaseException("医院退货单单据编号:"+billNo+"无相应退货单明细信息");
}
for (BillBackDetail billBackDetail : details) {
String detailBillNo = billBackDetail.getBillNo();
if (StringUtils.isEmpty(detailBillNo)) {
logger.error("医院退货单单据编号:"+billNo+"退货单据明细单据编号不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+"退货单据明细单据编号不能为空");
}
int rowNo = billBackDetail.getRowNo();
if (rowNo == 0) {
logger.error("医院退货单单据编号:"+billNo+"退货单据明细行号不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+"退货单据明细行号不能为空");
}
String detailMedMVBillNo = billBackDetail.getMedMVBillNo();
if (StringUtils.isEmpty(detailMedMVBillNo)) {
logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据编号不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据编号不能为空");
}
Integer detailMedMVRowNo = billBackDetail.getMedMVRowNo();
if (detailMedMVRowNo == null) {
logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据明细号不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细入库单据明细不能为空");
}
String goodsCode = billBackDetail.getGoodsCode();
String goodsName = billBackDetail.getGoodsName();
if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品编码以及商品名称不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品编码以及商品名称不能为空");
}
String goodsSpec = billBackDetail.getGoodsSpec();
if (StringUtils.isEmpty(goodsSpec)) {
logger.error("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品规格不能为空");
throw new BaseException("医院退货单单据编号:"+billNo+",行号:"+rowNo+"退货单据明细商品规格不能为空");
}
}
}
}
}
package com.phxl.common.utils;
/**
* api通用状态返回
*
* @author Pxie
*/
public class ReturnCode {
/**
* 未登录
*/
public final static int UNLOGIN = -1;
/**
* 成功
*/
public final static int SUCCESS = 1;
/**
* 后端提醒
*/
public final static int WARN = 2;
/**
* 系统错误
*/
public final static int ERROR = 500;
/**
* 登录超时
*/
public final static int TOKEN_OUT = 4;
/**
* 加密签名错误
*/
public final static int SIGN_ERROR = 5;
public final static String SUCCESSMSG = "success";
public final static String FAILMSG = "fail";
public final static String PARAMETERERROR = "参数缺少或者不对";
private Integer ret = 1;
private String msg = "success";
private Object data;
public ReturnCode() {
}
public ReturnCode(int ret) {
this.ret = ret;
}
public ReturnCode(int ret, Object o) {
this.ret = ret;
data = o;
}
public ReturnCode(int ret, String msg) {
this.ret = ret;
this.msg = msg;
}
public ReturnCode(int ret, Object data, int act) {
this.ret = ret;
this.data = data;
}
public ReturnCode(int ret, int act) {
super();
this.ret = ret;
}
public ReturnCode(int ret, String msg, Object data) {
this.ret = ret;
this.msg = msg;
this.data = data;
}
public Integer getRet() {
return ret;
}
public void setRet(Integer ret) {
this.ret = ret;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>送货单打印(手术A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${fOrgName}医用耗材送货单</h3></td>
<td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
</tr>
<tr>
<td width="25%" height="30">送货单号:${sendNo}</td>
<td width="25%" height="30">订单号:${orderNo}</td>
<td width="25%" height="30">医疗机构:${rOrgName}</td>
</tr>
<tr>
<td height="30" colspan="2">收货地址:${tfAddress}</td>
<td height="30" >期望到货时间:${expectDate}</td>
</tr>
<tr>
<td height="30">制单人:${sendUsername}</td>
<td height="30" colspan="2">制单时间:${sendDate}</td>
</tr>
<tr>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="30" colspan='4'><hr width='100%' color='#65a6be' /></td></tr>
<tr>
<td width="25%" height="30">就诊号:${treatmentNo}</td>
<td width="25%" height="30">患者姓名:${name}</td>
<td width="25%" height="30">性别:${gender}</td>
<td width="25%" height="30">年龄:${age}</td>
</tr>
<tr>
<td width="25%" height="30">手术名称:${operName}</td>
<td width="25%" height="30">手术日期:${operDate}</td>
<td width="25%" height="30">品牌:${tfBrand}</td>
<td width="25%" height="30">备注:${tfRemark}</td>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="20%" align="left">验收人:</td>
<td width="20%" align="left">收货人:</td>
<td width="15%" align="left">产品总数量:${materailAmount}</td>
<td width="15%" align="left">外来植入物总数量:${outerImpAmount}</td>
<td width="15%" align="left">灭菌总数量:${sterilizeAmount}</td>
<td width="15%" align="left">工具总数量:${toolAmount}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.phxl.common.util;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
public class HttpUtils {
public static String readContentFromGet(String url) throws IOException {
// 拼凑get请求的URL字串,使用URLEncoder.encode对特殊和不可见字符进行编码
URL getUrl = new URL(url);
// 根据拼凑的URL,打开连接,URL.openConnection函数会根据URL的类型,
// 返回不同的URLConnection子类的对象,这里URL是一个http,因此实际返回的是HttpURLConnection
HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
connection.addRequestProperty("Content-Type","application/xml");
// 进行连接,但是实际上get request要在下一句的connection.getInputStream()函数中才会真正发到
// 服务器
connection.connect();
// 取得输入流,并使用Reader读取
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));// 设置编码,否则中文乱码
String lines;
// while ((lines = reader.readLine()) != null){
// //lines = new String(lines.getBytes(), "utf-8");
// System.out.println(lines);
// }
lines = reader.readLine();
reader.close();
// 断开连接
connection.disconnect();
return lines;
}
public static String readContentFromPost2(String url, String content) throws IOException {
// Post请求的url,与get不同的是不需要带参数
URL postUrl = new URL(url);
// 打开连接
HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
// Output to the connection. Default is
// false, set to true because post
// method must write something to the
// connection
// 设置是否向connection输出,因为这个是post请求,参数要放在
// http正文内,因此需要设为true
connection.setDoOutput(true);
// Read from the connection. Default is true.
connection.setDoInput(true);
// Set the post method. Default is GET
connection.setRequestMethod("POST");
// Post cannot use caches
// Post 请求不能使用缓存
connection.setUseCaches(false);
// This method takes effects to
// every instances of this class.
// URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
// connection.setFollowRedirects(true);
// This methods only
// takes effacts to this
// instance.
// URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
connection.setInstanceFollowRedirects(true);
// Set the content type to urlencoded,
// because we will write
// some URL-encoded content to the
// connection. Settings above must be set before connect!
// 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
// 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
// 进行编码
//connection.addRequestProperty("Content-Type","application/xml");
//connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
/* 设置头的信息 */
connection.setRequestProperty("Content-Type", "text/xml");
// 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
// 要注意的是connection.getOutputStream会隐含的进行connect。
connection.connect();
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
// The URL-encoded contend
// 正文,正文内容其实跟get的URL中'?'后的参数字符串一致,content
// DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
out.writeBytes(content);
out.flush();
out.close(); // flush and close
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
String line = "";
// while ((line = reader.readLine()) != null){
// //line = new String(line.getBytes(), "utf-8");
// System.out.println(line);
// }
line = reader.readLine();
reader.close();
connection.disconnect();
return line;
}
public static String readContentFromPost(String url, String content) throws IOException {
// Post请求的url,与get不同的是不需要带参数
URL postUrl = new URL(url);
// 打开连接
HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
// Output to the connection. Default is
// false, set to true because post
// method must write something to the
// connection
// 设置是否向connection输出,因为这个是post请求,参数要放在
// http正文内,因此需要设为true
connection.setDoOutput(true);
// Read from the connection. Default is true.
connection.setDoInput(true);
// Set the post method. Default is GET
connection.setRequestMethod("POST");
// Post cannot use caches
// Post 请求不能使用缓存
connection.setUseCaches(false);
// This method takes effects to
// every instances of this class.
// URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
// connection.setFollowRedirects(true);
// This methods only
// takes effacts to this
// instance.
// URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
connection.setInstanceFollowRedirects(true);
// Set the content type to urlencoded,
// because we will write
// some URL-encoded content to the
// connection. Settings above must be set before connect!
// 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
// 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
// 进行编码
//connection.addRequestProperty("Content-Type","application/xml");
//connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
/* 设置头的信息 */
connection.setRequestProperty("Content-Type", "application/xml");
// 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
// 要注意的是connection.getOutputStream会隐含的进行connect。
connection.connect();
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
// The URL-encoded contend
// 正文,正文内容其实跟get的URL中'?'后的参数字符串一致,content
// DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
out.writeBytes(content);
out.flush();
out.close(); // flush and close
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
String line = "";
// while ((line = reader.readLine()) != null){
// //line = new String(line.getBytes(), "utf-8");
// System.out.println(line);
// }
line = reader.readLine();
reader.close();
connection.disconnect();
return line;
}
public static String readContentFromPost(String url, String content, String contentType) throws IOException {
// Post请求的url,与get不同的是不需要带参数
URL postUrl = new URL(url);
// 打开连接
HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
// Output to the connection. Default is
// false, set to true because post
// method must write something to the
// connection
// 设置是否向connection输出,因为这个是post请求,参数要放在
// http正文内,因此需要设为true
connection.setDoOutput(true);
// Read from the connection. Default is true.
connection.setDoInput(true);
// Set the post method. Default is GET
connection.setRequestMethod("POST");
// Post cannot use caches
// Post 请求不能使用缓存
connection.setUseCaches(false);
// This method takes effects to
// every instances of this class.
// URLConnection.setFollowRedirects是static函数,作用于所有的URLConnection对象。
// connection.setFollowRedirects(true);
// This methods only
// takes effacts to this
// instance.
// URLConnection.setInstanceFollowRedirects是成员函数,仅作用于当前函数
connection.setInstanceFollowRedirects(true);
// Set the content type to urlencoded,
// because we will write
// some URL-encoded content to the
// connection. Settings above must be set before connect!
// 配置本次连接的Content-type,配置为application/x-www-form-urlencoded的
// 意思是正文是urlencoded编码过的form参数,下面我们可以看到我们对正文内容使用URLEncoder.encode
// 进行编码
//connection.addRequestProperty("Content-Type","application/xml");
//connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
/* 设置头的信息 */
connection.setRequestProperty("Content-Type", contentType);
// 连接,从postUrl.openConnection()至此的配置必须要在connect之前完成,
// 要注意的是connection.getOutputStream会隐含的进行connect。
connection.connect();
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
// The URL-encoded contend
// 正文,正文内容其实跟get的URL中'?'后的参数字符串一致,content
// DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
out.writeBytes(content);
out.flush();
out.close(); // flush and close
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
String line = "";
// while ((line = reader.readLine()) != null){
// //line = new String(line.getBytes(), "utf-8");
// System.out.println(line);
// }
line = reader.readLine();
reader.close();
connection.disconnect();
return line;
}
public static void fff(String url,String xml) {
try{
URL postUrl = new URL(url);
// 建立http连接
HttpURLConnection conn = (HttpURLConnection) postUrl.openConnection();
// 设置允许输出
conn.setDoOutput(true);
conn.setDoInput(true);
// 设置不用缓存
conn.setUseCaches(false);
// 设置传递方式
conn.setRequestMethod("POST");
// 设置维持长连接
conn.setRequestProperty("Connection", "Keep-Alive");
// 设置文件字符集:
conn.setRequestProperty("Charset", "UTF-8");
//转换为字节数组
byte[] data = xml.getBytes();
// 设置文件长度
conn.setRequestProperty("Content-Length", String.valueOf(data.length));
// 设置文件类型:
conn.setRequestProperty("contentType", "applicaiton/xml");
// 设置文件类型:
//conn.setRequestProperty("Content-Type","application/json; charset=UTF-8");
// 设置接收类型否则返回415错误
//conn.setRequestProperty("accept","*/*")此处为暴力方法设置接受所有类型,以此来防范返回415;
conn.setRequestProperty("accept","application/xml");
// 开始连接请求
conn.connect();
OutputStream out = conn.getOutputStream();
// 写入请求的字符串
out.write(data);
out.flush();
out.close();
System.out.println(conn.getResponseCode());
}catch (Exception e){
System.out.println(e);
}
}
public static void main(String[] args) {
// String content="&lt;p&gt;测试测试测试测试测试测试测试测试测试测试测试测试&lt;/p&gt;";
//String mytext = "act=2005&type=1&limit=30&loginUserId=&start=0&keyword=";
String mytext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><id>1</id><name>王森勇</name><author>tiger</author></book>";
/*
* try { //mytext = "content="+content+
* "&custId=0c8469cc950f44ca8728a2ec97db1222&sourceId=1&sourceType=1";
* //mytext = "content="+java.net.URLEncoder.encode(content, "utf-8")+
* "&custId=0c8469cc950f44ca8728a2ec97db1222&sourceId=1&sourceType=1";
* //System.out.println(mytext); //String mytext2 =
* java.net.URLDecoder.decode(mytext, "utf-8");
* //System.out.println(mytext2); } catch (UnsupportedEncodingException
* e) { // TODO Auto-generated catch block e.printStackTrace(); }
*/
try {
/* String url = "http://localhost:8080/upload/spd/getxml";
String line = HttpUtils.readContentFromGet(url);
System.out.println(line);*/
String url = "http://localhost:8080/medicinal-supplier/bookInfo/sendxml";
//HttpUtils.initHeaderParam();
//fff(url,mytext);
String line = HttpUtils.readContentFromPost(url, mytext);
System.out.println(line);
Map<String, Object> aaa = JsonUtils.fromJson(line, Map.class);
/*
* for (Map.Entry<String, Object> entry : aaa.entrySet()) {
* if(entry.getValue() instanceof ArrayList ){
* aaa.put(entry.getKey(), (List)entry.getValue()); } }
*
* bbb = aaa.get("data");
*/
// System.out.println(bbb instanceof ArrayList);
// List ccc =(List)bbb;
/* System.out.println(bbb); */
// Object ddd = ccc.get(0);
// System.out.println(ccc.get(0).get("clubId"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
\ No newline at end of file
package com.phxl.modules.goods.dao.medplan;
import java.util.List;
import com.phxl.modules.goods.entity.medplan.MedPlanDetail;
public interface MedPlanDetailDao{
void batchInsert(List<MedPlanDetail> details);
}
package com.phxl.modules.goods.dao.billsettlement;
import java.util.List;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail;
public interface BillSettlementDetailDao{
void batchInsert(List<BillSettlementDetail> details);
}
package com.phxl.common.util;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
public class Tools {
public static void main(String[] args) throws Exception {
String str = "http://yryz-upload.oss-cn-hangzhou.aliyuncs.com/headImage/65b3139c0c730d32e902279a152c6759.jpg";
String ext=str.substring(str.lastIndexOf("/")+1);
System.out.println(ext);
Tools dw = new Tools();
dw.saveToFile(str, "F:\\profiles\\" + ext);
}
/**
* 根据网络地址保存图片
*/
public void saveToFile(String destUrl, String filePath) {
FileOutputStream fos = null;
BufferedInputStream bis = null;
HttpURLConnection httpUrl = null;
URL url = null;
int BUFFER_SIZE = 1024;
byte[] buf = new byte[BUFFER_SIZE];
int size = 0;
try {
url = new URL(destUrl);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
bis = new BufferedInputStream(httpUrl.getInputStream());
fos = new FileOutputStream(filePath);
while ((size = bis.read(buf)) != -1) {
fos.write(buf, 0, size);
}
fos.flush();
} catch (IOException e) {
} catch (ClassCastException e) {
} finally {
try {
fos.close();
bis.close();
httpUrl.disconnect();
} catch (IOException e) {
} catch (NullPointerException e) {
}
}
}
}
\ No newline at end of file
package com.phxl.modules.goods.entity.medplan;
import java.math.BigDecimal;
/**
* 补货计划单明细
*/
public class MedPlanDetail{
private String billNo; //单据编号
private int rowNo; //行号
private String goodsCode; //商品编码
private String goodsName; //商品名称
private String goodsSpec; //商品规格
private String manufacturer; //生产厂商
private BigDecimal poQty; //订货数
private String unit; //订货单位
private BigDecimal taxprice; //商品含税单价
private BigDecimal taxsum; //商品含税总金额
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public int getRowNo() {
return rowNo;
}
public void setRowNo(int rowNo) {
this.rowNo = rowNo;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public BigDecimal getPoQty() {
return poQty;
}
public void setPoQty(BigDecimal poQty) {
this.poQty = poQty;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public BigDecimal getTaxprice() {
return taxprice;
}
public void setTaxprice(BigDecimal taxprice) {
this.taxprice = taxprice;
}
public BigDecimal getTaxsum() {
return taxsum;
}
public void setTaxsum(BigDecimal taxsum) {
this.taxsum = taxsum;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
package com.phxl.modules.goods.dao.medplan;
import com.phxl.modules.goods.entity.medplan.MedPlan;
public interface MedPlanDao{
void insert(MedPlan medPlan);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="producer_name" property="producerName" jdbcType="VARCHAR" />
<result column="regist_key" property="registKey" jdbcType="VARCHAR" />
<result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="settle_price" property="settlePrice" jdbcType="DECIMAL" />
<result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
<result column="invoice_no" property="invoiceNo" jdbcType="VARCHAR" />
<result column="invoice_code" property="invoiceCode" jdbcType="VARCHAR" />
<result column="invoice_time" property="invoiceTime" jdbcType="DECIMAL" />
<result column="invoice_amount" property="invoiceAmount" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.settleBillNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.producerName},
#{obj.registKey},
#{obj.settleQty},
#{obj.unit},
#{obj.settlePrice},
#{obj.settleAmount},
#{obj.create_time},
#{obj.update_time},
#{obj.invoiceNo},
#{obj.invoiceCode},
#{obj.invoiceTime},
#{obj.invoiceAmount}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
This diff could not be displayed because it is too large.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
<result column="bill_state" property="billState" jdbcType="VARCHAR" />
<result column="purchaser_corp_code" property="medCode" jdbcType="VARCHAR" />
<result column="purchaser_corp_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="TIMESTAMP" />
<result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
<result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
<result column="use_bill_no" property="usebillno" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增BillBack-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
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)
values (
#{id,jdbcType=VARCHAR}
,#{settleBillNo,jdbcType=VARCHAR}
,#{settleDate,jdbcType=TIMESTAMP}
,#{billState,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=TIMESTAMP}
,#{goodsSum,jdbcType=TINYINT}
,#{amount,jdbcType=DECIMAL}
,#{beginDate,jdbcType=TIMESTAMP}
,#{endDate,jdbcType=TIMESTAMP}
,#{useBillNo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.entity.ctcareprov;
import java.util.Date;
/**
*
* @ClassName: CTCareProv
* @Description: 医院人员表实体类
* @author wangsenyong
* @date 2018-08-08 13:37:21
*
*/
public class CTCareProv{
private String mfmedStaffCode; //人员代码
private String logonUser; //登录账号
private String realName; //真实姓名
private String helpCode; //助记码
private String sex; //性别
private String mobileTel; //手机号
private String webChatCode; //微信号
private String idcode; //身份证号
private String e_mail; //E-MAIL
private String hdeptCode; //所属部门
private String category; //商品大类
private String ishadministrator; //是否管理员
private Date update_time; //更新时间
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMfmedStaffCode() {
return mfmedStaffCode;
}
public void setMfmedStaffCode(String mfmedStaffCode) {
this.mfmedStaffCode = mfmedStaffCode;
}
public String getLogonUser() {
return logonUser;
}
public void setLogonUser(String logonUser) {
this.logonUser = logonUser;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getHelpCode() {
return helpCode;
}
public void setHelpCode(String helpCode) {
this.helpCode = helpCode;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getMobileTel() {
return mobileTel;
}
public void setMobileTel(String mobileTel) {
this.mobileTel = mobileTel;
}
public String getWebChatCode() {
return webChatCode;
}
public void setWebChatCode(String webChatCode) {
this.webChatCode = webChatCode;
}
public String getIdcode() {
return idcode;
}
public void setIdcode(String idcode) {
this.idcode = idcode;
}
public String getE_mail() {
return e_mail;
}
public void setE_mail(String e_mail) {
this.e_mail = e_mail;
}
public String getHdeptCode() {
return hdeptCode;
}
public void setHdeptCode(String hdeptCode) {
this.hdeptCode = hdeptCode;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getIshadministrator() {
return ishadministrator;
}
public void setIshadministrator(String ishadministrator) {
this.ishadministrator = ishadministrator;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
}
\ No newline at end of file
package com.phxl.modules.goods.dao.billsettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
public interface BillSettlementDao{
void insert(BillSettlement billSettlement);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="med_plan_no" property="medPlanNo" jdbcType="VARCHAR" />
<result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
<result column="goods_guid" property="goodsGuid" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="poqty" property="poqty" jdbcType="DECIMAL" />
<result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medPlanNo},
#{obj.medPlanRowNo},
#{obj.goodsGuid},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.unit},
#{obj.manufacturer},
#{obj.purchaserPrice},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.poqty},
#{obj.arrivalqty},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medstock.MedStockDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medstock.MedStock">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
<result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
<result column="store_code" property="storeCode" jdbcType="VARCHAR" />
<result column="store_name" property="storeName" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medSuppliercode},
#{obj.medSuppliername},
#{obj.storeCode},
#{obj.storeName},
#{obj.goodsCode},
#{obj.goodsSpec},
#{obj.goodsName},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.stockQty},
#{obj.createTime},
#{obj.updateTime},
#{obj.medCode},
#{obj.medName},
</trim>
</foreach>
</insert>
<!-- 新增HisSpills-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medstock.MedStock">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medSuppliercode,jdbcType=VARCHAR}
,#{medSuppliername,jdbcType=VARCHAR}
,#{storeCode,jdbcType=VARCHAR}
,#{storeName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=TIMESTAMP}
,#{goodsSpec,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{productionDate,jdbcType=VARCHAR}
,#{expireDate,jdbcType=DECIMAL}
,#{stockQty,jdbcType=DECIMAL}
,#{createTime,jdbcType=DECIMAL}
,#{updateTime,jdbcType=TIMESTAMP}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
)
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.service.spills;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.spills.HisSpillsDao;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
@Service
public class HisSpillsService {
@Autowired
private HisSpillsDao hisSpillsDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public boolean batchSave(List<HisSpillsList> spills) {
boolean result = false;
if (spills != null && spills.size() != 0) {
for (HisSpillsList hisSpillsList : spills) {
HisSpills hisSpills = hisSpillsList.getData();
try {
checkSpills(hisSpills);
} catch (Exception e) {
String json = JsonMapper.toJsonString(hisSpills);
logger.error("同步医院盘点损溢单:" + json + "信息异常");
throw new BaseException(e.getMessage());
}
hisSpills.setId(IdUtil.uuid());
hisSpillsDao.insert(hisSpills);
}
result = true;
}
return result;
}
private void checkSpills(HisSpills hisSpills) {
// 获取库存信息中供应商信息
String medCode = hisSpills.getMedCode();
String medName = hisSpills.getMedName();
String supplierCode = hisSpills.getSupplierCode();
String supplierName = hisSpills.getSupplierName();
String stockbillno = hisSpills.getTackStockBillNo();
if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
logger.error("盘点损溢信息医疗机构编码以及名称不能为空");
throw new BaseException("盘点损溢信息医疗机构编码以及名称不能为空");
}
if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(supplierName)) {
logger.error("盘点损溢信息供应商编码以及名称不能为空");
throw new BaseException("盘点损溢信息供应商编码以及名称不能为空");
}
if (StringUtils.isEmpty(stockbillno)) {
logger.error("盘点单号不能为空");
throw new BaseException("盘点单号不能为空");
}
Date tackStockDate = hisSpills.getTackStockDate();
if (tackStockDate == null) {
logger.error("盘点损溢信息报溢时间不能为空");
throw new BaseException("盘点损溢信息报溢时间不能为空");
}
String operaterName = hisSpills.getOperaterName();
if (StringUtils.isEmpty(operaterName)) {
logger.error("盘点损溢信息审核人不能为空");
throw new BaseException("盘点损溢信息审核人不能为空");
}
String goodsCode = hisSpills.getGoodsCode();
if (StringUtils.isEmpty(goodsCode)) {
logger.error("盘点损溢信息商品编码不能为空");
throw new BaseException("盘点损溢信息商品编码不能为空");
}
String lot = hisSpills.getLot();
if (StringUtils.isEmpty(lot)) {
logger.error("盘点损溢信息批号不能为空");
throw new BaseException("盘点损溢信息批号不能为空");
}
BigDecimal number = hisSpills.getNumber();
if (number == null) {
logger.error("盘点损溢信息库存数量不能为空");
throw new BaseException("盘点损溢信息库存数量不能为空");
}
BigDecimal storckNum = hisSpills.getStorckNum();
if (storckNum == null) {
logger.error("盘点损溢信息盘点数量不能为空");
throw new BaseException("盘点损溢信息盘点数量不能为空");
}
BigDecimal differenceNum = hisSpills.getDifferenceNum();
if (differenceNum == null) {
logger.error("盘点损溢信息损溢数量不能为空");
throw new BaseException("盘点损溢信息损溢数量不能为空");
}
}
}
package com.phxl.modules.goods.dao.suoutstore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
public interface SuOutStoreDao {
void insert(SuOutStore suOutStore);
}
package com.phxl.modules.goods.entity.billsettlement;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 医院结算单信息
*/
public class BillSettlement{
private String id;
private String settleBillNo; //结算单号
private Date settleDate; //结算单日期
private String medCode;
private String medName;
private String billState; //单据状态
private String supplierCode; //供应商编码
private String supplierName; //供应商名称
private int goodsSum; //商品数
private BigDecimal amount; //结算金额
private Date beginDate; //业务开始日期
private Date endDate; //业务结束日期
private Date create_time; //创建时间
private String useBillNo; //发药单据编号
private Date update_time; //更新时间
private List<BillSettlementDetail> TRSettleDetail; //结算单明细
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSettleBillNo() {
return settleBillNo;
}
public void setSettleBillNo(String settleBillNo) {
this.settleBillNo = settleBillNo;
}
public Date getSettleDate() {
return settleDate;
}
public void setSettleDate(Date settleDate) {
this.settleDate = settleDate;
}
public String getMedCode() {
return medCode;
}
public void setMedCode(String medCode) {
this.medCode = medCode;
}
public String getMedName() {
return medName;
}
public void setMedName(String medName) {
this.medName = medName;
}
public String getBillState() {
return billState;
}
public void setBillState(String billState) {
this.billState = billState;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public int getGoodsSum() {
return goodsSum;
}
public void setGoodsSum(int goodsSum) {
this.goodsSum = goodsSum;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Date getCreate_time() {
return create_time;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getUpdate_time() {
return update_time;
}
public void setUpdate_time(Date update_time) {
this.update_time = update_time;
}
public List<BillSettlementDetail> getTRSettleDetail() {
return TRSettleDetail;
}
public void setTRSettleDetail(List<BillSettlementDetail> tRSettleDetail) {
TRSettleDetail = tRSettleDetail;
}
public String getUseBillNo() {
return useBillNo;
}
public void setUseBillNo(String useBillNo) {
this.useBillNo = useBillNo;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medinstore.MedInStore">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增MedInStore-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medinstore.MedInStore">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medGuid,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{medDeptGuid,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreGuid,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{supplierGuid,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.dao.supplygoods;
import java.util.List;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
public interface MedSupplyGoodsDao{
void batchInsert(List<MedSupplyGoods> supplyGoods);
}
package com.phxl.common.util;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class XMLClient {
private static HttpClient client;
public static void main(String[] args) throws Exception {
XMLClient client = new XMLClient();
String url = "http://localhost:8080/upload/bookInfo/sendxml5";
//发送XML数据到服务
String result = client.sendXMLDataByPost(url, client.getXMLString(),"text/xml");
System.out.println(result);
}
// 获取XML
public String getXMLString() {
String XML_HEADER = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
StringBuffer sb = new StringBuffer();
sb.append(XML_HEADER);
sb.append("<a>");
sb.append("<b>");
sb.append("<c>");
sb.append("DWMC");
sb.append("</c>");
sb.append("<d>");
sb.append("id=10");
sb.append("</d>");
sb.append("</SELECT>");
sb.append("</b>");
sb.append("</a>");
String mytext = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><id>1</id><name>王森勇</name><author>tiger</author></book>";
// 返回String格式
return mytext.toString();
}
// 使用POST方法发送XML数据LL
public static String sendXMLDataByPost(String url, String xmlData, String contentType) throws Exception {
if (client == null){
client = HttpClients.createDefault();
}
HttpPost post = new HttpPost(url);
//post.setHeader("Content-Type","text/xml;charset=UTF-8");
post.setHeader("Content-Type", ""+contentType+";charset=utf-8");
// List<BasicNameValuePair> parameters = new ArrayL ist<BasicNameValuePair>();
//.add(new BasicNameValuePair("text/xml", xmlData));
// post.setEntity(new UrlEncodedFormEntity(parameters,"UTF-8"));
StringEntity entity1 = new StringEntity(xmlData,"UTF-8");
post.setEntity(entity1);
HttpResponse response = client.execute(post);
System.out.println(response.toString());
HttpEntity entity = response.getEntity();
String result = EntityUtils.toString(entity, "UTF-8");
return result;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billback.BillBackDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
<result column="medMV_row_no" property="medMVRowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="returns_unit" property="returns_Unit" jdbcType="VARCHAR" />
<result column="returns_price" property="returns_Price" jdbcType="DECIMAL" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="rpi_qty" property="rpiQty" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入BillBackDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medMVBillNo},
#{obj.medMVRowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.returns_Unit},
#{obj.returns_Price},
#{obj.manufacturer},
#{obj.rpiQty},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
<result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="producer" property="producer" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit_style" property="unitStyle" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="price" property="price" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
insert into med_supply_catalog (id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medSuppliercode},
#{obj.medSuppliername},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.producer},
#{obj.goodsSpec},
#{obj.unitStyle},
#{obj.createTime},
#{obj.updateTime},
#{obj.price}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>使用登记明细打印(普通A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${jgName}</h3></td>
<td width="12%" height="30" rowspan="4">${qrImage}</td>
</tr>
<tr>
<td width="25%" height="30">使用清单号:${useNo}</td>
<td width="25%" height="30">送货单号:${sendNo}</td>
<td width="25%" height="30">供应商:${fOrgName}</td>
<td></td>
</tr>
<tr>
<td width="25%" height="30">登记科室:${deptName}</td>
<td width="25%" height="30">登记人:${createUserName}</td>
<td width="25%" height="30">登记时间:${createTime}</td>
<td></td>
</tr>
<tr>
<td width="25%" height="30">就诊号:${treatmentNo}</td>
<td width="25%" height="30">患者姓名:${hzName}</td>
<td width="25%" height="30">手术名称:${operName}</td>
<td></td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 25px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">价格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">金额</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="30%" align="left">医生签字:</td>
<td width="20%" align="right">总金额:${zje}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.phxl.common.util;
import java.util.Date;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
public class JsonDateDeserializer implements JsonDeserializer<Date> {
public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context)
throws JsonParseException {
// TODO Auto-generated method stub
String s = json.getAsJsonPrimitive().getAsString();
long l = Long.parseLong(s);
Date d = new Date(l);
return d;
}
}
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>入库单打印(三联单)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}验收入库单</h3></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
<tr>
<td width="21%" height="15">供应商:${forgName}</td>
<td width="17%" height="15">入库日期:${inTime}</td>
<td width="26%" height="15">入库单号:${InNo}</td>
</tr>
<tr>
<td width="21%" height="15">发票号:${invoiceNo}</td>
<td width="17%" height="15">送货单号:${Send_Id}</td>
<td width="26%" height="15">单位:元</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 18px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20px;">
<td width="25%" align="left"></td>
<td width="25%" align="left"></td>
<td width="21%" align="left"></td>
<td width="28%" align="left">合计金额:${totalPrice}</td>
</tr>
<tr height="20px;">
<td width="25%" align="left">制单人:${userName}</td>
<td width="25%" align="left">会计:</td>
<td width="21%" align="left">审核人:</td>
<td width="28%" align="left">备注:</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.phxl</groupId>
<artifactId>medicinal-supplier</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>medicinal-supplier</name>
<url>http://maven.apache.org</url>
<!-- 属性配置 -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<junit.version>4.8.1</junit.version>
<javax.servlet.version>1.2</javax.servlet.version>
<javax.servlet.api.version>2.5</javax.servlet.api.version>
<spring.version>4.1.1.RELEASE</spring.version>
<org.apache.commons.version>3.0</org.apache.commons.version>
<org.apache.xmlbeans.version>2.6.0</org.apache.xmlbeans.version>
<org.apache.poi.version>3.9</org.apache.poi.version>
<org.apache.poi.openxml4j.version>1.0-beta</org.apache.poi.openxml4j.version>
<com.fasterxml.jackson.version>2.8.4</com.fasterxml.jackson.version>
<com.itextpdf.version>5.5.7</com.itextpdf.version>
<com.itextpdf.itext-asian.version>5.2.0</com.itextpdf.itext-asian.version>
<com.aliyun.oss.version>2.2.3</com.aliyun.oss.version>
<com.google.gson.version>2.2.2</com.google.gson.version>
<com.google.zxing.version>3.2.1</com.google.zxing.version>
<com.thoughtworks.xstream.version>1.4.10</com.thoughtworks.xstream.version>
<commons-fileupload.version>1.3.1</commons-fileupload.version>
<dom4j.version>1.6.1</dom4j.version>
<qrcode.version>1.4</qrcode.version>
<eu.medsea.mimeutil.version>2.1.3</eu.medsea.mimeutil.version>
<mysql.driver.version>5.1.30</mysql.driver.version>
<mybatis.version>3.2.8</mybatis.version>
<mybatis-spring.version>1.2.3</mybatis-spring.version>
<cxf.version>2.2.3</cxf.version>
<!-- environment setting -->
<jdk.version>1.8</jdk.version>
<tomcat.version>2.2</tomcat.version>
<webserver.port>8888</webserver.port>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources>
<slf4j.version>1.7.7</slf4j.version>
<!-- logback setting -->
<ch.qos.logback.version>1.1.7</ch.qos.logback.version>
<org.slf4j.version>1.7.7</org.slf4j.version>
</properties>
<!-- 配置环境 -->
<profiles>
<profile>
<id>prod</id>
<!-- <activation>
<activeByDefault>true</activeByDefault>
</activation> -->
<properties>
<package.environment>prod</package.environment>
</properties>
</profile>
<profile>
<id>stg</id>
<properties>
<package.environment>stg</package.environment>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<package.environment>test</package.environment>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${javax.servlet.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>${com.aliyun.oss.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${javax.servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.33</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${org.apache.commons.version}</version>
</dependency>
<dependency>
<groupId>eu.medsea.mimeutil</groupId>
<artifactId>mime-util</artifactId>
<version>${eu.medsea.mimeutil.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${com.google.gson.version}</version>
</dependency>
<!-- <dependency>
<groupId>javabuilder</groupId>
<artifactId>javabuilder_rt</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/rt.jar</systemPath>
</dependency>
<dependency>
<groupId>javabuilder</groupId>
<artifactId>javabuilder11_jce</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jce.jar</systemPath>
</dependency> -->
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${com.thoughtworks.xstream.version}</version>
</dependency>
<!-- LOGGING begin -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- logback -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<!-- Apache POI: start -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${org.apache.xmlbeans.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>openxml4j</artifactId>
<version>${org.apache.poi.openxml4j.version}</version>
</dependency>
<!-- itextpdf -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>${com.itextpdf.itext-asian.version}</version>
</dependency>
<!-- Zxing -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>${com.google.zxing.version}</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<!-- QRCode -->
<dependency>
<groupId>net.glxn</groupId>
<artifactId>qrgen</artifactId>
<version>${qrcode.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.driver.version}</version>
<scope>runtime</scope>
</dependency>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
</dependencies>
<!--构建设置 -->
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>conf/${package.environment}</directory>
<filtering>true</filtering>
<includes>
<include>*.*</include>
</includes>
</resource>
</resources>
<plugins>
<!-- insert jetty class(compiler) -->
<!-- 指定war包的执行入口-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<archive>
<manifest>
<mainClass>Runner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!-- 将Runner移动到Meta-info下面-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>main-class-placement</id>
<phase>prepare-package</phase>
<configuration>
<target>
<move todir="${project.build.directory}/${project.artifactId}-${project.version}-${package.environment}/">
<fileset dir="${project.build.directory}/classes/">
<include name="Runner.class" />
</fileset>
</move>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
<!-- <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<optimize>true</optimize>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
<showWarnings>false</showWarnings>
<compilerArguments>
<verbose />
<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin> -->
<!-- tomcat7插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat.version}</version>
<configuration>
<port>${webserver.port}</port>
<path>/${project.artifactId}</path>
<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.phxl.modules.goods.dao.medinstore;
import java.util.List;
import com.phxl.modules.goods.entity.medinstore.MedInStoreDetail;
public interface MedInStoreDetailDao {
void batchInsert(List<MedInStoreDetail> details);
}
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>medicinal-supplier</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>
package com.phxl.modules.goods.service.suoutstore;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao;
import com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
@Service
public class SuOutStoreService {
@Autowired
private SuOutStoreDao suOutStoreDao;
@Autowired
private SuOutStoreDetailDao suOutStoreDetailDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public boolean batchSave(List<SuOutStoreWithDetail> suOutStoreWithDetailList) {
boolean result = true;
try {
checkSuOutStore(suOutStoreWithDetailList);
} catch (Exception e) {
throw new BaseException("前置机:"+e.getMessage());
}
for (SuOutStoreWithDetail suOutStore : suOutStoreWithDetailList) {
List<SuOutStoreDetail> details = suOutStore.getBill().getBilldetaillist();
String id = IdUtil.uuid();
SuOutStore su = suOutStore.getBill();
su.setId(id);
if(details != null && details.size() != 0){
for (SuOutStoreDetail suOutStoreDetail : details) {
suOutStoreDetail.setBillNo(suOutStore.getBill().getBillNo());
suOutStoreDetail.setId(id);
}
suOutStoreDao.insert(su);
suOutStoreDetailDao.batchInsert(details);
}
}
return result;
}
private void checkSuOutStore(List<SuOutStoreWithDetail> suOutStoreWithDetailsList) {
if(suOutStoreWithDetailsList == null || suOutStoreWithDetailsList.size() == 0){
logger.error("前置机:无相应供应商出库单据信息");
throw new BaseException("前置机:无相应供应商出库单据信息");
}
for (SuOutStoreWithDetail suOutStoreWithDetails : suOutStoreWithDetailsList) {
String billNo = suOutStoreWithDetails.getBill().getBillNo();
if (StringUtils.isEmpty(billNo)) {
logger.error("前置机:供应商出库单单据编号不能为空");
throw new BaseException("前置机:供应商出库单单据编号不能为空");
}
String medGuid = suOutStoreWithDetails.getBill().getMedGuid();
String medName = suOutStoreWithDetails.getBill().getMedName();
if (StringUtils.isEmpty(medGuid) || StringUtils.isEmpty(medName)) {
logger.error("前置机:供应商出库单单据编号:"+billNo+"医疗机构代码以及医疗机构名称不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"医疗机构代码以及医疗机构名称不能为空");
}
List<SuOutStoreDetail> details = suOutStoreWithDetails.getBill().getBilldetaillist();
if(details == null || details.size() == 0){
logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细不能为空");
}
for (SuOutStoreDetail suOutStoreDetail : details) {
String detailBillNo = suOutStoreDetail.getBillNo();
if (StringUtils.isEmpty(detailBillNo)) {
logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细单据编号不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细单据编号不能为空");
}
int rowNo = suOutStoreDetail.getRowNo();
if (rowNo == 0) {
logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细行号不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细行号不能为空");
}
int medPlanRowNo = suOutStoreDetail.getMedPlanRowNo();
if (medPlanRowNo == 0) {
logger.error("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细补货计划单据原行号不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+"出库单单据明细补货计划单据原行号不能为空");
}
String goodsGuid = suOutStoreDetail.getGoodsGuid();
String goodsName = suOutStoreDetail.getGoodsName();
if (StringUtils.isEmpty(goodsGuid) || StringUtils.isEmpty(goodsName)) {
logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品编码以及商品名称不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品编码以及商品名称不能为空");
}
String goodsSpec = suOutStoreDetail.getGoodsSpec();
if (StringUtils.isEmpty(goodsSpec)) {
logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品规格不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细商品规格不能为空");
}
String lot = suOutStoreDetail.getLot();
if (StringUtils.isEmpty(lot)) {
logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细批号不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细批号不能为空");
}
Date productionDate = suOutStoreDetail.getProductionDate();
Date expireDate = suOutStoreDetail.getExpireDate();
if (productionDate == null || expireDate == null) {
logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细生产日期以及有效期不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细生产日期以及有效期不能为空");
}
BigDecimal arrivalqty = suOutStoreDetail.getArrivalqty();
if (arrivalqty == null) {
logger.error("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细出库数不能为空");
throw new BaseException("前置机:供应商出库单单据编号:"+billNo+",行号:"+rowNo+"出库单单据明细出库数不能为空");
}
}
}
}
}
package com.phxl.modules.goods.service.invoiceback;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao;
import com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
@Service
public class SuInvoiceBackService {
@Autowired
private SuInvoiceBackDao invoiceBackDao;
@Autowired
private SuInvoiceBackDetailDao invoiceBackDetailDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public boolean batchSaveOrUpdate(List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList) {
boolean result = true;
try {
checkSuInvoiceBack(suInvoiceBackWithDetailList);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
for (SuInvoiceBackWithDetail suInvoiceBackWithDetail : suInvoiceBackWithDetailList) {
SuInvoiceBack suInvoiceBack = suInvoiceBackWithDetail.getBill();
List<SuInvoiceBackDetail> backDetails = suInvoiceBack.getBilldetaillist();
String id = IdUtil.uuid();
suInvoiceBack.setId(id);
if(backDetails != null &&backDetails.size() != 0){
for (SuInvoiceBackDetail suInvoiceBackDetail : backDetails) {
suInvoiceBackDetail.setSettleBillNo(suInvoiceBack.getSettleBillNo());
suInvoiceBackDetail.setId(id);
}
invoiceBackDao.insert(suInvoiceBack);
invoiceBackDetailDao.batchInsert(backDetails);
}
}
return result;
}
private void checkSuInvoiceBack(List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList) {
if(suInvoiceBackWithDetailList == null || suInvoiceBackWithDetailList.size() == 0){
logger.error("无相应供应商回传发票信息");
throw new BaseException("无相应供应商回传发票信息");
}
for (SuInvoiceBackWithDetail suInvoiceBackWithDetail : suInvoiceBackWithDetailList) {
SuInvoiceBack suInvoiceBack = suInvoiceBackWithDetail.getBill();
String settleBillNo = suInvoiceBack.getSettleBillNo();
if (StringUtils.isEmpty(settleBillNo)) {
logger.error("供应商回传发票结算单号不能为空");
throw new BaseException("供应商回传发票结算单号不能为空");
}
Date settleDate = suInvoiceBack.getSettleDate();
if (settleDate == null) {
logger.error("供应商回传发票结算单号:"+settleBillNo+"结算单日期不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"结算单日期不能为空");
}
List<SuInvoiceBackDetail> backDetails = suInvoiceBack.getBilldetaillist();
if(backDetails == null || backDetails.size() == 0){
logger.error("供应商回传发票结算单号:"+settleBillNo+"回传发票明细不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细不能为空");
}
for (SuInvoiceBackDetail suInvoiceBackDetail : backDetails) {
String detailSettleBillNo = suInvoiceBackDetail.getSettleBillNo();
if (StringUtils.isEmpty(detailSettleBillNo)) {
logger.error("供应商回传发票结算单号:"+settleBillNo+"回传发票明细结算单号不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细结算单号不能为空");
}
int rowNo = suInvoiceBackDetail.getRowNo();
if (rowNo == 0) {
logger.error("供应商回传发票结算单号:"+settleBillNo+"回传发票明细行号不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细行号不能为空");
}
String goodsCode = suInvoiceBackDetail.getGoodsCode();
if (StringUtils.isEmpty(goodsCode)) {
logger.error("供应商回传发票结算单号:"+settleBillNo+",行号:"+rowNo+"回传发票明细商品编码不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细商品编码不能为空");
}
String unit = suInvoiceBackDetail.getUnit();
if (StringUtils.isEmpty(unit)) {
logger.error("供应商回传发票结算单号:"+settleBillNo+",行号:"+rowNo+"回传发票明细包装单位不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细包装单位不能为空");
}
BigDecimal settleQty = suInvoiceBackDetail.getSettleQty();
if (settleQty == null) {
logger.error("供应商回传发票结算单号:"+settleBillNo+",行号:"+rowNo+"回传发票明细结算数量不能为空");
throw new BaseException("供应商回传发票结算单号:"+settleBillNo+"回传发票明细结算数量不能为空");
}
}
}
}
}
package com.phxl.common.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
public class SimpleCORSFilter implements Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with");
chain.doFilter(req, res);
}
public void init(FilterConfig filterConfig) {}
public void destroy() {}
}
package com.phxl.modules.goods.entity.supplygoods;
import java.math.BigDecimal;
import java.util.Date;
/**
* 医院采购目录
*/
public class MedSupplyGoods{
private String medSuppliercode; //供应商代码
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
private String medSuppliername; //供应商名称
private String goodsCode; //HIS商品编码
private String goodsName; //商品名称
private String producer; //生产厂商
private String goodsSpec; //规格
private String unitStyle; //计量单位
private Date createTime; //创建时间
private Date updateTime; //更新时间
private BigDecimal price; //采购价
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMedSuppliercode() {
return medSuppliercode;
}
public void setMedSuppliercode(String medSuppliercode) {
this.medSuppliercode = medSuppliercode;
}
public String getMedSuppliername() {
return medSuppliername;
}
public void setMedSuppliername(String medSuppliername) {
this.medSuppliername = medSuppliername;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getProducer() {
return producer;
}
public void setProducer(String producer) {
this.producer = producer;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getUnitStyle() {
return unitStyle;
}
public void setUnitStyle(String unitStyle) {
this.unitStyle = unitStyle;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
/**
* Copyright (c) 2005-2011 springside.org.cn
*
* $Id: PropertiesLoader.java 1690 2012-02-22 13:42:00Z calvinxiu $
*/
package com.phxl.common.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.Properties;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
/**
* Properties文件载入工具类. 可载入多个properties文件, 相同的属性在最后载入的文件中的值将会覆盖之前的值,但以System的Property优先.
* @author calvin
* @version 2013-05-15
*/
public class PropertiesLoader {
private static Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
private static ResourceLoader resourceLoader = new DefaultResourceLoader();
private final Properties properties;
public PropertiesLoader(String... resourcesPaths) {
properties = loadProperties(resourcesPaths);
}
public Properties getProperties() {
return properties;
}
/**
* 取出Property,但以System的Property优先,取不到返回空字符串.
*/
private String getValue(String key) {
String systemProperty = System.getProperty(key);
if (systemProperty != null) {
return systemProperty;
}
if (properties.containsKey(key)) {
return properties.getProperty(key);
}
return "";
}
/**
* 取出String类型的Property,但以System的Property优先,如果都为Null则抛出异常.
*/
public String getProperty(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return value;
}
/**
* 取出String类型的Property,但以System的Property优先.如果都为Null则返回Default值.
*/
public String getProperty(String key, String defaultValue) {
String value = getValue(key);
return value != null ? value : defaultValue;
}
/**
* 取出Integer类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
*/
public Integer getInteger(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Integer.valueOf(value);
}
/**
* 取出Integer类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
*/
public Integer getInteger(String key, Integer defaultValue) {
String value = getValue(key);
return value != null ? Integer.valueOf(value) : defaultValue;
}
/**
* 取出Double类型的Property,但以System的Property优先.如果都为Null或内容错误则抛出异常.
*/
public Double getDouble(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Double.valueOf(value);
}
/**
* 取出Double类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容错误则抛出异常
*/
public Double getDouble(String key, Integer defaultValue) {
String value = getValue(key);
return value != null ? Double.valueOf(value) : defaultValue;
}
/**
* 取出Boolean类型的Property,但以System的Property优先.如果都为Null抛出异常,如果内容不是true/false则返回false.
*/
public Boolean getBoolean(String key) {
String value = getValue(key);
if (value == null) {
throw new NoSuchElementException();
}
return Boolean.valueOf(value);
}
/**
* 取出Boolean类型的Property,但以System的Property优先.如果都为Null则返回Default值,如果内容不为true/false则返回false.
*/
public Boolean getBoolean(String key, boolean defaultValue) {
String value = getValue(key);
return value != null ? Boolean.valueOf(value) : defaultValue;
}
/**
* 载入多个文件, 文件路径使用Spring Resource格式.
*/
private Properties loadProperties(String... resourcesPaths) {
Properties props = new Properties();
for (String location : resourcesPaths) {
// logger.debug("Loading properties file from:" + location);
InputStream is = null;
try {
Resource resource = resourceLoader.getResource(location);
is = resource.getInputStream();
props.load(is);
} catch (IOException ex) {
logger.info("Could not load properties from path:" + location + ", " + ex.getMessage());
} finally {
IOUtils.closeQuietly(is);
}
}
return props;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.supplierstock.SupplierStockDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="supplier_code" property="suppliercode" jdbcType="VARCHAR" />
<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.suppliercode},
#{obj.suppliername},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.stockQty},
#{obj.createTime},
#{obj.updateTime}
</trim>
</foreach>
</insert>
<!-- 新增SupplierStock-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
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)
values (
#{id,jdbcType=VARCHAR}
,#{suppliercode,jdbcType=VARCHAR}
,#{suppliername,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=TIMESTAMP}
,#{manufacturer,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{productionDate,jdbcType=TIMESTAMP}
,#{expireDate,jdbcType=TIMESTAMP}
,#{stockQty,jdbcType=DECIMAL}
,#{createTime,jdbcType=TIMESTAMP}
,#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://10.146.8.221:3306/medicinal-supplier-T?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=Test190326
spd_service_url = http://10.146.8.221:9002/medicinal-web/a/spdrecvsupplier/
huarun_service_url = http://61.190.54.189:8005/huarun/spd/syn/
package com.phxl.common.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import org.apache.commons.lang.StringUtils;
public class DateUtils {
public static Calendar cal = Calendar.getInstance();
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
/**
* 返回指定格式的字符串日期
*
* @param date
* 日期 允许NULL,为NULL时返回空字符
* @param format
* 返回的字符串日期格式
* @return
*/
public static String DateToStr(Date date, String format) {
String dateStr = null;
if (date != null) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
dateStr = simpleDateFormat.format(date);
}
return dateStr;
}
/**
* 日期转换为时间
*
* @param date
* @return
*/
public static Long toLong(Date date) {
String dateStr = DateToStr(date, "yyyyMMdd");
return new Long(dateStr);
}
public static Integer toInteger(Date date) {
String dateStr = DateToStr(date, "yyyyMMdd");
return new Integer(dateStr);
}
public static String IntegerToStr(Integer dateInteger, String oldFormat,
String newFormat) {
String dateStr = null;
try {
Date date = convertDate(dateInteger.toString(), oldFormat);
dateStr = DateToStr(date, newFormat);
} catch (ParseException e) {
e.printStackTrace();
}
return dateStr;
}
public static Integer strDateToIntegerDate(String start, String oldFormat,
String newFormat) {
String dateStr = null;
try {
Date date = convertDate(start, oldFormat);
dateStr = DateToStr(date, newFormat);
} catch (ParseException e) {
e.printStackTrace();
}
return new Integer(dateStr);
}
/**
* 将英文格式的时间字符串转换为中文格式
*
* @param enDateStr
* @param format
* @return
*/
public static String enDateStrToZhDateStr(String enDateStr, String format) {
SimpleDateFormat sdf = new SimpleDateFormat(
"EEE MMM d HH:mm:ss Z SSS yyyy", Locale.US);
Date date = null;
try {
date = sdf.parse(enDateStr);
} catch (ParseException e) {
e.printStackTrace();
}
String dateStr = DateUtils.DateToStr(date, format);
return dateStr;
}
/**
* 根据字符串返回指定格式的日期
*
* @param dateStr
* 日期(字符串)
* @param format
* 日期格式
* @return 日期(Date)
* @throws ParseException
*/
public static Date convertDate(String dateStr, String format)
throws ParseException {
java.util.Date date = null;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
date = simpleDateFormat.parse(dateStr);
return date;
}
public static String format(String dateStr, String format)
throws ParseException {
Date date = convertDate(dateStr, format);
return DateToStr(date, format);
}
/**
* 小时的变动
*
* @param hour
* @return
*/
public static Date minuteChange(Date date, Integer minute) {
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
calendar.add(java.util.Calendar.MINUTE, minute);
return calendar.getTime();
}
/**
* 小时的变动
*
* @param hour
* @return
*/
public static Date hourChange(Date date, Integer hour) {
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
calendar.add(java.util.Calendar.HOUR_OF_DAY, hour);
return calendar.getTime();
}
/**
* 天的变动
*
* @param hour
* @return
*/
public static Date dayChange(Date date, Integer day) {
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
calendar.add(java.util.Calendar.DAY_OF_WEEK, day);
return calendar.getTime();
}
/**
* 月的变动
*
* @param hour
* @return
*/
public static Date monthChange(Date date, Integer month) {
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
calendar.add(java.util.Calendar.MONTH, month);
return calendar.getTime();
}
/**
* 年的变动
*
* @param hour
* @return
*/
public static Date yearChange(Date date, Integer year) {
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
calendar.add(java.util.Calendar.YEAR, year);
return calendar.getTime();
}
/**
* 获取年
*
* @param date
* @return
*/
public static Integer getYear(Date date) {
if (null == date) {
return null;
}
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.YEAR);
}
/**
* 获取月
*
* @param date
* @return
*/
public static Integer getMonth(Date date) {
if (null == date) {
return null;
}
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.MONTH) + 1;
}
/**
* 获取日
*
* @param date
* @return
*/
public static Integer getDay(Date date) {
if (null == date) {
return null;
}
java.util.Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime(date);
return calendar.get(Calendar.DATE);
}
/**
* 设置日
*
* @param date
* @return
*/
public static Date setDay(Date date, Integer day) {
if (null == date) {
return null;
}
cal.setTime(date);
cal.set(Calendar.DATE, day);
return cal.getTime();
}
/**
* @param date1
* 需要比较的时间 不能为空(null),需要正确的日期格式
* @param date2
* 被比较的时间 为空(null)则为当前时间
* @param stype
* 返回值类型 0为多少天,1为多少个月,2为多少年
* @return
*/
public static Integer compareDate(String date1, String date2, int stype) {
if (null == date1) {
return null;
}
date2 = date2 == null ? DateUtils.getCurrentDate() : date2;
int n = 0;
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
try {
c1.setTime(DateUtils.convertDate(date1, DATE_FORMAT));
c2.setTime(DateUtils.convertDate(date2, DATE_FORMAT));
} catch (Exception e) {
e.printStackTrace();
}
while (!c1.after(c2)) { // 循环对比,直到相等,n 就是所要的结果
n++;
if (stype == 1) {
c1.add(Calendar.MONTH, 1); // 比较月份,月份+1
} else {
c1.add(Calendar.DATE, 1); // 比较天数,日期+1
}
}
n = n - 1;
if (stype == 2) {
n = n / 365;
}
return n;
}
/**
* 得到当前日期
*
* @return
*/
public static String getCurrentDate() {
Calendar c = Calendar.getInstance();
Date date = c.getTime();
SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd");
return simple.format(date);
}
/**
* 取得两个时间之间相差的天数
*
* @param d1
* @param d2
* @return
*/
public static int getIntervalDays(Date d1, Date d2) {
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(d1);
c2.setTime(d2);
if (c1.after(c2)) {
Calendar cal = c1;
c1 = c2;
c2 = cal;
}
long sl = c1.getTimeInMillis();
long el = c2.getTimeInMillis();
long ei = el - sl;
return (int) (ei / (1000 * 60 * 60 * 24));
}
/**
* 取得两个时间之间相差的年数
*
* @param d1
* @param d2
* @return
*/
public static Double getIntervalYears(Date d1, Date d2) {
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(d1);
c2.setTime(d2);
if (c1.after(c2)) {
Calendar cal = c1;
c1 = c2;
c2 = cal;
}
long sl = c1.getTimeInMillis();
long el = c2.getTimeInMillis();
long ei = el - sl;
return (ei / (1000 * 60 * 60 * 24 * 365 * 1.0));
}
/**
* 转换字符串为日期类型(固定格式) eg: 2011-7-7(2009-11-20)
*
* @param dateStr
*/
public static Date coalitionDateStr2(String dateStr, String fgf) {
String aaa = dateStr;
if (StringUtils.isNotBlank(dateStr)) {
String[] mry = dateStr.split(fgf);
String y = mry[0];
String m = mry[1];
String d = mry[2];
if (Integer.parseInt(m) < 10) {
m = "0" + m;
}
if (Integer.parseInt(d) < 10) {
d = "0" + d;
}
aaa = y + m + d;
}
java.util.Date date = null;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
try {
date = simpleDateFormat.parse(aaa);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.println(date.toString());
return date;
}
/**
* 转换字符串为日期类型(固定格式) eg: 01-1月 -00 12.00.00.000000000 上午(01-11月-00
* 12.00.00.000000000 上午)
*
* @param dateStr
*/
public static Date coalitionDateStr(String dateStr) {
String aaa = dateStr;
if (StringUtils.isNotBlank(dateStr)) {
String[] muStr = dateStr.split(" ");
if (muStr.length > 3) {
muStr[0] = muStr[0] + muStr[1];
muStr[1] = muStr[2];
muStr[2] = muStr[3];
}
String[] mry = muStr[0].split("-");
String d = mry[0];
String m = mry[1];
String y = mry[2];
String[] hfm = muStr[1].split("\\.");
String h = hfm[0];
if ("下午".equals(muStr[2])) {
int ah = Integer.parseInt(h) + 12;
h = ah + "";
}
String f = hfm[1];
String miao = hfm[2];
String hm = hfm[3];
if (m.contains("月")) {
m = m.replaceAll("月", "");
}
if (Integer.parseInt(m) < 10 && m.length() < 2) {
m = "0" + m;
}
aaa = y + m + d + " " + h + ":" + f + ":" + miao + ":" + hm;
}
java.util.Date date = null;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
"yyMMdd hh:mm:ss:SS");
try {
date = simpleDateFormat.parse(aaa);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return date;
}
/**
* 时间大小比较
*
* @param t1
* @param t2
* @return
*/
public static Integer timeCompare(Date t1, Date t2) {
if (t1 != null && t2 != null) {
Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance();
c1.setTime(t1);
c2.setTime(t2);
int result = c1.compareTo(c2);
return result;
}
return null;
}
/**
* 日期四舍五入
*
* @param date
* @return
*/
public static Date changeAverage(Date date, Integer num) {
if (null == date) {
return null;
}
Integer day = DateUtils.getDay(date);
date = DateUtils.dayChange(date, -(day - 1));
if (day > 15) {
date = DateUtils.monthChange(date, 1);
}
if (null != num) {
date = DateUtils.dayChange(date, num);
}
return date;
}
/**
* 日期格式化字符串
* @author 黄文君
* @date 2016年7月18日 下午3:56:12
*
* @param date
* @return String
*/
public static String format(Date date) {
return date!=null ? new SimpleDateFormat(TIME_FORMAT).format(date) : null;
}
/**
* 日期格式化字符串
* @author 黄文君
* @date 2016年7月18日 下午3:56:29
*
* @param date
* @param datePattern
* @return String
*/
public static String format(Date date, String datePattern) {
return date!=null ? new SimpleDateFormat(datePattern).format(date) : null;
}
/**
* 日期格式化字符串
* @author 黄文君
* @date 2016年7月18日 下午3:56:29
*
* @param date
* @param datePattern
* @return String
*/
public static String format(Date date, String datePattern, String defaultValue) {
String value = format(date, datePattern);
return value==null||value.trim().isEmpty() ? defaultValue : value;
}
/**
* 日期字符串解析成日期对象
* @author 黄文君
* @date 2016年7月18日 下午3:56:43
*
* @param dateString
* @throws ParseException
* @return Date
*/
public static Date parse(String dateString) throws ParseException {
return dateString!=null && !"".equals(dateString.trim()) ? new SimpleDateFormat(TIME_FORMAT).parse(dateString) : null;
}
/**
* 日期字符串解析成日期对象
* @author 黄文君
* @date 2016年7月18日 下午3:56:58
*
* @param dateString
* @param datePattern
* @throws ParseException
* @return Date
*/
public static Date parse(String dateString, String datePattern) throws ParseException {
return dateString!=null && !"".equals(dateString.trim()) ? new SimpleDateFormat(datePattern).parse(dateString) : null;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
</configuration>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.spills.HisSpillsDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.spills.HisSpills">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="depot_code" property="depotCode" jdbcType="VARCHAR" />
<result column="depot_name" property="depotName" jdbcType="VARCHAR" />
<result column="tack_stockdate" property="tackStockDate" jdbcType="TIMESTAMP" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="number" property="number" jdbcType="DECIMAL" />
<result column="storck_num" property="storckNum" jdbcType="DECIMAL" />
<result column="difference_num" property="differenceNum" jdbcType="DECIMAL" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="tackstock_billno" property="tackStockBillNo" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medCode},
#{obj.medName},
#{obj.depotCode},
#{obj.depotName},
#{obj.tackStockDate},
#{obj.operaterName},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.lot},
#{obj.unit},
#{obj.number},
#{obj.storckNum},
#{obj.differenceNum},
#{obj.productionDate},
#{obj.expireDate},
#{obj.supplierCode},
#{obj.supplierName},
#{obj.tackStockBillNo},
#{obj.price}
</trim>
</foreach>
</insert>
<!-- 新增HisSpills-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.spills.HisSpills">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{depotCode,jdbcType=VARCHAR}
,#{depotName,jdbcType=VARCHAR}
,#{tackStockDate,jdbcType=TIMESTAMP}
,#{operaterName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=VARCHAR}
,#{manufacturer,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{unit,jdbcType=VARCHAR}
,#{number,jdbcType=DECIMAL}
,#{storckNum,jdbcType=DECIMAL}
,#{differenceNum,jdbcType=DECIMAL}
,#{productionDate,jdbcType=TIMESTAMP}
,#{expireDate,jdbcType=TIMESTAMP}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{tackStockBillNo,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL}
)
</insert>
</mapper>
\ No newline at end of file
package com.phxl.modules.goods.dao.supplierstock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
public interface SupplierStockDao{
void insert(SupplierStock SupplierStock);
}
package com.phxl.modules.goods.entity.suoutstore;
import java.math.BigDecimal;
import java.util.Date;
/**
* 供应商出库单信息
*/
public class SuOutStoreDetail {
private String billNo; //单据编号
private int rowNo; //行号
private String medPlanNo; //医院补货计划单据号
private int medPlanRowNo; //补货计划单据原行号
private String goodsGuid; //商品编码
private String goodsName; //商品名称
private String goodsSpec; //商品规格
private String unit; //包装单位
private String manufacturer; //生产厂商
private BigDecimal purchaserPrice; //采购价格
private BigDecimal amount; //金额
private String lot; //批号
private Date productionDate; //生产日期
private Date expireDate; //有效期至
private BigDecimal poqty; //补货计划数
private BigDecimal arrivalqty; //出库数
private String memo; //备注
private String id;
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public int getRowNo() {
return rowNo;
}
public void setRowNo(int rowNo) {
this.rowNo = rowNo;
}
public String getMedPlanNo() {
return medPlanNo;
}
public void setMedPlanNo(String medPlanNo) {
this.medPlanNo = medPlanNo;
}
public int getMedPlanRowNo() {
return medPlanRowNo;
}
public void setMedPlanRowNo(int medPlanRowNo) {
this.medPlanRowNo = medPlanRowNo;
}
public String getGoodsGuid() {
return goodsGuid;
}
public void setGoodsGuid(String goodsGuid) {
this.goodsGuid = goodsGuid;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsSpec() {
return goodsSpec;
}
public void setGoodsSpec(String goodsSpec) {
this.goodsSpec = goodsSpec;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public BigDecimal getPurchaserPrice() {
return purchaserPrice;
}
public void setPurchaserPrice(BigDecimal purchaserPrice) {
this.purchaserPrice = purchaserPrice;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getLot() {
return lot;
}
public void setLot(String lot) {
this.lot = lot;
}
public Date getProductionDate() {
return productionDate;
}
public void setProductionDate(Date productionDate) {
this.productionDate = productionDate;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
public BigDecimal getPoqty() {
return poqty;
}
public void setPoqty(BigDecimal poqty) {
this.poqty = poqty;
}
public BigDecimal getArrivalqty() {
return arrivalqty;
}
public void setArrivalqty(BigDecimal arrivalqty) {
this.arrivalqty = arrivalqty;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
package com.phxl.modules.goods.entity.spills;
public class HisSpillsList {
public HisSpills getData() {
return data;
}
public void setData(HisSpills data) {
this.data = data;
}
private HisSpills data;
}
package com.phxl.modules.goods.web.spd;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.apache.commons.fileupload.disk.DiskFileItem;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.phxl.common.constants.PlatformConstant;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
import com.phxl.common.util.HTTPClient;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
import com.phxl.modules.goods.service.billback.BillBackService;
import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
import com.phxl.modules.goods.service.medinstore.MedInStoreService;
import com.phxl.modules.goods.service.medplan.MedPlanService;
import com.phxl.modules.goods.service.medstock.MedStockService;
import com.phxl.modules.goods.service.spills.HisSpillsService;
import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
@Controller
@RequestMapping(value = "/Api")
public class SpdControlller {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HisCtMedicineMaterialService ctMedicineMaterialService;
@Autowired
private InterfaceLogService interfaceLogService;
@Autowired
private HisCtDeptService hisCtDeptService;
@Autowired
private CTCareProvService cTCareProvService;
@Autowired
private MedSupplyGoodsService supplyGoodsService;
@Autowired
private MedStockService stockService;
@Autowired
private MedPlanService medPlanService;
@Autowired
private MedInStoreService medInStoreService;
@Autowired
private BillBackService backService;
@Autowired
private BillSettlementService billSettlementService;
@Autowired
private SupplierStockService supplierStockService;
@Autowired
private SuOutStoreService suOutStoreService;
@Autowired
private HisSpillsService hisSpillsService;
@Autowired
private SuInvoiceBackService suInvoiceBackService;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
logger.debug("药品目录接口请求参数:{}",medgoodsList);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
try {
materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
}
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
result = JSON.toJSONString(response);
//medgoodsList = ctMedicineMaterialService.createRequest();
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
@RequestMapping(value="/setHDept")
@ResponseBody
public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院科室资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtDept> depts = new ArrayList<HisCtDept>();
try {
depts = JSONObject.parseArray(params, HisCtDept.class);
int end = hisCtDeptService.batchSaveOrUpdate(depts);
if(end==1){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院人员资料接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedStaff")
@ResponseBody
public String setMedStaff(HttpServletRequest request, @RequestBody String params){
logger.debug("医院人员资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
boolean end = false;
try {
careProvs = JSONObject.parseArray(params, CTCareProv.class);
end = cTCareProvService.batchSaveOrUpdate(careProvs);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院采购目录接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMFSupplyGoods")
@ResponseBody
public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
logger.debug("医院采购目录接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
boolean end = false;
try {
supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
end = supplyGoodsService.batchSave(supplyGoods);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院库存接口
* @param request
* @param params
* @return
*/
@ResponseBody
@RequestMapping(value="/setMedStock",method = RequestMethod.POST)
public String setMedStock(HttpServletRequest request, @RequestBody String params){
logger.debug("HLI同步医院库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedStockList> stocks = new ArrayList<MedStockList>();
boolean end = false;
try {
stocks = JSONObject.parseArray(params, MedStockList.class);
end = stockService.batchSave(stocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院补货计划接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedPlan")
@ResponseBody
public String setMedPlan(HttpServletRequest request, @RequestBody String params){
logger.debug("补货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
boolean end = false;
try {
//改成批量的操作
medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
end = medPlanService.batchSave(medPlans);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院退货接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRMedRPI")
@ResponseBody
public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
logger.debug("医院退货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
boolean end = false;
try {
billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
end = backService.batchSave(billBacks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 结算单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRSettle")
@ResponseBody
public String setTRSettle(HttpServletRequest request, @RequestBody String params){
logger.debug("同步医院结算单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
boolean end = false;
try {
settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
end = billSettlementService.batchSave(settlementWithDetails);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商库存接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setStock")
@ResponseBody
public String setStock(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商同步库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
boolean end = false;
try {
supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
end = supplierStockService.batchSave(supplierStocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商出库单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTrmedwv")
@ResponseBody
public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
logger.debug("同步供应商出库单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
boolean end = false;
try {
suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
end = suOutStoreService.batchSave(suOutStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院盘点损溢接口
* @param request
* @param params
* @return
*/
@RequestMapping(value="/setTrDiff")
@ResponseBody
public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院盘点损溢接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
boolean end = false;
try {
spills = JSONObject.parseArray(params, HisSpillsList.class);
end = hisSpillsService.batchSave(spills);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商发票回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setInvoice")
@ResponseBody
public String setInvoice(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商发票回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
boolean end = false;
try {
suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/*
* 医院入库单回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedInStore")
@ResponseBody
public String setMedInStore(HttpServletRequest request, @RequestBody String params){
logger.debug("医院入库单回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
boolean end = false;
try {
//改成批量的操作
medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
end = medInStoreService.batchSave(medInStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/***
* 推送对账数据到平台
* @param params
* @return
*/
@RequestMapping("/pushBalance")
@ResponseBody
public String pushBalance(@RequestBody String params) {
logger.debug("推送对账数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送对账数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送发药数据到平台
* @param params
* @return
*/
@RequestMapping("/pushDispensing")
@ResponseBody
public String pushDispensing(@RequestBody String params){
logger.debug("推送发药数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送库存数据到平台
* @param params
* @return
*/
@RequestMapping("/pushStock")
@ResponseBody
public String pushStock(@RequestBody String params){
logger.debug("推送库存数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送库存数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicinfo")
@ResponseBody
public String pushlicinfo(@RequestBody String params){
logger.debug("证照数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照图片数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicpicinfo")
@ResponseBody
public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
String result = "";
String logId = IdUtil.uuid();
String exception = "";
PlatFormResponse response = new PlatFormResponse();
interfaceLogService.saveLog("pushDispensing:(推送证照数据)","filename////"+file.getOriginalFilename(), logId);
try {
if (file!=null) {
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
File newfile = new File("/usr/local/img/"+file.getOriginalFilename());
file.transferTo(newfile);
FileBody bin = new FileBody(newfile);
HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
post.setEntity(reqEntity);
HttpResponse htppresponse = client.execute(post);
HttpEntity resEntity = htppresponse.getEntity();
result = EntityUtils.toString(resEntity, "UTF-8");
JSONObject jsonObject = JSONObject.parseObject(result);
if(!"Y".equals(jsonObject.getString("FLAG"))){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.toJSONString());
if (newfile.exists()) {
newfile.delete();
}
}
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照图片数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
}
package com.phxl.modules.goods.service.medplan;
import java.math.BigDecimal;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.medplan.MedPlanDao;
import com.phxl.modules.goods.dao.medplan.MedPlanDetailDao;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanDetail;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
@Service
public class MedPlanService{
@Autowired
private MedPlanDao planDao;
@Autowired
private MedPlanDetailDao planDetailDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
private void checkMedPlan(List<MedPlanWithDetail> plans) {
if(plans == null || plans.size() == 0){
logger.error("无相应补货计划单据信息");
throw new BaseException("无相应补货计划单据信息");
}
for (MedPlanWithDetail medPlans : plans) {
String medCode = medPlans.getTrmedPlan().getMedCode();
String medName = medPlans.getTrmedPlan().getMedName();
if (StringUtils.isEmpty(medCode) || StringUtils.isEmpty(medName)) {
logger.error("补货计划医疗机构编码以及医疗机构名称不能为空");
throw new BaseException("补货计划医疗机构编码以及医疗机构名称不能为空");
}
String supplierCode = medPlans.getTrmedPlan().getSupplierCode();
String suppliername = medPlans.getTrmedPlan().getSuppliername();
if (StringUtils.isEmpty(supplierCode) || StringUtils.isEmpty(suppliername)) {
logger.error("补货计划平台供应商代码以及平台供应商名称不能为空");
throw new BaseException("补货计划平台供应商代码以及平台供应商名称不能为空");
}
String billNo = medPlans.getTrmedPlan().getBillNo();
if (StringUtils.isEmpty(billNo)) {
logger.error("补货计划单据编号不能为空");
throw new BaseException("补货计划单据编号不能为空");
}
String billType = medPlans.getTrmedPlan().getBillType();
if (StringUtils.isEmpty(billType)) {
logger.error("补货计划单据类型不能为空");
throw new BaseException("补货计划单据类型不能为空");
}
List<MedPlanDetail> details = medPlans.getTrmedPlan().getTrmedplandetails();
if(details == null || details.size() == 0){
logger.error("补货计划单据编号:"+billNo+"订单明细不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细不能为空");
}
for (MedPlanDetail medPlanDetail : details) {
String detailBillNo = medPlanDetail.getBillNo();
if (StringUtils.isEmpty(detailBillNo)) {
logger.error("补货计划单据编号:"+billNo+"订单明细单据编号不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细单据编号不能为空");
}
String goodsCode = medPlanDetail.getGoodsCode();
String goodsName = medPlanDetail.getGoodsName();
if (StringUtils.isEmpty(goodsCode) || StringUtils.isEmpty(goodsName)) {
logger.error("补货计划单据编号:"+billNo+"订单明细商品编码以及商品名称不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细商品编码以及商品名称不能为空");
}
BigDecimal poQty = medPlanDetail.getPoQty();
if (poQty == null) {
logger.error("补货计划单据编号:"+billNo+"订单明细订货数不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细订货数不能为空");
}
BigDecimal taxpriceoQty = medPlanDetail.getTaxprice();
if (taxpriceoQty == null) {
logger.error("补货计划单据编号:"+billNo+"订单明细商品含税单价不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细商品含税单价不能为空");
}
BigDecimal taxsum = medPlanDetail.getTaxsum();
if (taxsum == null) {
logger.error("补货计划单据编号:"+billNo+"订单明细商品含税总金额不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细商品含税总金额不能为空");
}
String unit = medPlanDetail.getUnit();
if (StringUtils.isEmpty(unit)) {
logger.error("补货计划单据编号:"+billNo+"订单明细订货单位不能为空");
throw new BaseException("补货计划单据编号:"+billNo+"订单明细订货单位不能为空");
}
}
}
}
public boolean batchSave(List<MedPlanWithDetail> medPlans) {
boolean result = true;
try {
checkMedPlan(medPlans);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
for (MedPlanWithDetail medPlanWithDetail : medPlans) {
MedPlan medPlan = medPlanWithDetail.getTrmedPlan();
List<MedPlanDetail> details = medPlan.getTrmedplandetails();
String id = IdUtil.uuid();
medPlanWithDetail.getTrmedPlan().setId(id);
if(details != null && details.size() != 0){
for (MedPlanDetail medPlanDetail : details) {
medPlanDetail.setBillNo(medPlanWithDetail.getTrmedPlan().getBillNo());
medPlanDetail.setId(id);
}
planDao.insert(medPlan);
planDetailDao.batchInsert(details);
}
}
return result;
}
}
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="medicinal-supplier">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/conf/test"/>
<property name="java-output-path" value="/medicinal-supplier/target/classes"/>
<property name="context-root" value="medicinal-supplier"/>
</wb-module>
</project-modules>
package com.phxl.common.utils;
import java.util.UUID;
/**
* id生成
*/
public class IdUtil {
public static String uuid() {
return UUID.randomUUID().toString().replaceAll("-", "");
}
}
package com.phxl.common.util;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
/**
* JaxbUtil工具类
*/
public class JaxbUtil {
/**
* JavaBean转换成xml
* 默认编码UTF-8
* @param obj
* @return
*/
public static String convertToXml(Object obj) {
return convertToXml(obj, "UTF-8");
}
/**
* JavaBean转换成xml
* @param obj
* @param encoding
* @return
*/
public static String convertToXml(Object obj, String encoding) {
String result = null;
try {
JAXBContext context = JAXBContext.newInstance(obj.getClass());
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
StringWriter writer = new StringWriter();
marshaller.marshal(obj, writer);
result = writer.toString();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
/**
* xml转换成JavaBean
* @param xml
* @param c
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T converyToJavaBean(String xml, Class<T> c) {
T t = null;
try {
JAXBContext context = JAXBContext.newInstance(c);
Unmarshaller unmarshaller = context.createUnmarshaller();
t = (T) unmarshaller.unmarshal(new StringReader(xml));
} catch (Exception e) {
e.printStackTrace();
}
return t;
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.phxl</groupId>
<artifactId>medicinal-supplier</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>medicinal-supplier</name>
<url>http://maven.apache.org</url>
<!-- 属性配置 -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<junit.version>4.8.1</junit.version>
<javax.servlet.version>1.2</javax.servlet.version>
<javax.servlet.api.version>2.5</javax.servlet.api.version>
<spring.version>4.1.1.RELEASE</spring.version>
<org.apache.commons.version>3.0</org.apache.commons.version>
<org.apache.xmlbeans.version>2.6.0</org.apache.xmlbeans.version>
<org.apache.poi.version>3.9</org.apache.poi.version>
<org.apache.poi.openxml4j.version>1.0-beta</org.apache.poi.openxml4j.version>
<com.fasterxml.jackson.version>2.8.4</com.fasterxml.jackson.version>
<com.itextpdf.version>5.5.7</com.itextpdf.version>
<com.itextpdf.itext-asian.version>5.2.0</com.itextpdf.itext-asian.version>
<com.aliyun.oss.version>2.2.3</com.aliyun.oss.version>
<com.google.gson.version>2.2.2</com.google.gson.version>
<com.google.zxing.version>3.2.1</com.google.zxing.version>
<com.thoughtworks.xstream.version>1.4.10</com.thoughtworks.xstream.version>
<commons-fileupload.version>1.3.1</commons-fileupload.version>
<dom4j.version>1.6.1</dom4j.version>
<qrcode.version>1.4</qrcode.version>
<eu.medsea.mimeutil.version>2.1.3</eu.medsea.mimeutil.version>
<mysql.driver.version>5.1.30</mysql.driver.version>
<mybatis.version>3.2.8</mybatis.version>
<mybatis-spring.version>1.2.3</mybatis-spring.version>
<cxf.version>2.2.3</cxf.version>
<!-- environment setting -->
<jdk.version>1.8</jdk.version>
<tomcat.version>2.2</tomcat.version>
<webserver.port>8888</webserver.port>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources>
<slf4j.version>1.7.7</slf4j.version>
<!-- logback setting -->
<ch.qos.logback.version>1.1.7</ch.qos.logback.version>
<org.slf4j.version>1.7.7</org.slf4j.version>
</properties>
<!-- 配置环境 -->
<profiles>
<profile>
<id>prod</id>
<!-- <activation>
<activeByDefault>true</activeByDefault>
</activation> -->
<properties>
<package.environment>prod</package.environment>
</properties>
</profile>
<profile>
<id>stg</id>
<properties>
<package.environment>stg</package.environment>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<package.environment>test</package.environment>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${javax.servlet.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>${com.aliyun.oss.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${javax.servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.33</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${org.apache.commons.version}</version>
</dependency>
<dependency>
<groupId>eu.medsea.mimeutil</groupId>
<artifactId>mime-util</artifactId>
<version>${eu.medsea.mimeutil.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${com.google.gson.version}</version>
</dependency>
<!-- <dependency>
<groupId>javabuilder</groupId>
<artifactId>javabuilder_rt</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/rt.jar</systemPath>
</dependency>
<dependency>
<groupId>javabuilder</groupId>
<artifactId>javabuilder11_jce</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jce.jar</systemPath>
</dependency> -->
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${com.thoughtworks.xstream.version}</version>
</dependency>
<!-- LOGGING begin -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- logback -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<!-- Apache POI: start -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${org.apache.xmlbeans.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>openxml4j</artifactId>
<version>${org.apache.poi.openxml4j.version}</version>
</dependency>
<!-- itextpdf -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>${com.itextpdf.itext-asian.version}</version>
</dependency>
<!-- Zxing -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>${com.google.zxing.version}</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<!-- QRCode -->
<dependency>
<groupId>net.glxn</groupId>
<artifactId>qrgen</artifactId>
<version>${qrcode.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.driver.version}</version>
<scope>runtime</scope>
</dependency>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
</dependencies>
<!--构建设置 -->
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>conf/${package.environment}</directory>
<filtering>true</filtering>
<includes>
<include>*.*</include>
</includes>
</resource>
</resources>
<plugins>
<!-- insert jetty class(compiler) -->
<!-- 指定war包的执行入口-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<archive>
<manifest>
<mainClass>Runner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!-- 将Runner移动到Meta-info下面-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>main-class-placement</id>
<phase>prepare-package</phase>
<configuration>
<target>
<move todir="${project.build.directory}/${project.artifactId}-${project.version}-${package.environment}/">
<fileset dir="${project.build.directory}/classes/">
<include name="Runner.class" />
</fileset>
</move>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
<!-- <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<optimize>true</optimize>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
<showWarnings>false</showWarnings>
<compilerArguments>
<verbose />
<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin> -->
<!-- tomcat7插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat.version}</version>
<configuration>
<port>${webserver.port}</port>
<path>/${project.artifactId}</path>
<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.phxl.modules.goods.dao.ctcareprov;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import java.util.List;
import java.util.Map;
/**
*
* @ClassName: CTCareProvDao
* @Description: CTCareProv数据访问接口
* @author wangsenyong
* @date 2018-08-08 13:37:21
*
*/
public interface CTCareProvDao{
/**
* 过滤已添加的用户
* @return
*/
List<CTCareProv> getFilterCarProv();
List<CTCareProv> batchSelect(Map<String, Object> map);
void batchUpdate(List<CTCareProv> updateList);
void batchInsert(List<CTCareProv> insertList);
}
\ No newline at end of file
package com.phxl.common.util;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import com.alibaba.fastjson.JSON;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
public class HTTPClient {
private static HttpClient client;
//使用POST方法发送JSON数据
public static String sendJsonDataByPost(String url, String jsonData) throws Exception {
String result = "";
PlatFormResponse platFormResponse = new PlatFormResponse();
if (client == null){
client = HttpClients.createDefault();
}
try {
HttpPost post = new HttpPost(url);
post.setHeader("Content-Type", "application/json");
StringEntity entity1 = new StringEntity(jsonData,"UTF-8");
post.setEntity(entity1);
HttpResponse response = client.execute(post);
HttpEntity entity = response.getEntity();
result = EntityUtils.toString(entity, "UTF-8");
} catch (Exception e) {
platFormResponse.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
platFormResponse.setMsg(e.getMessage());
result = JSON.toJSONString(platFormResponse);
}
return result;
}
}
package com.phxl.modules.goods.web.spd;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.phxl.common.constants.PlatformConstant;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
import com.phxl.common.util.HTTPClient;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
import com.phxl.modules.goods.service.billback.BillBackService;
import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
import com.phxl.modules.goods.service.medinstore.MedInStoreService;
import com.phxl.modules.goods.service.medplan.MedPlanService;
import com.phxl.modules.goods.service.medstock.MedStockService;
import com.phxl.modules.goods.service.spills.HisSpillsService;
import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
@Controller
@RequestMapping(value = "/Api")
public class SpdControlller {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HisCtMedicineMaterialService ctMedicineMaterialService;
@Autowired
private InterfaceLogService interfaceLogService;
@Autowired
private HisCtDeptService hisCtDeptService;
@Autowired
private CTCareProvService cTCareProvService;
@Autowired
private MedSupplyGoodsService supplyGoodsService;
@Autowired
private MedStockService stockService;
@Autowired
private MedPlanService medPlanService;
@Autowired
private MedInStoreService medInStoreService;
@Autowired
private BillBackService backService;
@Autowired
private BillSettlementService billSettlementService;
@Autowired
private SupplierStockService supplierStockService;
@Autowired
private SuOutStoreService suOutStoreService;
@Autowired
private HisSpillsService hisSpillsService;
@Autowired
private SuInvoiceBackService suInvoiceBackService;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
logger.debug("药品目录接口请求参数:{}",medgoodsList);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
try {
materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
}
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
result = JSON.toJSONString(response);
//medgoodsList = ctMedicineMaterialService.createRequest();
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
@RequestMapping(value="/setHDept")
@ResponseBody
public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院科室资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtDept> depts = new ArrayList<HisCtDept>();
try {
depts = JSONObject.parseArray(params, HisCtDept.class);
int end = hisCtDeptService.batchSaveOrUpdate(depts);
if(end==1){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院人员资料接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedStaff")
@ResponseBody
public String setMedStaff(HttpServletRequest request, @RequestBody String params){
logger.debug("医院人员资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
boolean end = false;
try {
careProvs = JSONObject.parseArray(params, CTCareProv.class);
end = cTCareProvService.batchSaveOrUpdate(careProvs);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院采购目录接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMFSupplyGoods")
@ResponseBody
public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
logger.debug("医院采购目录接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
boolean end = false;
try {
supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
end = supplyGoodsService.batchSave(supplyGoods);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院库存接口
* @param request
* @param params
* @return
*/
@ResponseBody
@RequestMapping(value="/setMedStock",method = RequestMethod.POST)
public String setMedStock(HttpServletRequest request, @RequestBody String params){
logger.debug("HLI同步医院库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedStockList> stocks = new ArrayList<MedStockList>();
boolean end = false;
try {
stocks = JSONObject.parseArray(params, MedStockList.class);
end = stockService.batchSave(stocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院补货计划接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedPlan")
@ResponseBody
public String setMedPlan(HttpServletRequest request, @RequestBody String params){
logger.debug("补货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
boolean end = false;
try {
//改成批量的操作
medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
end = medPlanService.batchSave(medPlans);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院退货接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRMedRPI")
@ResponseBody
public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
logger.debug("医院退货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
boolean end = false;
try {
billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
end = backService.batchSave(billBacks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 结算单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRSettle")
@ResponseBody
public String setTRSettle(HttpServletRequest request, @RequestBody String params){
logger.debug("同步医院结算单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
boolean end = false;
try {
settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
end = billSettlementService.batchSave(settlementWithDetails);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商库存接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setStock")
@ResponseBody
public String setStock(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商同步库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
boolean end = false;
try {
supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
end = supplierStockService.batchSave(supplierStocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商出库单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTrmedwv")
@ResponseBody
public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
logger.debug("同步供应商出库单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
boolean end = false;
try {
suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
end = suOutStoreService.batchSave(suOutStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院盘点损溢接口
* @param request
* @param params
* @return
*/
@RequestMapping(value="/setTrDiff")
@ResponseBody
public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院盘点损溢接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
boolean end = false;
try {
spills = JSONObject.parseArray(params, HisSpillsList.class);
end = hisSpillsService.batchSave(spills);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商发票回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setInvoice")
@ResponseBody
public String setInvoice(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商发票回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
boolean end = false;
try {
suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/*
* 医院入库单回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedInStore")
@ResponseBody
public String setMedInStore(HttpServletRequest request, @RequestBody String params){
logger.debug("医院入库单回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
boolean end = false;
try {
//改成批量的操作
medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
end = medInStoreService.batchSave(medInStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/***
* 推送对账数据到平台
* @param params
* @return
*/
@RequestMapping("/pushBalance")
@ResponseBody
public String pushBalance(@RequestBody String params) {
logger.debug("推送对账数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送对账数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送发药数据到平台
* @param params
* @return
*/
@RequestMapping("/pushDispensing")
@ResponseBody
public String pushDispensing(@RequestBody String params){
logger.debug("推送发药数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送库存数据到平台
* @param params
* @return
*/
@RequestMapping("/pushStock")
@ResponseBody
public String pushStock(@RequestBody String params){
logger.debug("推送库存数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送库存数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicinfo")
@ResponseBody
public String pushlicinfo(@RequestBody String params){
logger.debug("证照数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照图片数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicpicinfo")
@ResponseBody
public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
String result = "";
String logId = IdUtil.uuid();
String exception = "";
PlatFormResponse response = new PlatFormResponse();
try {
if (file!=null) {
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", file).build();
post.setEntity(reqEntity);
HttpResponse htppresponse = client.execute(post);
HttpEntity resEntity = htppresponse.getEntity();
result = EntityUtils.toString(resEntity, "UTF-8");
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:参数为空");
}
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>出库单打印(三联单)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}物资出库单</h3></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
<tr>
<td width="21%" height="15">领用科室:${deptName}</td>
<td width="17%" height="15">出库日期:${outTime}</td>
<td width="27%" height="15">出库单号:${outNo}</td>
</tr>
<tr>
<td width="21%" height="15">拣货单号:${pickNo}</td>
<td width="17%" height="15">送货单号:${sendNo}</td>
<td width="27%" height="15">单位:元</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 18px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20px;">
<td width="25%" align="left"></td>
<td width="25%" align="left"></td>
<td width="21%" align="left"></td>
<td width="28%" align="left">合计金额:${totalPrice}</td>
</tr>
<tr height="20px;">
<td width="25%" align="left">制单人:${userName}</td>
<td width="25%" align="left">会计:</td>
<td width="21%" align="left">保管:</td>
<td width="28%" align="left">经办人:</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.phxl.common.util;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
/**
* 常用数据视图导出导入工具
* @version 1.0
*/
public class ExportUtil<T> {
public final static Logger logger = LoggerFactory.getLogger(ExportUtil.class);
//导入excel版本
private final static String XLS = "xls";
private final static String XLSX = "xlsx";
/**
* 根据给定数据源,导出EXCEL文档
* @param response HttpServletResponse
* @param fieldName excel每一列的表头.
* @param dataList excel数据,其中的key和表头中的值对应,value为数据
* @param title 表格标题,在表格最上面
* @param before 表格页眉(比如制单时间,科室之类的数据),紧跟标题,list中的值由逗号(英文)分隔数据(单元格),每一个String为一排
* @param after 表格页尾(比如制单时间,科室之类的数据),在表格末尾,list中的值由逗号(英文)分隔数据(单元格),每一个String为一排
* @param formatMap 数据格式,其中的key和表头中的key对应,value是格式编码。(如果为日期,则传日期格式yyyy-MM-dd之类的,
* 如果是数字,想保留小数位数,保留1位小数传0.0,保留2位小数传0.00,以此类推)
* @param excelName
* @throws Exception
*/
public static void exportExcel(HttpServletResponse response, List<String> fieldName,
List<Map<String, Object>> dataList, Map<String, String> formatMap, String title, List<String> before,
List<String> after, String excelName) throws Exception {
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet(title);
/**样式定义*/
//居中样式
HSSFCellStyle centerStyle = workbook.createCellStyle();//设置格式
centerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//居中
centerStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
//居中样式
HSSFCellStyle rightStyle = workbook.createCellStyle();//设置格式
rightStyle.setAlignment(HSSFCellStyle.ALIGN_RIGHT);//右对齐
rightStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
//创建顶部标题样式
HSSFCellStyle cellTitleStyle = workbook.createCellStyle();
cellTitleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
cellTitleStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
//创建顶部标题字体
HSSFFont fontTitle = workbook.createFont();
//fontTitle.setFontName("宋体");
fontTitle.setFontHeightInPoints((short) 16);
fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
cellTitleStyle.setFont(fontTitle);
//表头列名样式
HSSFCellStyle colNameStype = workbook.createCellStyle();
colNameStype.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
colNameStype.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
colNameStype.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);//灰色25
colNameStype.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);//填充
/**表名(大标题)*/
for (int i=0; i<fieldName.size(); i++) {
sheet.setDefaultColumnStyle(i, centerStyle);
sheet.setColumnWidth(i, 4500);
}
/**创建标题*/
int rowNum = 0;//第一行
HSSFRow rowTitle = sheet.createRow(rowNum++);
rowTitle.setHeightInPoints(40);
HSSFCell cellTitle = rowTitle.createCell(0);//表名单元格
cellTitle.setCellValue(title);
cellTitle.setCellStyle(cellTitleStyle);
sheet.addMergedRegion(new CellRangeAddress(0, (short) 0, 0, (short) (fieldName.size()-1)));
if (CollectionUtils.isNotEmpty(before)) {
//创建页眉
for (String item : before) {
HSSFRow rowHeader = sheet.createRow(rowNum++);
rowHeader.setHeightInPoints(18);
if (StringUtils.isEmpty(item)) {
continue;
}
String[] strs = item.split(",");
for (int i = 0; i < strs.length; i++) {
HSSFCell cell = rowHeader.createCell(i);//创建单元格
cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
cell.setCellValue(strs[i]);
}
}
}
//创建表格列表(DataList)列标
HSSFRow rowTableHead = sheet.createRow(rowNum++);
rowTableHead.setHeight((short)400);
for (int i = 0; i < fieldName.size(); i++) {
HSSFCell cell = rowTableHead.createCell(i);//创建单元格
cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
cell.setCellValue(fieldName.get(i));
cell.setCellStyle(colNameStype);
}
//创建表格列表(DataList)数据区域
for (int i=0; i<dataList.size(); i++) {
HSSFRow row = sheet.createRow(rowNum++);//创建行
row.setHeight((short)400);
for (int j = 0; j < fieldName.size(); j++) {
HSSFCell cell = row.createCell(j);//创建单元格
cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
Object columnValue = dataList.get(i).get(fieldName.get(j));//数据
String columnValueFomart = MapUtils.isEmpty(formatMap)? null : formatMap.get(fieldName.get(j));//数据格式
if (columnValue instanceof Date) {
//日期格式化
if (StringUtils.isBlank(columnValueFomart)) {
columnValueFomart = DateUtils.TIME_FORMAT;
}
cell.setCellValue(DateUtils.format((Date)columnValue, columnValueFomart));
} else if (columnValue instanceof Number) {
//数字格式化
if (null == columnValueFomart) {
cell.setCellValue(columnValue.toString());
} else {
DecimalFormat df1 = new DecimalFormat(columnValueFomart);
cell.setCellValue(df1.format(columnValue));
}
cell.setCellStyle(rightStyle);
} else {
cell.setCellValue(columnValue==null ? "" : columnValue.toString());
}
}
}
if (CollectionUtils.isNotEmpty(after)) {
// 创建页尾
for (String string : after) {
HSSFRow fieldRows = sheet.createRow(rowNum);
rowNum++;
if (StringUtils.isEmpty(string)) {
continue;
}
String[] strs = string.split(",");
for (int i = 0; i < strs.length; i++) {
// 创建单元格
HSSFCell cell = fieldRows.createCell(i);
// 定义单元格为字符串类型
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue(strs[i]);
}
}
}
//导出Excel文件流到浏览器
sendExcel(response, workbook, excelName);
}
/**
* 导出Excel文件流到浏览器
* @param response
* @param workbook
* @param excelName
* @throws Exception
* @return void
*/
public static void sendExcel(HttpServletResponse response, HSSFWorkbook workbook, String excelName) throws Exception {
if (workbook != null) {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;filename=" + new String(excelName.getBytes("gb2312"), "ISO8859-1") + ".xls");
OutputStream ouputStream = null;
try {
ouputStream = response.getOutputStream();
workbook.write(ouputStream);
ouputStream.flush();
} catch (IOException e) {
logger.error("导出Excel文件流到浏览器的时候异常!", e);
} finally {
try {
ouputStream.close();
} catch (IOException e) {
logger.error("关闭OutputStream异常!", e);
}
}
}
}
/**
* 创建表格
* @param response
* @param fieldName
* @param dataList
* @param formatMap
* @param title
* @param before
* @param after
* @param excelName
* @param excelmap
* @throws Exception
*/
public static void exportExcel(HttpServletResponse response, List<String> fieldName,
List<Map<String, Object>> dataList, Map<String, String> formatMap, String title, List<String> before,
List<String> after, String excelName, Map<String, String> excelmap) throws Exception {
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet(title);
/**样式定义*/
//居中样式
HSSFCellStyle centerStyle = workbook.createCellStyle();//设置格式
centerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//居中
centerStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
//居中样式
HSSFCellStyle rightStyle = workbook.createCellStyle();//设置格式
rightStyle.setAlignment(HSSFCellStyle.ALIGN_RIGHT);//右对齐
rightStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
//创建顶部标题样式
HSSFCellStyle cellTitleStyle = workbook.createCellStyle();
cellTitleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
cellTitleStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
//创建顶部标题字体
HSSFFont fontTitle = workbook.createFont();
//fontTitle.setFontName("宋体");
fontTitle.setFontHeightInPoints((short) 16);
fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
cellTitleStyle.setFont(fontTitle);
//表头列名样式
HSSFCellStyle colNameStype = workbook.createCellStyle();
colNameStype.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
colNameStype.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
colNameStype.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);//灰色25
colNameStype.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);//填充
/**表名(大标题)*/
for (int i=0; i<fieldName.size(); i++) {
sheet.setDefaultColumnStyle(i, centerStyle);
sheet.setColumnWidth(i, 4500);
}
/**创建标题*/
int rowNum = 0;//第一行
HSSFRow rowTitle = sheet.createRow(rowNum++);
rowTitle.setHeightInPoints(40);
HSSFCell cellTitle = rowTitle.createCell(0);//表名单元格
cellTitle.setCellValue(title);
cellTitle.setCellStyle(cellTitleStyle);
sheet.addMergedRegion(new CellRangeAddress(0, (short) 0, 0, (short) (fieldName.size()-1)));
if (CollectionUtils.isNotEmpty(before)) {
//创建页眉
for (String item : before) {
HSSFRow rowHeader = sheet.createRow(rowNum++);
rowHeader.setHeightInPoints(18);
if (StringUtils.isEmpty(item)) {
continue;
}
String[] strs = item.split(",");
for (int i = 0; i < strs.length; i++) {
HSSFCell cell = rowHeader.createCell(i);//创建单元格
cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
cell.setCellValue(strs[i]);
}
}
}
//创建表格列表(DataList)列标
HSSFRow rowTableHead = sheet.createRow(rowNum++);
rowTableHead.setHeight((short)400);
for (int i = 0; i < fieldName.size(); i++) {
HSSFCell cell = rowTableHead.createCell(i);//创建单元格
cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
cell.setCellValue(excelmap.get(fieldName.get(i)));
cell.setCellStyle(colNameStype);
}
//创建表格列表(DataList)数据区域
for (int i=0; i<dataList.size(); i++) {
HSSFRow row = sheet.createRow(rowNum++);//创建行
row.setHeight((short)400);
for (int j = 0; j < fieldName.size(); j++) {
HSSFCell cell = row.createCell(j);//创建单元格
cell.setCellType(HSSFCell.CELL_TYPE_STRING);//定义单元格为字符串类型
Object columnValue = dataList.get(i).get(fieldName.get(j));//数据
String columnValueFomart = MapUtils.isEmpty(formatMap)? null : formatMap.get(fieldName.get(j));//数据格式
if (columnValue instanceof Date) {
//日期格式化
if (StringUtils.isBlank(columnValueFomart)) {
columnValueFomart = DateUtils.TIME_FORMAT;
}
cell.setCellValue(DateUtils.format((Date)columnValue, columnValueFomart));
} else if (columnValue instanceof Number) {
//数字格式化
if (null == columnValueFomart) {
cell.setCellValue(columnValue.toString());
} else {
DecimalFormat df1 = new DecimalFormat(columnValueFomart);
cell.setCellValue(df1.format(columnValue));
}
cell.setCellStyle(rightStyle);
} else {
cell.setCellValue(columnValue==null ? "" : columnValue.toString());
}
}
}
if (CollectionUtils.isNotEmpty(after)) {
// 创建页尾
for (String string : after) {
HSSFRow fieldRows = sheet.createRow(rowNum);
rowNum++;
if (StringUtils.isEmpty(string)) {
continue;
}
String[] strs = string.split(",");
for (int i = 0; i < strs.length; i++) {
// 创建单元格
HSSFCell cell = fieldRows.createCell(i);
// 定义单元格为字符串类型
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue(strs[i]);
}
}
}
//导出Excel文件流到浏览器
sendExcel(response, workbook, excelName);
}
/*************************导入*************************/
/**
* 通用导入excel方法
* @param formFile 文件
* @param clas 映射的类
* @return 返回集合对象
* @throws Exception
*/
public List<T> readExcel(MultipartFile formFile,Class clas) throws Exception{
//检查文件
checkFile(formFile);
//获得工作簿对象
Workbook workbook = getWorkBook(formFile);
//创建返回对象,把每行中的值作为一个数组,所有的行作为一个集合返回
List<T> list = new ArrayList<T>();
//保存键值(对象属性和值)
Map<String,Object> map=new HashMap<String, Object>();
if(null!=workbook){
for(int sheetNum = 0;sheetNum<workbook.getNumberOfSheets();sheetNum++){
//获取当前sheet工作表
Sheet sheet = workbook.getSheetAt(sheetNum);
if(null == sheet){
continue;
}
//获得当前sheet的开始行
int firstRowNum = sheet.getFirstRowNum();
//获得当前sheet的结束行
int lastRowNum = sheet.getLastRowNum();
//循环除了第一行之外的所有行
for(int rowNum = firstRowNum+1;rowNum<=lastRowNum;rowNum++){
//获得对象实例
Object obj=clas.newInstance();
//获得当前行
Row row = sheet.getRow(rowNum);
if(row == null){
continue;
}
//后的当前行的开始列
int firstCellNum = row.getFirstCellNum();
//获得当前行的列数
int lastCellNum = row.getPhysicalNumberOfCells();
//循环当前行
for(int cellNum = firstCellNum;cellNum < lastCellNum;cellNum++){
Field [] field=clas.getDeclaredFields();
Cell cell = row.getCell(cellNum);
//得到对应的键值
map.put(field[cellNum-1].getName(),getCellValue(cell));
}
//通过属性名对对象进行赋值操作
setFieldValue(obj,map);
list.add((T) obj);
}
}
}
return list;
}
/**
* 为bean赋值属性值
* @param bean
* @param valMap
*/
public static void setFieldValue(Object bean, Map<String, Object> valMap) {
Class<?> cls = bean.getClass();
// 取出bean里的所有方法
Method[] methods = cls.getDeclaredMethods();
//取出bean 里面的属性
Field[] fields = cls.getDeclaredFields();
for (Field field : fields) {
try {
//通过属性名找到对应的set方法
String fieldSetName = parSetName(field.getName());
//判断set方法是否存在
if (!checkSetMet(methods, fieldSetName)) {
continue;
}
//通过set方法和属性类型得到对应的方法
Method fieldSetMet = cls.getMethod(fieldSetName, field.getType());
//通过属性名得到对应的值
String value = (String) valMap.get(field.getName());
if (null != value && !"".equals(value)) {
//得到属性类型的简写 如:java.lang.String 得到String
String fieldType = field.getType().getSimpleName();
//判断属性类型 为其进行转换
if ("String".equals(fieldType)) {
//赋值
fieldSetMet.invoke(bean, value);
} else if ("Date".equals(fieldType)) {
Date temp = parseDate(value);
fieldSetMet.invoke(bean, temp);
} else if ("Integer".equals(fieldType) || "int".equals(fieldType)) {
Integer intval = Integer.parseInt(value);
fieldSetMet.invoke(bean, intval);
} else if ("Long".equalsIgnoreCase(fieldType)) {
Long temp = Long.parseLong(value);
fieldSetMet.invoke(bean, temp);
} else if ("Double".equalsIgnoreCase(fieldType)) {
Double temp = Double.parseDouble(value);
fieldSetMet.invoke(bean, temp);
} else if ("Boolean".equalsIgnoreCase(fieldType)) {
Boolean temp = Boolean.parseBoolean(value);
fieldSetMet.invoke(bean, temp);
} else {
}
}
} catch (Exception e) {
continue;
}
}
}
/**
* 判断是否存在某属性的 set方法
* @param methods
* @param fieldSetMet
* @return boolean
*/
private static boolean checkSetMet(Method[] methods, String fieldSetMet) {
for (Method met : methods) {
if (fieldSetMet.equals(met.getName())) {
return true;
}
}
return false;
}
/**
* 格式化string为Date
* @param datestr
* @return date
*/
private static Date parseDate(String datestr) {
if (null == datestr || "".equals(datestr)) {
return null;
}
try {
String fmtstr = null;
if (datestr.indexOf(':') > 0) {
if(datestr.indexOf("-")>0) {
fmtstr = "yyyy-MM-dd HH:mm:ss";
}else {
fmtstr="HH:mm:ss";
}
} else {
fmtstr = "yyyy-MM-dd";
}
SimpleDateFormat sdf = new SimpleDateFormat(fmtstr);
return sdf.parse(datestr);
} catch (Exception e) {
return null;
}
}
/**
* 拼接在某属性的 set方法
* @param fieldName
* @return String
*/
private static String parSetName(String fieldName) {
if (null == fieldName || "".equals(fieldName)) {
return null;
}
return "set" + fieldName.substring(0, 1).toUpperCase()
+ fieldName.substring(1);
}
/**
* 获取当前行数据
* @param cell
* @return
*/
@SuppressWarnings("deprecation")
private static String getCellValue(Cell cell){
String cellValue = "";
if(cell == null){
return cellValue;
}
//把数字当成String来读,避免出现1读成1.0的情况
if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
if(DateUtil.isCellDateFormatted(cell)){
//用于转化为日期格式
Date d = cell.getDateCellValue();
DateFormat formater = new SimpleDateFormat("HH:mm:ss");
cellValue = formater.format(d);
return cellValue;
}else {
cell.setCellType(Cell.CELL_TYPE_STRING);
}
}
//判断数据的类型
switch(cell.getCellType()){
case Cell.CELL_TYPE_NUMERIC://数字0
cellValue = String.valueOf(cell.getNumericCellValue());
break;
case Cell.CELL_TYPE_STRING://字符串
cellValue = String.valueOf(cell.getStringCellValue());
break;
case Cell.CELL_TYPE_BOOLEAN://Boolean
cellValue = String.valueOf(cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_FORMULA://公式
cellValue = String.valueOf(cell.getCellFormula());
break;
case Cell.CELL_TYPE_BLANK://空值
cellValue = "";
break;
case Cell.CELL_TYPE_ERROR://故障
cellValue = "非法字符";
break;
default:
cellValue = "未知类型";
break;
}
return cellValue;
}
/**
* 获得工作簿对象
* @param formFile
* @return
*/
public static Workbook getWorkBook(MultipartFile formFile){
//获得文件名
// String fileName = formFile.getName();
String fileName = formFile.getOriginalFilename();
//创建Workbook工作簿对象,表示整个excel
Workbook workbook = null;
try {
//获得excel文件的io流
InputStream is = formFile.getInputStream();
//根据文件后缀名不同(xls和xlsx)获得不同的workbook实现类对象
if(fileName.endsWith(XLS)){
//2003
workbook = new HSSFWorkbook(is);
}else if(fileName.endsWith(XLSX)){
//2007
workbook = new XSSFWorkbook(is);
}
} catch (IOException e) {
e.printStackTrace();
}
return workbook;
}
/**
*检查文件
* @param formFile
* @throws IOException
*/
public static void checkFile(MultipartFile formFile) throws IOException{
//判断文件是否存在
// logger.error("文件不存在!");
if(null == formFile){
throw new FileNotFoundException("文件不存在!");
}
//获得文件名
// String fileName = formFile.getName();
String fileName = formFile.getOriginalFilename();
//判断文件是否是excel文件
if(!fileName.endsWith(XLS) && !fileName.endsWith(XLSX)){
// logger.error(fileName+"不是excel文件!");
throw new IOException(fileName+"不是excel文件!");
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
<result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
<result column="real_name" property="realName" jdbcType="VARCHAR" />
<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
<result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
<result column="idcode" property="idcode" jdbcType="VARCHAR" />
<result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
<result column="category" property="category" jdbcType="VARCHAR" />
<result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.mfmedStaffCode},
#{obj.logonUser},
#{obj.realName},
#{obj.helpCode},
#{obj.sex},
#{obj.mobileTel},
#{obj.webChatCode},
#{obj.idcode},
#{obj.e_mail},
#{obj.hdeptCode},
#{obj.category},
#{obj.ishadministrator},
#{obj.update_time}
</trim>
</foreach>
</insert>
<!-- 批量查询HisCtDept -->
<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from med_hli_care_prov
<if test="ryCodes != null">
where mfmed_staff_code in
<foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<update id="batchUpdate" parameterType="list">
update med_hli_care_prov
<trim prefix="set" suffixOverrides=",">
<trim prefix="mfmed_staff_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
when id = #{obj.id}
then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="logon_user=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.logonUser != null and obj.logonUser != ''">
when id = #{obj.id}
then
#{obj.logonUser,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="real_name=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.realName != null and obj.realName != ''">
when id = #{obj.id}
then #{obj.realName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="sex=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.sex != null and obj.sex != ''">
when id = #{obj.id}
then #{obj.sex,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="mobile_tel=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.mobileTel != null and obj.mobileTel != ''">
when id = #{obj.id}
then #{obj.mobileTel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="web_chat_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.webChatCode != null and obj.webChatCode != ''">
when id = #{obj.id}
then #{obj.webChatCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="idcode=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.idcode != null and obj.idcode != ''">
when id = #{obj.id}
then #{obj.idcode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="hdept_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
when id = #{obj.id}
then #{obj.hdeptCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="e_mail=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.e_mail != null and obj.e_mail != ''">
when id = #{obj.id}
then #{obj.e_mail,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="ishadministrator=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.ishadministrator != null and obj.ishadministrator != ''">
when id = #{obj.id}
then #{obj.ishadministrator,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.update_time != null and obj.update_time != ''">
when id = #{obj.id}
then #{obj.update_time,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="obj" index="index">
id
= #{obj.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>送货单打印(普通A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}送货单</h3></td>
<td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
</tr>
<tr>
<td width="25%" height="30">供应商:${fOrgName}</td>
<td width="25%" height="30">订单号:${orderNo}</td>
<td width="25%" height="30">送货单号:${sendNo}</td>
<!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
</tr>
<tr>
<td height="30">制单人:${sendUsername}</td>
<td height="30" colspan="2">制单时间:${sendDate}</td>
</tr>
<tr>
<td height="30" >收货科室:${deptName}</td>
<td height="30" colspan="2">收货地址:${tfAddress}</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 25px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80;">有效期至</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="30%" align="left">验收人:</td>
<td width="30%" align="left">收货人:</td>
<td width="20%" align="left">总金额:${totalPrice}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
ALTER TABLE med_hli_plan ADD COLUMN settle_type VARCHAR(10) COMMENT '0:零库存 1:非零库存' AFTER bill_type;
\ No newline at end of file
package com.phxl.modules.goods.web.spd;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.phxl.common.constants.PlatformConstant;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
import com.phxl.common.util.HTTPClient;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
import com.phxl.modules.goods.service.billback.BillBackService;
import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
import com.phxl.modules.goods.service.medinstore.MedInStoreService;
import com.phxl.modules.goods.service.medplan.MedPlanService;
import com.phxl.modules.goods.service.medstock.MedStockService;
import com.phxl.modules.goods.service.spills.HisSpillsService;
import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
@Controller
@RequestMapping(value = "/Api")
public class SpdControlller {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HisCtMedicineMaterialService ctMedicineMaterialService;
@Autowired
private InterfaceLogService interfaceLogService;
@Autowired
private HisCtDeptService hisCtDeptService;
@Autowired
private CTCareProvService cTCareProvService;
@Autowired
private MedSupplyGoodsService supplyGoodsService;
@Autowired
private MedStockService stockService;
@Autowired
private MedPlanService medPlanService;
@Autowired
private MedInStoreService medInStoreService;
@Autowired
private BillBackService backService;
@Autowired
private BillSettlementService billSettlementService;
@Autowired
private SupplierStockService supplierStockService;
@Autowired
private SuOutStoreService suOutStoreService;
@Autowired
private HisSpillsService hisSpillsService;
@Autowired
private SuInvoiceBackService suInvoiceBackService;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
logger.debug("药品目录接口请求参数:{}",medgoodsList);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
try {
materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
}
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
result = JSON.toJSONString(response);
//medgoodsList = ctMedicineMaterialService.createRequest();
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
@RequestMapping(value="/setHDept")
@ResponseBody
public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院科室资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtDept> depts = new ArrayList<HisCtDept>();
try {
depts = JSONObject.parseArray(params, HisCtDept.class);
int end = hisCtDeptService.batchSaveOrUpdate(depts);
if(end==1){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院人员资料接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedStaff")
@ResponseBody
public String setMedStaff(HttpServletRequest request, @RequestBody String params){
logger.debug("医院人员资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
boolean end = false;
try {
careProvs = JSONObject.parseArray(params, CTCareProv.class);
end = cTCareProvService.batchSaveOrUpdate(careProvs);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院采购目录接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMFSupplyGoods")
@ResponseBody
public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
logger.debug("医院采购目录接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
boolean end = false;
try {
supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
end = supplyGoodsService.batchSave(supplyGoods);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院库存接口
* @param request
* @param params
* @return
*/
@ResponseBody
@RequestMapping(value="/setMedStock",method = RequestMethod.POST)
public String setMedStock(HttpServletRequest request, @RequestBody String params){
logger.debug("HLI同步医院库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedStockList> stocks = new ArrayList<MedStockList>();
boolean end = false;
try {
stocks = JSONObject.parseArray(params, MedStockList.class);
end = stockService.batchSave(stocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院补货计划接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedPlan")
@ResponseBody
public String setMedPlan(HttpServletRequest request, @RequestBody String params){
logger.debug("补货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
boolean end = false;
try {
//改成批量的操作
medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
end = medPlanService.batchSave(medPlans);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院退货接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRMedRPI")
@ResponseBody
public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
logger.debug("医院退货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
boolean end = false;
try {
billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
end = backService.batchSave(billBacks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 结算单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRSettle")
@ResponseBody
public String setTRSettle(HttpServletRequest request, @RequestBody String params){
logger.debug("同步医院结算单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
boolean end = false;
try {
settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
end = billSettlementService.batchSave(settlementWithDetails);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商库存接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setStock")
@ResponseBody
public String setStock(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商同步库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
boolean end = false;
try {
supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
end = supplierStockService.batchSave(supplierStocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商出库单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTrmedwv")
@ResponseBody
public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
logger.debug("同步供应商出库单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
boolean end = false;
try {
suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
end = suOutStoreService.batchSave(suOutStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院盘点损溢接口
* @param request
* @param params
* @return
*/
@RequestMapping(value="/setTrDiff")
@ResponseBody
public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院盘点损溢接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
boolean end = false;
try {
spills = JSONObject.parseArray(params, HisSpillsList.class);
end = hisSpillsService.batchSave(spills);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商发票回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setInvoice")
@ResponseBody
public String setInvoice(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商发票回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
boolean end = false;
try {
suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/*
* 医院入库单回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedInStore")
@ResponseBody
public String setMedInStore(HttpServletRequest request, @RequestBody String params){
logger.debug("医院入库单回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
boolean end = false;
try {
//改成批量的操作
medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
end = medInStoreService.batchSave(medInStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/***
* 推送对账数据到平台
* @param params
* @return
*/
@RequestMapping("/pushBalance")
@ResponseBody
public String pushBalance(@RequestBody String params) {
logger.debug("推送对账数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送对账数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送发药数据到平台
* @param params
* @return
*/
@RequestMapping("/pushDispensing")
@ResponseBody
public String pushDispensing(@RequestBody String params){
logger.debug("推送发药数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送库存数据到平台
* @param params
* @return
*/
@RequestMapping("/pushStock")
@ResponseBody
public String pushStock(@RequestBody String params){
logger.debug("推送库存数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送库存数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
default-lazy-init="true">
<!-- 启用注解 -->
<context:component-scan base-package="com.phxl" />
<!-- 引入属性文件 -->
<context:property-placeholder location="classpath:config.properties"/>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!-- 配置sqlsessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations">
<list>
<value>classpath:/mappings/**/*.xml</value>
</list>
</property>
</bean>
<!-- 扫描Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.phxl.modules"/>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 启用注解事务 -->
<tx:annotation-driven/>
</beans>
\ No newline at end of file
package com.phxl.common.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class JsonToUtils
{
/**
*
* @author wangwei JSON工具类
* @param
*
*/
/***
* 将List对象序列化为JSON文本
*/
public static <T> String toJSONString(List<T> list)
{
JSONArray jsonArray = JSONArray.fromObject(list);
return jsonArray.toString();
}
/***
* 将对象序列化为JSON文本
* @param object
* @return
*/
public static String toJSONString(Object object)
{
JSONArray jsonArray = JSONArray.fromObject(object);
return jsonArray.toString();
}
/***
* 将JSON对象数组序列化为JSON文本
* @param jsonArray
* @return
*/
public static String toJSONString(JSONArray jsonArray)
{
return jsonArray.toString();
}
/***
* 将JSON对象序列化为JSON文本
* @param jsonObject
* @return
*/
public static String toJSONString(JSONObject jsonObject)
{
return jsonObject.toString();
}
/***
* 将对象转换为List对象
* @param object
* @return
*/
public static List toArrayList(Object object)
{
List arrayList = new ArrayList();
JSONArray jsonArray = JSONArray.fromObject(object);
Iterator it = jsonArray.iterator();
while (it.hasNext())
{
JSONObject jsonObject = (JSONObject) it.next();
Iterator keys = jsonObject.keys();
while (keys.hasNext())
{
Object key = keys.next();
Object value = jsonObject.get(key);
arrayList.add(value);
}
}
return arrayList;
}
/***
* 将对象转换为Collection对象
* @param object
* @return
*/
public static Collection toCollection(Object object)
{
JSONArray jsonArray = JSONArray.fromObject(object);
return JSONArray.toCollection(jsonArray);
}
/***
* 将对象转换为JSON对象数组
* @param object
* @return
*/
public static JSONArray toJSONArray(Object object)
{
return JSONArray.fromObject(object);
}
/***
* 将对象转换为JSON对象
* @param object
* @return
*/
public static JSONObject toJSONObject(Object object)
{
return JSONObject.fromObject(object);
}
/***
* 将对象转换为HashMap
* @param object
* @return
*/
public static HashMap toHashMap(Object object)
{
HashMap<String, Object> data = new HashMap<String, Object>();
JSONObject jsonObject = toJSONObject(object);
Iterator it = jsonObject.keys();
while (it.hasNext())
{
String key = String.valueOf(it.next());
Object value = jsonObject.get(key);
data.put(key, value);
}
return data;
}
/***
* 将对象转换为List>
* @param object
* @return
*/
// 返回非实体类型(Map)的List
public static List<Map<String, Object>> toList(Object object)
{
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
JSONArray jsonArray = JSONArray.fromObject(object);
for (Object obj : jsonArray)
{
JSONObject jsonObject = (JSONObject) obj;
Map<String, Object> map = new HashMap<String, Object>();
Iterator it = jsonObject.keys();
while (it.hasNext())
{
String key = (String) it.next();
Object value = jsonObject.get(key);
map.put((String) key, value);
}
list.add(map);
}
return list;
}
/***
* 将JSON对象数组转换为传入类型的List
* @param
* @param jsonArray
* @param objectClass
* @return
*/
public static <T> List<T> toList(JSONArray jsonArray, Class<T> objectClass)
{
return JSONArray.toList(jsonArray, objectClass);
}
/***
* 将对象转换为传入类型的List
* @param
* @param jsonArray
* @param objectClass
* @return
*/
public static <T> List<T> toList(Object object, Class<T> objectClass)
{
JSONArray jsonArray = JSONArray.fromObject(object);
return JSONArray.toList(jsonArray, objectClass);
}
/***
* 将JSON对象转换为传入类型的对象
* @param
* @param jsonObject
* @param beanClass
* @return
*/
public static <T> T toBean(JSONObject jsonObject, Class<T> beanClass)
{
return (T) JSONObject.toBean(jsonObject, beanClass);
}
/***
* 将将对象转换为传入类型的对象
* @param
* @param object
* @param beanClass
* @return
*/
public static <T> T toBean(Object object, Class<T> beanClass)
{
JSONObject jsonObject = JSONObject.fromObject(object);
return (T) JSONObject.toBean(jsonObject, beanClass);
}
/***
* 将JSON文本反序列化为主从关系的实体
* @param 泛型T 代表主实体类型
* @param 泛型D 代表从实体类型
* @param jsonString JSON文本
* @param mainClass 主实体类型
* @param detailName 从实体类在主实体类中的属性名称
* @param detailClass 从实体类型
* @return
*/
public static <T, D> T toBean(String jsonString, Class<T> mainClass,
String detailName, Class<D> detailClass)
{
JSONObject jsonObject = JSONObject.fromObject(jsonString);
JSONArray jsonArray = (JSONArray) jsonObject.get(detailName);
T mainEntity = toBean(jsonObject, mainClass);
List<D> detailList = toList(jsonArray, detailClass);
try
{
BeanUtils.setProperty(mainEntity, detailName, detailList);
}
catch (Exception ex)
{
throw new RuntimeException("主从关系JSON反序列化实体失败!");
}
return mainEntity;
}
/***
* 将JSON文本反序列化为主从关系的实体
* @param 泛型T 代表主实体类型
* @param 泛型D1 代表从实体类型
* @param 泛型D2 代表从实体类型
* @param jsonString JSON文本
* @param mainClass 主实体类型
* @param detailName1 从实体类在主实体类中的属性
* @param detailClass1 从实体类型
* @param detailName2 从实体类在主实体类中的属性
* @param detailClass2 从实体类型
* @return
*/
public static <T, D1, D2> T toBean(String jsonString, Class<T> mainClass,
String detailName1, Class<D1> detailClass1, String detailName2,
Class<D2> detailClass2)
{
JSONObject jsonObject = JSONObject.fromObject(jsonString);
JSONArray jsonArray1 = (JSONArray) jsonObject.get(detailName1);
JSONArray jsonArray2 = (JSONArray) jsonObject.get(detailName2);
T mainEntity = toBean(jsonObject, mainClass);
List<D1> detailList1 = toList(jsonArray1, detailClass1);
List<D2> detailList2 = toList(jsonArray2, detailClass2);
try
{
BeanUtils.setProperty(mainEntity, detailName1, detailList1);
BeanUtils.setProperty(mainEntity, detailName2, detailList2);
}
catch (Exception ex)
{
throw new RuntimeException("主从关系JSON反序列化实体失败!");
}
return mainEntity;
}
/***
* 将JSON文本反序列化为主从关系的实体
* @param 泛型T 代表主实体类型
* @param 泛型D1 代表从实体类型
* @param 泛型D2 代表从实体类型
* @param jsonString JSON文本
* @param mainClass 主实体类型
* @param detailName1 从实体类在主实体类中的属性
* @param detailClass1 从实体类型
* @param detailName2 从实体类在主实体类中的属性
* @param detailClass2 从实体类型
* @param detailName3 从实体类在主实体类中的属性
* @param detailClass3 从实体类型
* @return
*/
public static <T, D1, D2, D3> T toBean(String jsonString,
Class<T> mainClass, String detailName1, Class<D1> detailClass1,
String detailName2, Class<D2> detailClass2, String detailName3,
Class<D3> detailClass3)
{
JSONObject jsonObject = JSONObject.fromObject(jsonString);
JSONArray jsonArray1 = (JSONArray) jsonObject.get(detailName1);
JSONArray jsonArray2 = (JSONArray) jsonObject.get(detailName2);
JSONArray jsonArray3 = (JSONArray) jsonObject.get(detailName3);
T mainEntity = toBean(jsonObject, mainClass);
List<D1> detailList1 = toList(jsonArray1, detailClass1);
List<D2> detailList2 = toList(jsonArray2, detailClass2);
List<D3> detailList3 = toList(jsonArray3, detailClass3);
try
{
BeanUtils.setProperty(mainEntity, detailName1, detailList1);
BeanUtils.setProperty(mainEntity, detailName2, detailList2);
BeanUtils.setProperty(mainEntity, detailName3, detailList3);
}
catch (Exception ex)
{
throw new RuntimeException("主从关系JSON反序列化实体失败!");
}
return mainEntity;
}
/***
* 将JSON文本反序列化为主从关系的实体
* @param 主实体类型
* @param jsonString JSON文本
* @param mainClass 主实体类型
* @param detailClass 存放了多个从实体在主实体中属性名称和类型
* @return
*/
public static <T> T toBean(String jsonString, Class<T> mainClass,
HashMap<String, Class> detailClass)
{
JSONObject jsonObject = JSONObject.fromObject(jsonString);
T mainEntity = toBean(jsonObject, mainClass);
for (Object key : detailClass.keySet())
{
try
{
Class value = (Class) detailClass.get(key);
BeanUtils.setProperty(mainEntity, key.toString(), value);
}
catch (Exception ex)
{
throw new RuntimeException("主从关系JSON反序列化实体失败!");
}
}
return mainEntity;
}
}
\ No newline at end of file
package com.phxl.modules.goods.dao.billback;
import com.phxl.modules.goods.entity.billback.BillBack;
public interface BillBackDao{
void insert(BillBack billBack);
}
package com.phxl.modules.goods.service.ctdept;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.phxl.common.utils.BaseException;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.dao.ctdept.HisCtDeptDao;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
@Service
public class HisCtDeptService{
@Autowired
private HisCtDeptDao hisCtDeptDao;
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
public int batchSaveOrUpdate(List<HisCtDept> depts) {
try {
checkMedDept(depts);
} catch (Exception e) {
throw new BaseException(e.getMessage());
}
if (CollectionUtils.isNotEmpty(depts)) {
List<String> codes = new ArrayList<String>();
for (HisCtDept hisCtDept : depts) {
String ctcpCode = hisCtDept.getHdeptCode();
codes.add(ctcpCode);
}
Map<String, Object> map = new HashMap<String, Object>();
map.put("ctcpCodes", codes);
List<HisCtDept> exsitList = hisCtDeptDao.batchSelect(map);
List<HisCtDept> insertList = new ArrayList<HisCtDept>();
List<HisCtDept> updateList = new ArrayList<HisCtDept>();
for (HisCtDept hisCtDept : depts) {
boolean flag = false;
for (HisCtDept exsitCtCareProv : exsitList) {
if (hisCtDept.getHdeptCode().equals(exsitCtCareProv.getHdeptCode())) {
hisCtDept.setId(exsitCtCareProv.getId());
flag = true;
}
}
if (!flag) {
hisCtDept.setId(IdUtil.uuid());
insertList.add(hisCtDept);
} else {
updateList.add(hisCtDept);
}
}
if (CollectionUtils.isNotEmpty(updateList)) {
hisCtDeptDao.batchUpdate(updateList);
}
if (CollectionUtils.isNotEmpty(insertList)) {
hisCtDeptDao.batchInsert(insertList);
}
}
return 1;
}
private void checkMedDept(List<HisCtDept> depts) {
if(depts == null || depts.size() == 0){
logger.error("无相应科室信息");
throw new BaseException("无相应科室信息");
}
for (HisCtDept hisCtDept : depts) {
String hDeptCode = hisCtDept.getHdeptCode();
if (StringUtils.isEmpty(hDeptCode)) {
logger.error("科室编码不能为空");
throw new BaseException("科室编码不能为空");
}
String hdeptName = hisCtDept.getHdeptName();
if (StringUtils.isEmpty(hdeptName)) {
logger.error("科室名称不能为空");
throw new BaseException("科室名称不能为空");
}
}
}
}
package com.phxl.modules.goods.web.spd;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.phxl.modules.goods.entity.billback.BillBackWithDetail;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.phxl.common.constants.PlatformConstant;
import com.phxl.common.response.PlatFormResponse;
import com.phxl.common.response.PlatFormResponseConstant;
import com.phxl.common.util.HTTPClient;
import com.phxl.common.util.JsonMapper;
import com.phxl.common.utils.IdUtil;
import com.phxl.modules.goods.entity.billback.BillBack;
import com.phxl.modules.goods.entity.billsettlement.BillSettlement;
import com.phxl.modules.goods.entity.billsettlement.BillSettlementWithDetail;
import com.phxl.modules.goods.entity.ctcareprov.CTCareProv;
import com.phxl.modules.goods.entity.ctdept.HisCtDept;
import com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack;
import com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackWithDetail;
import com.phxl.modules.goods.entity.medinstore.MedInStoreWithDetail;
import com.phxl.modules.goods.entity.medplan.MedPlan;
import com.phxl.modules.goods.entity.medplan.MedPlanWithDetail;
import com.phxl.modules.goods.entity.medstock.MedStock;
import com.phxl.modules.goods.entity.medstock.MedStockList;
import com.phxl.modules.goods.entity.spills.HisSpills;
import com.phxl.modules.goods.entity.spills.HisSpillsList;
import com.phxl.modules.goods.entity.suoutstore.SuOutStore;
import com.phxl.modules.goods.entity.suoutstore.SuOutStoreWithDetail;
import com.phxl.modules.goods.entity.supplierstock.SupplierStock;
import com.phxl.modules.goods.entity.supplierstock.SupplierStockList;
import com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods;
import com.phxl.modules.goods.service.billback.BillBackService;
import com.phxl.modules.goods.service.billsettlement.BillSettlementService;
import com.phxl.modules.goods.service.ctcareprov.CTCareProvService;
import com.phxl.modules.goods.service.ctdept.HisCtDeptService;
import com.phxl.modules.goods.service.hisCtMedicineMaterial.HisCtMedicineMaterialService;
import com.phxl.modules.goods.service.interfaceLog.InterfaceLogService;
import com.phxl.modules.goods.service.invoiceback.SuInvoiceBackService;
import com.phxl.modules.goods.service.medinstore.MedInStoreService;
import com.phxl.modules.goods.service.medplan.MedPlanService;
import com.phxl.modules.goods.service.medstock.MedStockService;
import com.phxl.modules.goods.service.spills.HisSpillsService;
import com.phxl.modules.goods.service.suoutstore.SuOutStoreService;
import com.phxl.modules.goods.service.supplierstock.SupplierStockService;
import com.phxl.modules.goods.service.supplygoods.MedSupplyGoodsService;
@Controller
@RequestMapping(value = "/Api")
public class SpdControlller {
/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HisCtMedicineMaterialService ctMedicineMaterialService;
@Autowired
private InterfaceLogService interfaceLogService;
@Autowired
private HisCtDeptService hisCtDeptService;
@Autowired
private CTCareProvService cTCareProvService;
@Autowired
private MedSupplyGoodsService supplyGoodsService;
@Autowired
private MedStockService stockService;
@Autowired
private MedPlanService medPlanService;
@Autowired
private MedInStoreService medInStoreService;
@Autowired
private BillBackService backService;
@Autowired
private BillSettlementService billSettlementService;
@Autowired
private SupplierStockService supplierStockService;
@Autowired
private SuOutStoreService suOutStoreService;
@Autowired
private HisSpillsService hisSpillsService;
@Autowired
private SuInvoiceBackService suInvoiceBackService;
@RequestMapping(value="/setMFMedGoods")
@ResponseBody
public String setMFMedGoods(String id,HttpServletRequest request, @RequestBody String medgoodsList){
logger.debug("药品目录接口请求参数:{}",medgoodsList);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFMedGoods:(药品目录)", medgoodsList, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtMedicineMaterial> materials = new ArrayList<HisCtMedicineMaterial>();
try {
materials = JSONObject.parseArray(medgoodsList, HisCtMedicineMaterial.class);
for (HisCtMedicineMaterial hisCtMedicineMaterial : materials) {
ctMedicineMaterialService.saveMedicine(hisCtMedicineMaterial);
}
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
result = JSON.toJSONString(response);
//medgoodsList = ctMedicineMaterialService.createRequest();
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMFMedGoods", medgoodsList);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
@RequestMapping(value="/setHDept")
@ResponseBody
public String setHDept(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院科室资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setHDept:(医院科室)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisCtDept> depts = new ArrayList<HisCtDept>();
try {
depts = JSONObject.parseArray(params, HisCtDept.class);
int end = hisCtDeptService.batchSaveOrUpdate(depts);
if(end==1){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setHDept", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院人员资料接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedStaff")
@ResponseBody
public String setMedStaff(HttpServletRequest request, @RequestBody String params){
logger.debug("医院人员资料接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStaff:(医院人员资料)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<CTCareProv> careProvs = new ArrayList<CTCareProv>();
boolean end = false;
try {
careProvs = JSONObject.parseArray(params, CTCareProv.class);
end = cTCareProvService.batchSaveOrUpdate(careProvs);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStaff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院采购目录接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMFSupplyGoods")
@ResponseBody
public String setMFSupplyGoods(HttpServletRequest request, @RequestBody String params){
logger.debug("医院采购目录接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMFSupplyGoods:(医院采购目录)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedSupplyGoods> supplyGoods = new ArrayList<MedSupplyGoods>();
boolean end = false;
try {
supplyGoods = JSONObject.parseArray(params, MedSupplyGoods.class);
end = supplyGoodsService.batchSave(supplyGoods);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedContent", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院库存接口
* @param request
* @param params
* @return
*/
@ResponseBody
@RequestMapping(value="/setMedStock",method = RequestMethod.POST)
public String setMedStock(HttpServletRequest request, @RequestBody String params){
logger.debug("HLI同步医院库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedStock:(医院库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedStockList> stocks = new ArrayList<MedStockList>();
boolean end = false;
try {
stocks = JSONObject.parseArray(params, MedStockList.class);
end = stockService.batchSave(stocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedStock", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院补货计划接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedPlan")
@ResponseBody
public String setMedPlan(HttpServletRequest request, @RequestBody String params){
logger.debug("补货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedPlan:(补货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedPlanWithDetail> medPlans = new ArrayList<MedPlanWithDetail>();
boolean end = false;
try {
//改成批量的操作
medPlans = JSONObject.parseArray(params, MedPlanWithDetail.class);
end = medPlanService.batchSave(medPlans);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedPlan", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院退货接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRMedRPI")
@ResponseBody
public String setTRMedRPI(HttpServletRequest request, @RequestBody String params){
logger.debug("医院退货计划接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRMedRPI:(医院退货计划)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillBackWithDetail> billBacks = new ArrayList<BillBackWithDetail>();
boolean end = false;
try {
billBacks = JSONObject.parseArray(params, BillBackWithDetail.class);
end = backService.batchSave(billBacks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrmedRPI", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 结算单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTRSettle")
@ResponseBody
public String setTRSettle(HttpServletRequest request, @RequestBody String params){
logger.debug("同步医院结算单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTRSettle:(医院同步结算单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<BillSettlementWithDetail> settlementWithDetails = new ArrayList<BillSettlementWithDetail>();
boolean end = false;
try {
settlementWithDetails = JSONObject.parseArray(params, BillSettlementWithDetail.class);
end = billSettlementService.batchSave(settlementWithDetails);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url + "setTrsettle", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商库存接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setStock")
@ResponseBody
public String setStock(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商同步库存数据请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setStock:(供应商库存)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SupplierStockList> supplierStocks = new ArrayList<SupplierStockList>();
boolean end = false;
try {
supplierStocks = JSONObject.parseArray(params, SupplierStockList.class);
end = supplierStockService.batchSave(supplierStocks);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setStock", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商出库单接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setTrmedwv")
@ResponseBody
public String setTrmedwv(HttpServletRequest request, @RequestBody String params){
logger.debug("同步供应商出库单请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrmedwv:(供应商出库单)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuOutStoreWithDetail> suOutStores = new ArrayList<SuOutStoreWithDetail>();
boolean end = false;
try {
suOutStores = JSONObject.parseArray(params, SuOutStoreWithDetail.class);
end = suOutStoreService.batchSave(suOutStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setTrmedwv", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 医院盘点损溢接口
* @param request
* @param params
* @return
*/
@RequestMapping(value="/setTrDiff")
@ResponseBody
public String setTrDiff(String id,HttpServletRequest request, @RequestBody String params){
logger.debug("医院盘点损溢接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setTrDiff:(盘点损溢)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<HisSpillsList> spills = new ArrayList<HisSpillsList>();
boolean end = false;
try {
spills = JSONObject.parseArray(params, HisSpillsList.class);
end = hisSpillsService.batchSave(spills);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setTrDiff", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 供应商发票回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setInvoice")
@ResponseBody
public String setInvoice(HttpServletRequest request, @RequestBody String params){
logger.debug("供应商发票回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setInvoice:(供应商发票回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<SuInvoiceBackWithDetail> suInvoiceBackWithDetailList = new ArrayList<SuInvoiceBackWithDetail>();
boolean end = false;
try {
suInvoiceBackWithDetailList = JSONObject.parseArray(params, SuInvoiceBackWithDetail.class);
end = suInvoiceBackService.batchSaveOrUpdate(suInvoiceBackWithDetailList);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
try
{
//SPD服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url+"setInvoice", params);
response = JSONObject.parseObject(result,PlatFormResponse.class);
response.setMsg("SPD:"+response.getMsg());
}
catch(Exception ex){
logger.error("SPD:"+ex.getMessage());
exception = "SPD:"+ex.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("SPD:"+ex.getMessage());
result = JSON.toJSONString(response);
}
} catch (Exception e) {
logger.error("前置机:"+e.getMessage());
exception = "前置机:"+e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("前置机:"+e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/*
* 医院入库单回传接口
* @param request
* @param params
* @return
*/
@RequestMapping("/setMedInStore")
@ResponseBody
public String setMedInStore(HttpServletRequest request, @RequestBody String params){
logger.debug("医院入库单回传接口请求参数:{}",params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("setMedInStore:(医院入库单回传)", params, logId);
PlatFormResponse response = new PlatFormResponse();
List<MedInStoreWithDetail> medInStores = new ArrayList<MedInStoreWithDetail>();
boolean end = false;
try {
//改成批量的操作
medInStores = JSONObject.parseArray(params, MedInStoreWithDetail.class);
end = medInStoreService.batchSave(medInStores);
if(end){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getSuccess_ResultContent);
}else{
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(PlatFormResponseConstant.ResponseBodyMsg.getFail_ResultContent);
}
result = JSON.toJSONString(response);
//供应商服务请求:
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_HUARUN_Url+"setMedInStore", params);
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg(e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/***
* 推送对账数据到平台
* @param params
* @return
*/
@RequestMapping("/pushBalance")
@ResponseBody
public String pushBalance(@RequestBody String params) {
logger.debug("推送对账数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushBalance:(推送对账数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getdispensingaccount", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送对账数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送发药数据到平台
* @param params
* @return
*/
@RequestMapping("/pushDispensing")
@ResponseBody
public String pushDispensing(@RequestBody String params){
logger.debug("推送发药数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送发药数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/gethairtraceability", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送发药数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送库存数据到平台
* @param params
* @return
*/
@RequestMapping("/pushStock")
@ResponseBody
public String pushStock(@RequestBody String params){
logger.debug("推送库存数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushStock:(推送库存数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_URL + "supplier/receiver/getreconciliation", params);
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送库存数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicinfo")
@ResponseBody
public String pushlicinfo(@RequestBody String params){
logger.debug("证照数据:{}", params);
String result = "";
String logId = IdUtil.uuid();
String exception = "";
interfaceLogService.saveLog("pushDispensing:(推送证照数据)", params, logId);
PlatFormResponse response = new PlatFormResponse();
try {
result = HTTPClient.sendJsonDataByPost(PlatformConstant.PlatForm_SPD_Url + "saveresLic", params);//
JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject.getIntValue("errorCode") != 0){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.getString("message"));
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
/**
* 推送证照图片数据到平台
* @param params
* @return
*/
@RequestMapping("/pushlicpicinfo")
@ResponseBody
public String pushlicpicinfo(@RequestParam("file") MultipartFile file){
String result = "";
String logId = IdUtil.uuid();
String exception = "";
PlatFormResponse response = new PlatFormResponse();
interfaceLogService.saveLog("pushDispensing:(推送证照数据)","filename////"+file.getOriginalFilename(), logId);
try {
if (file!=null) {
HttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost(PlatformConstant.PlatForm_SPD_Url + "saveresLicpic");//
String fileName = file.getOriginalFilename();
String prefix = fileName.substring(fileName.lastIndexOf("."));
String filePreName= fileName.substring(0,fileName.lastIndexOf("."));
File newfile = File.createTempFile(filePreName+ "", prefix);
file.transferTo(newfile);
FileBody bin = new FileBody(newfile);
HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).build();
post.setEntity(reqEntity);
HttpResponse htppresponse = client.execute(post);
HttpEntity resEntity = htppresponse.getEntity();
result = EntityUtils.toString(resEntity, "UTF-8");
JSONObject jsonObject = JSONObject.parseObject(result);
if(!"Y".equals(jsonObject.getString("FLAG"))){
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
}else {
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.success_ResultCode);
}
response.setMsg(jsonObject.toJSONString());
}
} catch (Exception e) {
logger.error(e.getMessage());
exception = e.getMessage();
response.setFlag(PlatFormResponseConstant.ResponseBodyMsg.fail_ResultCode);
response.setMsg("发送证照图片数据给平台错误:" + e.getMessage());
result = JSON.toJSONString(response);
}
interfaceLogService.setResultLog(response, logId, exception);
return result;
}
}
No preview for this file type
<?xml version="1.0" encoding="UTF-8" ?>
<project name="maven-antrun-" default="main" >
<target name="main">
<move todir="D:\WorkSpaces\SPD\CS\medicinal-supplier\target/medicinal-supplier-1.0-prod/">
<fileset dir="D:\WorkSpaces\SPD\CS\medicinal-supplier\target/classes/">
<include name="Runner.class"/>
</fileset>
</move>
</target>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="false" name="defaultCache">
<diskStore path="../temp/medicinal/ehcache" />
<!-- 默认缓存配置. 自动失效:最后一次访问时间间隔300秒失效,若没有访问过自创建时间600秒失效。-->
<defaultCache maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
overflowToDisk="true" statistics="true"/>
<!-- 系统缓存 -->
<cache name="sysCache" maxEntriesLocalHeap="1000" eternal="true" overflowToDisk="true" statistics="true"/>
</ehcache>
\ No newline at end of file
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://10.146.9.50:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=BOE190326jdfyy
spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
#spd服务地址
spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
spd_wechat_logout=http://10.146.9.50:8080/medicinal-web/a/logout
appid=wx9657f3a42806237c
appsecrent=fb6768612d5802551d202d9b4e59d23e
token=spd
ehcache.configFile=cache/ehcache-local.xml
version=V1.2.7
order_template_id=a8mZCkoeBHiqwVUJvDbrNS-qe5mT8wVksutVY_MWSjs
store_template_id=wF6hltnW1eYLQRcGIVc7SUCClnR3FXbb9575PDnw3q0
lic_template_id=eHuLEQ9lwvfK_ovjKlupDDfMTkUrbbuVPL5-gOSmAuM
local_url=http://ht.yao4pl.com
<?xml version="1.0" ?>
<!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="600 seconds" debug="false">
<!-- 定义日志文件 输入位置 -->
<property name="log_dir" value="/usr/supplierlog"/>
<!-- 日志最大的历史-->
<property name="maxHistory" value="90"/>
<property name="normal-pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
<!-- ConsoleAppender 控制台输出日志 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- 对日志进行格式化 -->
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- ERROR级别日志 -->
<!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 过滤器,只记录WARN级别的日志 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${log_dir}/error.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/error-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- INFO级别日志 appender -->
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<file>${log_dir}/info.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/info-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- DEBUG级别日志 appender -->
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
<file>${log_dir}/debug.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/debug-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<logger name="org.apache.zookeeper.ClientCnxn" level="ERROR" additivity="false"/>
<logger name="com.phxl.modules.goods.dao" level="debug" additivity="false">
<appender-ref ref="debug" />
</logger>
<!-- root级别 DEBUG -->
<root level="DEBUG">
<!-- 控制台输出 -->
<appender-ref ref="STDOUT" />
<!-- 文件输出 -->
<appender-ref ref="ERROR" />
<appender-ref ref="INFO" />
<appender-ref ref="DEBUG" />
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billback.BillBackDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
<result column="medMV_row_no" property="medMVRowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="returns_unit" property="returns_Unit" jdbcType="VARCHAR" />
<result column="returns_price" property="returns_Price" jdbcType="DECIMAL" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="rpi_qty" property="rpiQty" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入BillBackDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medMVBillNo},
#{obj.medMVRowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.returns_Unit},
#{obj.returns_Price},
#{obj.manufacturer},
#{obj.rpiQty},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billback.BillBack">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplierb_name" property="supplierbName" jdbcType="VARCHAR" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="reason" property="reason" jdbcType="VARCHAR" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增BillBack-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.billback.BillBack">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medMVBillNo,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierbName,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{reason,jdbcType=VARCHAR}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_cate" property="goodsCate" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="settle_price" property="settleUnit" jdbcType="DECIMAL" />
<result column="settle_amount" property="settlePrice" jdbcType="DECIMAL" />
<result column="regist_key" property="registKey" jdbcType="VARCHAR" />
<result column="producer_name" property="producerName" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入BillBackDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.settleBillNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.settleQty},
#{obj.unit},
#{obj.settlePrice},
#{obj.settleAmount},
#{obj.registKey},
#{obj.producerName},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.create_time},
#{obj.update_time},
#{obj.goodsCate}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
<result column="bill_state" property="billState" jdbcType="VARCHAR" />
<result column="purchaser_corp_code" property="medCode" jdbcType="VARCHAR" />
<result column="purchaser_corp_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="TIMESTAMP" />
<result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
<result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
<result column="use_bill_no" property="usebillno" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增BillBack-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
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)
values (
#{id,jdbcType=VARCHAR}
,#{settleBillNo,jdbcType=VARCHAR}
,#{settleDate,jdbcType=TIMESTAMP}
,#{billState,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=TIMESTAMP}
,#{goodsSum,jdbcType=TINYINT}
,#{amount,jdbcType=DECIMAL}
,#{beginDate,jdbcType=TIMESTAMP}
,#{endDate,jdbcType=TIMESTAMP}
,#{useBillNo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
<result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
<result column="real_name" property="realName" jdbcType="VARCHAR" />
<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
<result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
<result column="idcode" property="idcode" jdbcType="VARCHAR" />
<result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
<result column="category" property="category" jdbcType="VARCHAR" />
<result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.mfmedStaffCode},
#{obj.logonUser},
#{obj.realName},
#{obj.helpCode},
#{obj.sex},
#{obj.mobileTel},
#{obj.webChatCode},
#{obj.idcode},
#{obj.e_mail},
#{obj.hdeptCode},
#{obj.category},
#{obj.ishadministrator},
#{obj.update_time}
</trim>
</foreach>
</insert>
<!-- 批量查询HisCtDept -->
<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from med_hli_care_prov
<if test="ryCodes != null">
where mfmed_staff_code in
<foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<update id="batchUpdate" parameterType="list">
update med_hli_care_prov
<trim prefix="set" suffixOverrides=",">
<trim prefix="mfmed_staff_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
when id = #{obj.id}
then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="logon_user=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.logonUser != null and obj.logonUser != ''">
when id = #{obj.id}
then
#{obj.logonUser,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="real_name=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.realName != null and obj.realName != ''">
when id = #{obj.id}
then #{obj.realName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="sex=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.sex != null and obj.sex != ''">
when id = #{obj.id}
then #{obj.sex,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="mobile_tel=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.mobileTel != null and obj.mobileTel != ''">
when id = #{obj.id}
then #{obj.mobileTel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="web_chat_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.webChatCode != null and obj.webChatCode != ''">
when id = #{obj.id}
then #{obj.webChatCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="idcode=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.idcode != null and obj.idcode != ''">
when id = #{obj.id}
then #{obj.idcode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="hdept_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
when id = #{obj.id}
then #{obj.hdeptCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="e_mail=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.e_mail != null and obj.e_mail != ''">
when id = #{obj.id}
then #{obj.e_mail,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="ishadministrator=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.ishadministrator != null and obj.ishadministrator != ''">
when id = #{obj.id}
then #{obj.ishadministrator,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.update_time != null and obj.update_time != ''">
when id = #{obj.id}
then #{obj.update_time,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="obj" index="index">
id
= #{obj.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.ctdept.HisCtDeptDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.ctdept.HisCtDept">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
<result column="hdept_name" property="hdeptName" jdbcType="VARCHAR" />
<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
<result column="upper_GUID" property="upperGUID" jdbcType="VARCHAR" />
<result column="is_order_right" property="isOrderRight" jdbcType="VARCHAR" />
<result column="category" property="category" jdbcType="VARCHAR" />
<result column="director" property="director" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="VARCHAR" />
<result column="is_last_level" property="isLastLevel" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 批量查询 -->
<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from med_hli_dept
<if test="ctcpCodes != null">
where hdept_code in
<foreach item="item" index="index" collection="ctcpCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.hdeptCode},
#{obj.hdeptName},
#{obj.helpCode},
#{obj.upperGUID},
#{obj.isOrderRight},
#{obj.category},
#{obj.director},
#{obj.state},
#{obj.isLastLevel},
#{obj.create_time},
#{obj.update_time}
</trim>
</foreach>
</insert>
<update id="batchUpdate" parameterType="list">
update med_hli_dept
<trim prefix="set" suffixOverrides=",">
<trim prefix="hdept_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
when id = #{obj.id}
then #{obj.hdeptCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="hdept_name=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptName != null and obj.hdeptName != ''">
when id = #{obj.id}
then
#{obj.hdeptName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="upper_GUID=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.upperGUID != null and obj.upperGUID != ''">
when id = #{obj.id}
then #{obj.upperGUID,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="is_order_right=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.isOrderRight != null and obj.isOrderRight != ''">
when id = #{obj.id}
then #{obj.isOrderRight,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="director=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.director != null and obj.director != ''">
when id = #{obj.id}
then #{obj.director,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="state=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.state != null and obj.state != ''">
when id = #{obj.id}
then #{obj.state,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="is_last_level=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.isLastLevel != null and obj.isLastLevel != ''">
when id = #{obj.id}
then #{obj.isLastLevel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.create_time != null">
when id = #{obj.id}
then #{obj.create_time,jdbcType=DATE}
</if>
</foreach>
</trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.update_time != null">
when id = #{obj.id}
then #{obj.update_time,jdbcType=DATE}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="obj" index="index">
id
= #{obj.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao">
<!--BaseResultMap-->
<resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="med_code" property="medCode" jdbcType="VARCHAR"/>
<result column="med_name" property="medName" jdbcType="VARCHAR"/>
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
<result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
<result column="s_name" property="sName" jdbcType="VARCHAR"/>
<result column="p_name" property="pName" jdbcType="VARCHAR"/>
<result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
<result column="producer" property="producer" jdbcType="VARCHAR"/>
<result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
<result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
<result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
<result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
<result column="price" property="price" jdbcType="DECIMAL"/>
<result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
<result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
<result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
<result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
<result column="length" property="length" jdbcType="DECIMAL"/>
<result column="width" property="width" jdbcType="DECIMAL"/>
<result column="height" property="height" jdbcType="DECIMAL"/>
<result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
<result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
<result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
<result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
<result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
<result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
<result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
<result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
<result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
<result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
<result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
<result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
<result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
<result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
<result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
<result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
<result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
<result column="brand" property="brand" jdbcType="VARCHAR"/>
<result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
<result column="memo" property="memo" jdbcType="VARCHAR"/>
</resultMap>
<!--Base_Column_List-->
<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>
<!-- 新增HisCtMedicineMaterial-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{sName,jdbcType=VARCHAR}
,#{pName,jdbcType=VARCHAR}
,#{helpCode,jdbcType=VARCHAR}
,#{producer,jdbcType=VARCHAR}
,#{agentName,jdbcType=VARCHAR}
,#{medGoodsCateGUID,jdbcType=VARCHAR}
,#{medGoodsCateName,jdbcType=VARCHAR}
,#{registKey,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL}
,#{salePrice,jdbcType=DECIMAL}
,#{batSalePrice,jdbcType=DECIMAL}
,#{productionAddress,jdbcType=VARCHAR}
,#{dosageForm,jdbcType=VARCHAR}
,#{length,jdbcType=DECIMAL}
,#{width,jdbcType=DECIMAL}
,#{height,jdbcType=DECIMAL}
,#{grossWeight,jdbcType=DECIMAL}
,#{netWeight,jdbcType=DECIMAL}
,#{unitStyle,jdbcType=VARCHAR}
,#{bigUnitStyle,jdbcType=VARCHAR}
,#{bigUnitQty,jdbcType=DECIMAL}
,#{bigBcd,jdbcType=VARCHAR}
,#{minUnitStyle,jdbcType=VARCHAR}
,#{minUnitQty,jdbcType=DECIMAL}
,#{litBcd,jdbcType=VARCHAR}
,#{isLotCtrlInput,jdbcType=VARCHAR}
,#{bizState,jdbcType=VARCHAR}
,#{importedFlag,jdbcType=VARCHAR}
,#{reportFlag,jdbcType=VARCHAR}
,#{noxiousFlag,jdbcType=VARCHAR}
,#{drugNerveFlag,jdbcType=VARCHAR}
,#{productStandardCode,jdbcType=VARCHAR}
,#{specStandardCode,jdbcType=VARCHAR}
,#{brand,jdbcType=VARCHAR}
,#{coldFlag,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{memo,jdbcType=VARCHAR}
)
</insert>
<!-- 按需修改HisCtMedicineMaterial-->
<update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
update med_hli_medicine_material
<set>
<if test="medName != null and medName != ''">
med_name = #{medName,jdbcType=VARCHAR},
</if>
<if test="goodsCode != null and goodsCode != ''">
goods_code = #{goodsCode,jdbcType=VARCHAR},
</if>
<if test="goodsSpec != null and goodsSpec != ''">
goods_spec = #{goodsSpec,jdbcType=VARCHAR},
</if>
<if test="goodsName != null and goodsName != ''">
goods_name = #{goodsName,jdbcType=VARCHAR},
</if>
<if test="sName != null and sName != ''">
s_name = #{sName,jdbcType=VARCHAR},
</if>
<if test="pName != null and pName != ''">
p_name = #{pName,jdbcType=VARCHAR},
</if>
<if test="helpCode != null and helpCode != ''">
help_code = #{helpCode,jdbcType=VARCHAR},
</if>
<if test="producer != null and producer != ''">
producer = #{producer,jdbcType=VARCHAR},
</if>
<if test="agentName != null and agentName != ''">
agent_name = #{agentName,jdbcType=VARCHAR},
</if>
<if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
</if>
<if test="medGoodsCateName != null and medGoodsCateName != ''">
med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
</if>
<if test="registKey != null and registKey != ''">
regist_key = #{registKey,jdbcType=VARCHAR},
</if>
<if test="price != null and price != ''">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="salePrice != null and salePrice != ''">
sale_price = #{salePrice,jdbcType=DECIMAL},
</if>
<if test="batSalePrice != null and batSalePrice != ''">
bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
</if>
<if test="productionAddress != null and productionAddress != ''">
production_address = #{productionAddress,jdbcType=VARCHAR},
</if>
<if test="dosageForm != null and dosageForm != ''">
dosage_form = #{dosageForm,jdbcType=VARCHAR},
</if>
<if test="length != null and length != ''">
length = #{length,jdbcType=DECIMAL},
</if>
<if test="width != null and width != ''">
width = #{width,jdbcType=DECIMAL},
</if>
<if test="height != null and height != ''">
height = #{height,jdbcType=DECIMAL},
</if>
<if test="grossWeight != null and grossWeight != ''">
gross_weight = #{grossWeight,jdbcType=DECIMAL},
</if>
<if test="netWeight != null and netWeight != ''">
net_weight = #{netWeight,jdbcType=DECIMAL},
</if>
<if test="unitStyle != null and unitStyle != ''">
unit_style = #{unitStyle,jdbcType=VARCHAR},
</if>
<if test="bigUnitStyle != null and bigUnitStyle != ''">
big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
</if>
<if test="bigUnitQty != null and bigUnitQty != ''">
big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
</if>
<if test="bigBcd != null and bigBcd != ''">
big_bcd = #{bigBcd,jdbcType=VARCHAR},
</if>
<if test="minUnitStyle != null and minUnitStyle != ''">
min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
</if>
<if test="minUnitQty != null and minUnitQty != ''">
min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
</if>
<if test="litBcd != null and litBcd != ''">
lit_bcd = #{litBcd,jdbcType=VARCHAR},
</if>
<if test="isLotCtrlInput != null and isLotCtrlInput != ''">
is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
</if>
<if test="bizState != null and bizState != ''">
biz_state = #{bizState,jdbcType=VARCHAR},
</if>
<if test="importedFlag != null and importedFlag != ''">
imported_flag = #{importedFlag,jdbcType=VARCHAR},
</if>
<if test="reportFlag != null and reportFlag != ''">
report_flag = #{reportFlag,jdbcType=VARCHAR},
</if>
<if test="noxiousFlag != null and noxiousFlag != ''">
noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
</if>
<if test="drugNerveFlag != null and drugNerveFlag != ''">
drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
</if>
<if test="productStandardCode != null and productStandardCode != ''">
product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
</if>
<if test="specStandardCode != null and specStandardCode != ''">
spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
</if>
<if test="brand != null and brand != ''">
brand = #{brand,jdbcType=VARCHAR},
</if>
<if test="coldFlag != null and coldFlag != ''">
cold_flag = #{coldFlag,jdbcType=VARCHAR},
</if>
<if test="supplierCode != null and supplierCode != ''">
supplier_code = #{supplierCode,jdbcType=VARCHAR},
</if>
<if test="supplierName != null and supplierName != ''">
supplier_name=#{supplierName,jdbcType=VARCHAR},
</if>
<if test="memo != null and memo != ''">
memo=#{memo,jdbcType=VARCHAR}
</if>
</set>
where med_code = #{medCode,jdbcType=BIGINT}
</update>
<!-- 查询HisCtMedicineMaterial详情 -->
<select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
select
<include refid="Base_Column_List"/>
from med_hli_medicine_material material
<where>
<if test="goodsCode!=null and goodsCode!=''">
And goods_code = #{goodsCode,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao">
<insert id="insert">
INSERT INTO med_interface_log(
id,
request_time,
request_method,
request_param
) VALUES (
#{id},
#{requestTime},
#{requestMethod},
#{requestParam}
)
</insert>
<!-- 更新接口请求结果信息-->
<update id="update" parameterType="com.phxl.modules.goods.entity.interfaceLog.InterfaceLog">
update med_interface_log
<set>
<if test="resultCode != null and resultCode != ''">
result_code = #{resultCode,jdbcType=VARCHAR},
</if>
<if test="resultContent != null and resultContent != ''">
result_content = #{resultContent,jdbcType=VARCHAR},
</if>
<if test="exception != null and exception != ''">
exception = #{exception,jdbcType=VARCHAR}
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="producer_name" property="producerName" jdbcType="VARCHAR" />
<result column="regist_key" property="registKey" jdbcType="VARCHAR" />
<result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="settle_price" property="settlePrice" jdbcType="DECIMAL" />
<result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
<result column="invoice_no" property="invoiceNo" jdbcType="VARCHAR" />
<result column="invoice_code" property="invoiceCode" jdbcType="VARCHAR" />
<result column="invoice_time" property="invoiceTime" jdbcType="DECIMAL" />
<result column="invoice_amount" property="invoiceAmount" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.settleBillNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.producerName},
#{obj.registKey},
#{obj.settleQty},
#{obj.unit},
#{obj.settlePrice},
#{obj.settleAmount},
#{obj.create_time},
#{obj.update_time},
#{obj.invoiceNo},
#{obj.invoiceCode},
#{obj.invoiceTime},
#{obj.invoiceAmount}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
<result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增invoiceback-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
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)
values (
#{id,jdbcType=VARCHAR}
,#{settleBillNo,jdbcType=VARCHAR}
,#{settleDate,jdbcType=TIMESTAMP}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{goodsSum,jdbcType=TINYINT}
,#{amount,jdbcType=DECIMAL}
,#{beginDate,jdbcType=TIMESTAMP}
,#{endDate,jdbcType=TIMESTAMP}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medinstore.MedInStoreDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
<result column="supplier_do_no" property="supplierDoNo" jdbcType="VARCHAR" />
<result column="supplier_do_row_no" property="supplierDoRowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
<result column="mvqty" property="mvqty" jdbcType="DECIMAL" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedInStoreDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medPlanRowNo},
#{obj.supplierDoNo},
#{obj.supplierDoRowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.unit},
#{obj.manufacturer},
#{obj.purchaserPrice},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.arrivalqty},
#{obj.mvqty},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medinstore.MedInStore">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增MedInStore-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medinstore.MedInStore">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medGuid,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{medDeptGuid,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreGuid,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{supplierGuid,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medplan.MedPlanDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="po_qty" property="poQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="taxprice" property="taxprice" jdbcType="DECIMAL" />
<result column="taxsum" property="taxsum" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<sql id="Base_Column_List">id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum</sql>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
insert into med_hli_plan_detail (id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.poQty},
#{obj.unit},
#{obj.taxprice},
#{obj.taxsum}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medplan.MedPlan">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="bill_type" property="billType" jdbcType="VARCHAR" />
<result column="settle_type" property="settleType" jdbcType="VARCHAR" />
<result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
<result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
<result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medCode},
#{obj.medName},
#{obj.supplierCode},
#{obj.suppliername},
#{obj.billNo},
#{obj.billType},
#{obj.medDeptCode},
#{obj.medDeptName},
#{obj.medStoreCode},
#{obj.medStoreName},
#{obj.firstFlag},
#{obj.planBeginDate},
#{obj.planEndDate},
#{obj.memo},
#{obj.operaterName},
#{obj.inputDate},
#{obj.create_time},
#{obj.update_time}
</trim>
</foreach>
</insert>
<!-- 新增MedPlan-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{suppliername,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{billType,jdbcType=VARCHAR}
,#{settleType,jdbcType=VARCHAR}
,#{medDeptCode,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreCode,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{firstFlag,jdbcType=VARCHAR}
,#{planBeginDate,jdbcType=TIMESTAMP}
,#{planEndDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medstock.MedStockDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medstock.MedStock">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
<result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
<result column="store_code" property="storeCode" jdbcType="VARCHAR" />
<result column="store_name" property="storeName" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medSuppliercode},
#{obj.medSuppliername},
#{obj.storeCode},
#{obj.storeName},
#{obj.goodsCode},
#{obj.goodsSpec},
#{obj.goodsName},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.stockQty},
#{obj.createTime},
#{obj.updateTime},
#{obj.medCode},
#{obj.medName},
</trim>
</foreach>
</insert>
<!-- 新增HisSpills-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medstock.MedStock">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medSuppliercode,jdbcType=VARCHAR}
,#{medSuppliername,jdbcType=VARCHAR}
,#{storeCode,jdbcType=VARCHAR}
,#{storeName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=TIMESTAMP}
,#{goodsSpec,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{productionDate,jdbcType=VARCHAR}
,#{expireDate,jdbcType=DECIMAL}
,#{stockQty,jdbcType=DECIMAL}
,#{createTime,jdbcType=DECIMAL}
,#{updateTime,jdbcType=TIMESTAMP}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.spills.HisSpillsDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.spills.HisSpills">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="depot_code" property="depotCode" jdbcType="VARCHAR" />
<result column="depot_name" property="depotName" jdbcType="VARCHAR" />
<result column="tack_stockdate" property="tackStockDate" jdbcType="TIMESTAMP" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="number" property="number" jdbcType="DECIMAL" />
<result column="storck_num" property="storckNum" jdbcType="DECIMAL" />
<result column="difference_num" property="differenceNum" jdbcType="DECIMAL" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="tackstock_billno" property="tackStockBillNo" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medCode},
#{obj.medName},
#{obj.depotCode},
#{obj.depotName},
#{obj.tackStockDate},
#{obj.operaterName},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.lot},
#{obj.unit},
#{obj.number},
#{obj.storckNum},
#{obj.differenceNum},
#{obj.productionDate},
#{obj.expireDate},
#{obj.supplierCode},
#{obj.supplierName},
#{obj.tackStockBillNo},
#{obj.price}
</trim>
</foreach>
</insert>
<!-- 新增HisSpills-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.spills.HisSpills">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{depotCode,jdbcType=VARCHAR}
,#{depotName,jdbcType=VARCHAR}
,#{tackStockDate,jdbcType=TIMESTAMP}
,#{operaterName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=VARCHAR}
,#{manufacturer,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{unit,jdbcType=VARCHAR}
,#{number,jdbcType=DECIMAL}
,#{storckNum,jdbcType=DECIMAL}
,#{differenceNum,jdbcType=DECIMAL}
,#{productionDate,jdbcType=TIMESTAMP}
,#{expireDate,jdbcType=TIMESTAMP}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{tackStockBillNo,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="med_plan_no" property="medPlanNo" jdbcType="VARCHAR" />
<result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
<result column="goods_guid" property="goodsGuid" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="poqty" property="poqty" jdbcType="DECIMAL" />
<result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medPlanNo},
#{obj.medPlanRowNo},
#{obj.goodsGuid},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.unit},
#{obj.manufacturer},
#{obj.purchaserPrice},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.poqty},
#{obj.arrivalqty},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增MedPlan-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medGuid,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{medDeptGuid,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreGuid,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{supplierGuid,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{createTime,jdbcType=TIMESTAMP}
,#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.supplierstock.SupplierStockDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="supplier_code" property="suppliercode" jdbcType="VARCHAR" />
<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.suppliercode},
#{obj.suppliername},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.stockQty},
#{obj.createTime},
#{obj.updateTime}
</trim>
</foreach>
</insert>
<!-- 新增SupplierStock-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
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)
values (
#{id,jdbcType=VARCHAR}
,#{suppliercode,jdbcType=VARCHAR}
,#{suppliername,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=TIMESTAMP}
,#{manufacturer,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{productionDate,jdbcType=TIMESTAMP}
,#{expireDate,jdbcType=TIMESTAMP}
,#{stockQty,jdbcType=DECIMAL}
,#{createTime,jdbcType=TIMESTAMP}
,#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
<result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="producer" property="producer" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit_style" property="unitStyle" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="price" property="price" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
insert into med_supply_catalog (id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medSuppliercode},
#{obj.medSuppliername},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.producer},
#{obj.goodsSpec},
#{obj.unitStyle},
#{obj.createTime},
#{obj.updateTime},
#{obj.price}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
</configuration>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
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
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<!-- 定时器开关 -->
<task:annotation-driven />
<bean id="weChat" class="com.phxl.modules.wechat.utils.WeChatUtils"></bean>
<task:scheduled-tasks>
<!--
每隔5秒执行一次:*/5 * * * * ?
每隔1分钟执行一次:0 */1 * * * ?
每天23点执行一次:0 0 23 * * ?
每天凌晨1点执行一次:0 0 1 * * ?
每天凌晨2点执行一次:0 0 2 * * ?
-->
<task:scheduled ref="weChat" method="getAccessToken" cron="0 */118 * * * ?" />
</task:scheduled-tasks>
<context:component-scan base-package="com.phxl.modules" />
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
default-lazy-init="true">
<!-- 启用注解 -->
<context:component-scan base-package="com.phxl.modules" />
<!-- 引入属性文件 -->
<context:property-placeholder location="classpath:config.properties"/>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!-- 配置sqlsessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations">
<list>
<value>classpath:/mappings/**/*.xml</value>
</list>
</property>
</bean>
<!-- 扫描Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.phxl.modules"/>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 缓存配置 -->
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManagerConfigFile" value="classpath:${ehcache.configFile}" />
</bean>
<!-- 启用注解事务 -->
<tx:annotation-driven/>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
<context:annotation-config />
<context:component-scan base-package="com.phxl.modules.goods.web.spd">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<util:properties id="config" location="classpath:config.properties"/>
</beans>
ALTER TABLE med_hli_plan ADD COLUMN settle_type VARCHAR(10) COMMENT '0:零库存 1:非零库存' AFTER bill_type;
\ No newline at end of file
ALTER TABLE med_bill_settlement ADD COLUMN use_bill_no LONGTEXT COMMENT '发药单号';
ALTER TABLE med_bill_settlement_detail DROP use_bill_no;
\ No newline at end of file
Manifest-Version: 1.0
Built-By: ASUS
Build-Jdk: 1.8.0_141
Created-By: Maven Integration for Eclipse
Main-Class: Runner
#Generated by Maven Integration for Eclipse
#Thu Oct 10 09:03:23 CST 2019
version=1.0
groupId=com.phxl
m2e.projectName=medicinal-supplier
m2e.projectLocation=D\:\\csbr_fanming_xlc\\SPD\u524D\u7F6E\u673A\\medicinal-supplier
artifactId=medicinal-supplier
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.phxl</groupId>
<artifactId>medicinal-supplier</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>medicinal-supplier</name>
<url>http://maven.apache.org</url>
<!-- 属性配置 -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<junit.version>4.8.1</junit.version>
<javax.servlet.version>1.2</javax.servlet.version>
<javax.servlet.api.version>2.5</javax.servlet.api.version>
<spring.version>4.1.1.RELEASE</spring.version>
<ehcache.version>2.6.11</ehcache.version>
<ehcache-web.version>2.0.4</ehcache-web.version>
<shiro.version>1.2.3</shiro.version>
<org.apache.commons.version>3.3.2</org.apache.commons.version>
<org.apache.xmlbeans.version>2.6.0</org.apache.xmlbeans.version>
<org.apache.poi.version>3.9</org.apache.poi.version>
<org.apache.poi.openxml4j.version>1.0-beta</org.apache.poi.openxml4j.version>
<com.fasterxml.jackson.version>2.8.4</com.fasterxml.jackson.version>
<com.itextpdf.version>5.5.7</com.itextpdf.version>
<com.itextpdf.itext-asian.version>5.2.0</com.itextpdf.itext-asian.version>
<com.aliyun.oss.version>2.2.3</com.aliyun.oss.version>
<com.google.gson.version>2.2.2</com.google.gson.version>
<com.google.zxing.version>3.2.1</com.google.zxing.version>
<com.thoughtworks.xstream.version>1.4.10</com.thoughtworks.xstream.version>
<commons-fileupload.version>1.3.1</commons-fileupload.version>
<dom4j.version>1.6.1</dom4j.version>
<qrcode.version>1.4</qrcode.version>
<eu.medsea.mimeutil.version>2.1.3</eu.medsea.mimeutil.version>
<mysql.driver.version>5.1.30</mysql.driver.version>
<mybatis.version>3.2.8</mybatis.version>
<mybatis-spring.version>1.2.3</mybatis-spring.version>
<cxf.version>2.2.3</cxf.version>
<!-- environment setting -->
<jdk.version>1.8</jdk.version>
<tomcat.version>2.2</tomcat.version>
<webserver.port>8888</webserver.port>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources>
<slf4j.version>1.7.7</slf4j.version>
<!-- logback setting -->
<ch.qos.logback.version>1.1.7</ch.qos.logback.version>
<org.slf4j.version>1.7.7</org.slf4j.version>
</properties>
<!-- 配置环境 -->
<profiles>
<profile>
<id>prod</id>
<!-- <activation>
<activeByDefault>true</activeByDefault>
</activation> -->
<properties>
<package.environment>prod</package.environment>
</properties>
</profile>
<profile>
<id>stg</id>
<properties>
<package.environment>stg</package.environment>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<package.environment>test</package.environment>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${com.fasterxml.jackson.version}</version>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${javax.servlet.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>${com.aliyun.oss.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${javax.servlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.33</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${org.apache.commons.version}</version>
</dependency>
<dependency>
<groupId>eu.medsea.mimeutil</groupId>
<artifactId>mime-util</artifactId>
<version>${eu.medsea.mimeutil.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${com.google.gson.version}</version>
</dependency>
<!-- <dependency>
<groupId>javabuilder</groupId>
<artifactId>javabuilder_rt</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/rt.jar</systemPath>
</dependency>
<dependency>
<groupId>javabuilder</groupId>
<artifactId>javabuilder11_jce</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jce.jar</systemPath>
</dependency> -->
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>${com.thoughtworks.xstream.version}</version>
</dependency>
<!-- LOGGING begin -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- logback -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<!-- Apache POI: start -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${org.apache.poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>${org.apache.xmlbeans.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>openxml4j</artifactId>
<version>${org.apache.poi.openxml4j.version}</version>
</dependency>
<!-- itextpdf -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>${com.itextpdf.itext-asian.version}</version>
</dependency>
<!-- Zxing -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>${com.google.zxing.version}</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>${dom4j.version}</version>
</dependency>
<!-- QRCode -->
<dependency>
<groupId>net.glxn</groupId>
<artifactId>qrgen</artifactId>
<version>${qrcode.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.driver.version}</version>
<scope>runtime</scope>
</dependency>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
<!-- CACHE begin -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>${ehcache.version}</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-web</artifactId>
<version>${ehcache-web.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-ehcache</artifactId>
<version>${shiro.version}</version>
</dependency>
</dependencies>
<!--构建设置 -->
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>conf/${package.environment}</directory>
<filtering>true</filtering>
<includes>
<include>*.*</include>
</includes>
</resource>
</resources>
<plugins>
<!-- insert jetty class(compiler) -->
<!-- 指定war包的执行入口-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<archive>
<manifest>
<mainClass>Runner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!-- 将Runner移动到Meta-info下面-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>main-class-placement</id>
<phase>prepare-package</phase>
<configuration>
<target>
<move todir="${project.build.directory}/${project.artifactId}-${project.version}-${package.environment}/">
<fileset dir="${project.build.directory}/classes/">
<include name="Runner.class" />
</fileset>
</move>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
<!-- <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<optimize>true</optimize>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
<showWarnings>false</showWarnings>
<compilerArguments>
<verbose />
<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin> -->
<!-- tomcat7插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat.version}</version>
<configuration>
<port>${webserver.port}</port>
<path>/${project.artifactId}</path>
<uriEncoding>${project.build.sourceEncoding}</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
#Generated by Maven
#Tue Jul 09 17:29:34 CST 2019
version=1.0
groupId=com.phxl
artifactId=medicinal-supplier
com\phxl\modules\goods\service\supplierstock\SupplierStockService.class
com\phxl\modules\goods\entity\billsettlement\BillSettlementDetail.class
com\phxl\common\utils\Exceptions.class
com\phxl\modules\goods\entity\spills\HisSpillsList.class
com\phxl\common\util\JsonMapper.class
com\phxl\modules\goods\dao\medstock\MedStockDao.class
com\phxl\modules\wechat\entity\PushOrder.class
com\phxl\modules\goods\dao\ctcareprov\CTCareProvDao.class
com\phxl\common\util\PdfReportHeaderFooter.class
com\phxl\common\util\XMLUtil.class
com\phxl\common\utils\CacheUtils.class
com\phxl\modules\goods\dao\ctdept\HisCtDeptDao.class
com\phxl\modules\goods\entity\medinstore\MedInStore.class
com\phxl\modules\goods\service\medinstore\MedInStoreService.class
com\phxl\common\util\Tools.class
com\phxl\modules\goods\dao\supplierstock\SupplierStockDao.class
com\phxl\modules\goods\entity\billback\BillBackWithDetail.class
com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackWithDetail.class
com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackDetail.class
com\phxl\common\response\PlatFormResponseConstant.class
com\phxl\common\util\MD5Util.class
com\phxl\common\util\JsonMapper$2.class
com\phxl\modules\goods\service\medstock\MedStockService.class
com\phxl\modules\wechat\service\impl\WeChatServiceImpl.class
com\phxl\modules\goods\dao\billsettlement\BillSettlementDetailDao.class
com\phxl\modules\goods\service\suoutstore\SuOutStoreService.class
com\phxl\common\utils\Encodes.class
com\phxl\common\utils\PropertiesLoader.class
com\phxl\common\utils\SpringContextHolder.class
com\phxl\common\util\PropertiesLoader.class
com\phxl\modules\goods\entity\billback\BillBackDetail.class
com\phxl\modules\goods\service\supplygoods\MedSupplyGoodsService.class
com\phxl\modules\goods\dao\hisCtMedicineMaterial\HisCtMedicineMaterialDao.class
com\phxl\common\util\IdentifieUtil.class
com\phxl\modules\goods\dao\interfaceLog\InterfaceLogDao.class
com\phxl\modules\goods\entity\suoutstore\SuOutStore.class
com\phxl\modules\goods\service\hisCtMedicineMaterial\HisCtMedicineMaterialService.class
com\phxl\modules\goods\service\medplan\MedPlanService.class
com\phxl\modules\goods\entity\medplan\MedPlanWithDetail.class
com\phxl\common\constants\HisResponseConstant$ResponseHeaderMsg.class
com\phxl\common\util\SystemConfig.class
com\phxl\modules\goods\dao\billsettlement\BillSettlementDao.class
com\phxl\modules\goods\dao\suoutstore\SuOutStoreDetailDao.class
com\phxl\common\util\HttpUtils.class
com\phxl\modules\goods\dao\medinstore\MedInStoreDetailDao.class
com\phxl\modules\wechat\dto\WeChatDto.class
com\phxl\common\constants\HisRequestConstant.class
com\phxl\modules\goods\entity\billback\BillBack.class
com\phxl\modules\goods\entity\supplierstock\SupplierStockList.class
com\phxl\common\util\JsonToUtils.class
com\phxl\common\utils\IdUtil.class
com\phxl\modules\goods\entity\medplan\MedPlanDetail.class
com\phxl\modules\goods\entity\hisCtMedicineMaterial\HisCtMedicineMaterial.class
com\phxl\modules\goods\entity\ctdept\HisCtDept.class
com\phxl\modules\goods\dao\medplan\MedPlanDetailDao.class
com\phxl\common\util\Global.class
com\phxl\common\util\HTTPClient.class
com\phxl\modules\goods\entity\medinstore\MedInStoreDetail.class
com\phxl\modules\goods\entity\suoutstore\SuOutStoreWithDetail.class
com\phxl\common\constants\PlatformConstant.class
com\phxl\common\filter\SimpleCORSFilter.class
com\phxl\common\response\PlatFormResponseConstant$ResponseHeaderMsg.class
com\phxl\modules\goods\service\ctcareprov\CTCareProvService.class
com\phxl\common\util\ExportUtil.class
com\phxl\modules\wechat\constants\WeChatConstants.class
com\phxl\modules\goods\entity\billsettlement\BillSettlement.class
com\phxl\modules\goods\entity\medstock\MedStockList.class
com\phxl\common\constants\HisResponseConstant$ResponseBodyMsg.class
com\phxl\modules\goods\service\billsettlement\BillSettlementService.class
com\phxl\modules\wechat\utils\WeChatHttpClient.class
com\phxl\modules\wechat\service\WeChatService.class
com\phxl\modules\goods\service\billback\BillBackService.class
com\phxl\common\util\JsonUtils.class
com\phxl\modules\goods\dao\billback\BillBackDetailDao.class
com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDao.class
com\phxl\modules\goods\entity\medplan\MedPlanDto.class
com\phxl\modules\goods\entity\supplierstock\SupplierStock.class
com\phxl\modules\goods\entity\suoutstore\SuOutStoreDetail.class
com\phxl\modules\goods\entity\billsettlement\BillSettlementWithDetail.class
com\phxl\common\utils\BaseException.class
com\phxl\modules\wechat\utils\WeChatUtils.class
com\phxl\common\response\PlatFormResponseConstant$ResponseBodyMsg.class
com\phxl\common\util\DateUtils.class
com\phxl\modules\wechat\entity\RequestParams.class
com\phxl\modules\goods\service\spills\HisSpillsService.class
com\phxl\common\response\PlatFormResponse.class
com\phxl\modules\goods\entity\invoiceback\SuInvoiceBack.class
com\phxl\common\util\XMLClient.class
com\phxl\modules\goods\entity\spills\HisSpills.class
com\phxl\common\utils\CookieUtils.class
com\phxl\modules\wechat\controller\WeChatController.class
com\phxl\modules\goods\web\spd\HisProxyController.class
com\phxl\modules\goods\entity\medstock\MedStock.class
com\phxl\modules\goods\service\interfaceLog\InterfaceLogService.class
com\phxl\modules\goods\dao\billback\BillBackDao.class
com\phxl\common\util\VideoThumbTaker.class
com\phxl\common\util\JsonMapper$1.class
com\phxl\modules\goods\entity\medplan\MedPlan.class
com\phxl\modules\wechat\constants\WeChatEnum.class
com\phxl\common\utils\ReturnCode.class
com\phxl\modules\goods\dao\medinstore\MedInStoreDao.class
com\phxl\modules\goods\entity\interfaceLog\InterfaceLog.class
com\phxl\modules\goods\dao\supplygoods\MedSupplyGoodsDao.class
com\phxl\modules\goods\service\ctdept\HisCtDeptService.class
com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDetailDao.class
com\phxl\modules\goods\dao\spills\HisSpillsDao.class
com\phxl\modules\goods\entity\medinstore\MedInStoreWithDetail.class
com\phxl\modules\goods\dao\medplan\MedPlanDao.class
com\phxl\modules\goods\web\spd\SpdControlller.class
com\phxl\modules\goods\dao\suoutstore\SuOutStoreDao.class
com\phxl\common\constants\HisResponseConstant.class
com\phxl\modules\goods\service\invoiceback\SuInvoiceBackService.class
com\phxl\modules\goods\entity\ctcareprov\CTCareProv.class
com\phxl\modules\goods\entity\supplygoods\MedSupplyGoods.class
com\phxl\common\util\JaxbUtil.class
com\phxl\common\util\JsonDateDeserializer.class
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billback\BillBack.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonDateDeserializer.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\constants\WeChatEnum.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\spills\HisSpillsList.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billback\BillBackDetailDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medinstore\MedInStore.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\supplierstock\SupplierStock.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\suoutstore\SuOutStoreDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billback\BillBackDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medinstore\MedInStoreWithDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\VideoThumbTaker.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\ctdept\HisCtDeptDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\utils\WeChatUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\Encodes.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medstock\MedStockList.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\suoutstore\SuOutStore.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\medplan\MedPlanService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\supplierstock\SupplierStockDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\constants\WeChatConstants.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\IdUtil.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\PropertiesLoader.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\web\spd\SpdControlller.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\hisCtMedicineMaterial\HisCtMedicineMaterialService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\ReturnCode.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\medstock\MedStockService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlanDto.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackWithDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\utils\WeChatHttpClient.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billsettlement\BillSettlement.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\Global.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\billsettlement\BillSettlementService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\response\PlatFormResponse.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medinstore\MedInStoreDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\spills\HisSpillsService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JaxbUtil.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medplan\MedPlanDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\CacheUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\hisCtMedicineMaterial\HisCtMedicineMaterialDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\invoiceback\SuInvoiceBackService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\dto\WeChatDto.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\suoutstore\SuOutStoreService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billsettlement\BillSettlementDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\constants\HisRequestConstant.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\Tools.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\PdfReportHeaderFooter.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\spills\HisSpillsDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\IdentifieUtil.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\ctcareprov\CTCareProvService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\HTTPClient.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\ctcareprov\CTCareProv.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\service\impl\WeChatServiceImpl.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDetailDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\constants\HisResponseConstant.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\HttpUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\CookieUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\interfaceLog\InterfaceLog.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\medinstore\MedInStoreService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\interfaceLog\InterfaceLogDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billsettlement\BillSettlementWithDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\Exceptions.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\interfaceLog\InterfaceLogService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonMapper.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\BaseException.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\web\spd\HisProxyController.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\ctdept\HisCtDeptService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\SpringContextHolder.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\supplygoods\MedSupplyGoodsDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\response\PlatFormResponseConstant.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\ctcareprov\CTCareProvDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\suoutstore\SuOutStoreDetailDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\spills\HisSpills.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\filter\SimpleCORSFilter.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medstock\MedStockDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\supplygoods\MedSupplyGoods.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\utils\PropertiesLoader.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\service\WeChatService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\controller\WeChatController.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\billback\BillBackService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\supplygoods\MedSupplyGoodsService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billsettlement\BillSettlementDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\ctdept\HisCtDept.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\DateUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\JsonToUtils.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\entity\PushOrder.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billsettlement\BillSettlementDetailDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\SystemConfig.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medinstore\MedInStoreDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\ExportUtil.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medstock\MedStock.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\invoiceback\SuInvoiceBackDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\suoutstore\SuOutStoreDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\wechat\entity\RequestParams.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\suoutstore\SuOutStoreWithDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\billback\BillBackWithDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\supplierstock\SupplierStockList.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\hisCtMedicineMaterial\HisCtMedicineMaterial.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\invoiceback\SuInvoiceBackDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\XMLUtil.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\XMLClient.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\constants\PlatformConstant.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medinstore\MedInStoreDetailDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlanWithDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlanDetail.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\medplan\MedPlan.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\entity\invoiceback\SuInvoiceBack.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\service\supplierstock\SupplierStockService.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\billback\BillBackDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\modules\goods\dao\medplan\MedPlanDetailDao.java
D:\WorkSpaces\SPD\CS\medicinal-supplier\src\main\java\com\phxl\common\util\MD5Util.java
Manifest-Version: 1.0
Built-By: 何
Created-By: IntelliJ IDEA
Build-Jdk: 1.8
Main-Class: Runner
<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="false" name="defaultCache">
<diskStore path="../temp/medicinal/ehcache" />
<!-- 默认缓存配置. 自动失效:最后一次访问时间间隔300秒失效,若没有访问过自创建时间600秒失效。-->
<defaultCache maxEntriesLocalHeap="1000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
overflowToDisk="true" statistics="true"/>
<!-- 系统缓存 -->
<cache name="sysCache" maxEntriesLocalHeap="1000" eternal="true" overflowToDisk="true" statistics="true"/>
</ehcache>
\ No newline at end of file
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://10.146.9.50:3306/medicinal-supplier?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=BOE190326jdfyy
spd_service_url = http://10.146.9.50:8080/medicinal-web/a/spdrecvsupplier/
huarun_service_url = http://61.190.54.189:8001/huarun/spd/syn/
#spd服务地址
spd_wechat_url = http://10.146.9.50:8080/medicinal-web/a/wechat/
spd_wechat_login=http://10.146.9.50:8080/medicinal-web/a/login
spd_wechat_logout=http://10.146.9.50:8080/medicinal-web/a/logout
appid=wx9657f3a42806237c
appsecrent=fb6768612d5802551d202d9b4e59d23e
token=spd
ehcache.configFile=cache/ehcache-local.xml
version=V1.2.7
order_template_id=a8mZCkoeBHiqwVUJvDbrNS-qe5mT8wVksutVY_MWSjs
store_template_id=wF6hltnW1eYLQRcGIVc7SUCClnR3FXbb9575PDnw3q0
lic_template_id=eHuLEQ9lwvfK_ovjKlupDDfMTkUrbbuVPL5-gOSmAuM
local_url=http://60.174.197.140:9001
<?xml version="1.0" ?>
<!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="600 seconds" debug="false">
<!-- 定义日志文件 输入位置 -->
<property name="log_dir" value="/usr/supplierlog"/>
<!-- 日志最大的历史-->
<property name="maxHistory" value="90"/>
<property name="normal-pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
<!-- ConsoleAppender 控制台输出日志 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- 对日志进行格式化 -->
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- ERROR级别日志 -->
<!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 过滤器,只记录WARN级别的日志 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${log_dir}/error.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/error-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- INFO级别日志 appender -->
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<file>${log_dir}/info.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/info-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<!-- DEBUG级别日志 appender -->
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
<file>${log_dir}/debug.log</file>
<!-- 配置日志所生成的目录-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_dir}/debug-%d{yyyy-MM-dd-HH}.log.gz</fileNamePattern>
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${normal-pattern}</pattern>
</encoder>
</appender>
<logger name="org.apache.zookeeper.ClientCnxn" level="ERROR" additivity="false"/>
<logger name="com.phxl.modules.goods.dao" level="debug" additivity="false">
<appender-ref ref="debug" />
</logger>
<!-- root级别 DEBUG -->
<root level="DEBUG">
<!-- 控制台输出 -->
<appender-ref ref="STDOUT" />
<!-- 文件输出 -->
<appender-ref ref="ERROR" />
<appender-ref ref="INFO" />
<appender-ref ref="DEBUG" />
</root>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billback.BillBackDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
<result column="medMV_row_no" property="medMVRowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="returns_unit" property="returns_Unit" jdbcType="VARCHAR" />
<result column="returns_price" property="returns_Price" jdbcType="DECIMAL" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="rpi_qty" property="rpiQty" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入BillBackDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medMVBillNo},
#{obj.medMVRowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.returns_Unit},
#{obj.returns_Price},
#{obj.manufacturer},
#{obj.rpiQty},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billback.BillBackDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billback.BillBack">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="medMV_bill_no" property="medMVBillNo" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplierb_name" property="supplierbName" jdbcType="VARCHAR" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="reason" property="reason" jdbcType="VARCHAR" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增BillBack-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.billback.BillBack">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medMVBillNo,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierbName,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{reason,jdbcType=VARCHAR}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billsettlement.BillSettlementDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_cate" property="goodsCate" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="settle_price" property="settleUnit" jdbcType="DECIMAL" />
<result column="settle_amount" property="settlePrice" jdbcType="DECIMAL" />
<result column="regist_key" property="registKey" jdbcType="VARCHAR" />
<result column="producer_name" property="producerName" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入BillBackDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.settleBillNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.settleQty},
#{obj.unit},
#{obj.settlePrice},
#{obj.settleAmount},
#{obj.registKey},
#{obj.producerName},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.create_time},
#{obj.update_time},
#{obj.goodsCate}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.billsettlement.BillSettlementDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
<result column="bill_state" property="billState" jdbcType="VARCHAR" />
<result column="purchaser_corp_code" property="medCode" jdbcType="VARCHAR" />
<result column="purchaser_corp_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="TIMESTAMP" />
<result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
<result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
<result column="use_bill_no" property="usebillno" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增BillBack-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.billsettlement.BillSettlement">
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)
values (
#{id,jdbcType=VARCHAR}
,#{settleBillNo,jdbcType=VARCHAR}
,#{settleDate,jdbcType=TIMESTAMP}
,#{billState,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=TIMESTAMP}
,#{goodsSum,jdbcType=TINYINT}
,#{amount,jdbcType=DECIMAL}
,#{beginDate,jdbcType=TIMESTAMP}
,#{endDate,jdbcType=TIMESTAMP}
,#{useBillNo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.ctcareprov.CTCareProvDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.ctcareprov.CTCareProv">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="mfmed_staff_code" property="mfmedStaffCode" jdbcType="VARCHAR" />
<result column="logon_user" property="logonUser" jdbcType="VARCHAR" />
<result column="real_name" property="realName" jdbcType="VARCHAR" />
<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="mobile_tel" property="mobileTel" jdbcType="VARCHAR" />
<result column="web_chat_code" property="webChatCode" jdbcType="VARCHAR" />
<result column="idcode" property="idcode" jdbcType="VARCHAR" />
<result column="e_mail" property="e_mail" jdbcType="VARCHAR" />
<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
<result column="category" property="category" jdbcType="VARCHAR" />
<result column="ishadministrator" property="ishadministrator" jdbcType="VARCHAR" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.mfmedStaffCode},
#{obj.logonUser},
#{obj.realName},
#{obj.helpCode},
#{obj.sex},
#{obj.mobileTel},
#{obj.webChatCode},
#{obj.idcode},
#{obj.e_mail},
#{obj.hdeptCode},
#{obj.category},
#{obj.ishadministrator},
#{obj.update_time}
</trim>
</foreach>
</insert>
<!-- 批量查询HisCtDept -->
<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from med_hli_care_prov
<if test="ryCodes != null">
where mfmed_staff_code in
<foreach item="item" index="index" collection="ryCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<update id="batchUpdate" parameterType="list">
update med_hli_care_prov
<trim prefix="set" suffixOverrides=",">
<trim prefix="mfmed_staff_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.mfmedStaffCode != null and obj.mfmedStaffCode != ''">
when id = #{obj.id}
then #{obj.mfmedStaffCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="logon_user=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.logonUser != null and obj.logonUser != ''">
when id = #{obj.id}
then
#{obj.logonUser,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="real_name=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.realName != null and obj.realName != ''">
when id = #{obj.id}
then #{obj.realName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="sex=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.sex != null and obj.sex != ''">
when id = #{obj.id}
then #{obj.sex,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="mobile_tel=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.mobileTel != null and obj.mobileTel != ''">
when id = #{obj.id}
then #{obj.mobileTel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="web_chat_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.webChatCode != null and obj.webChatCode != ''">
when id = #{obj.id}
then #{obj.webChatCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="idcode=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.idcode != null and obj.idcode != ''">
when id = #{obj.id}
then #{obj.idcode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="hdept_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
when id = #{obj.id}
then #{obj.hdeptCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="e_mail=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.e_mail != null and obj.e_mail != ''">
when id = #{obj.id}
then #{obj.e_mail,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="ishadministrator=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.ishadministrator != null and obj.ishadministrator != ''">
when id = #{obj.id}
then #{obj.ishadministrator,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.update_time != null and obj.update_time != ''">
when id = #{obj.id}
then #{obj.update_time,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="obj" index="index">
id
= #{obj.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.ctdept.HisCtDeptDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.ctdept.HisCtDept">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="hdept_code" property="hdeptCode" jdbcType="VARCHAR" />
<result column="hdept_name" property="hdeptName" jdbcType="VARCHAR" />
<result column="help_code" property="helpCode" jdbcType="VARCHAR" />
<result column="upper_GUID" property="upperGUID" jdbcType="VARCHAR" />
<result column="is_order_right" property="isOrderRight" jdbcType="VARCHAR" />
<result column="category" property="category" jdbcType="VARCHAR" />
<result column="director" property="director" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="VARCHAR" />
<result column="is_last_level" property="isLastLevel" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 批量查询 -->
<select id="batchSelect" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from med_hli_dept
<if test="ctcpCodes != null">
where hdept_code in
<foreach item="item" index="index" collection="ctcpCodes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.hdeptCode},
#{obj.hdeptName},
#{obj.helpCode},
#{obj.upperGUID},
#{obj.isOrderRight},
#{obj.category},
#{obj.director},
#{obj.state},
#{obj.isLastLevel},
#{obj.create_time},
#{obj.update_time}
</trim>
</foreach>
</insert>
<update id="batchUpdate" parameterType="list">
update med_hli_dept
<trim prefix="set" suffixOverrides=",">
<trim prefix="hdept_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptCode != null and obj.hdeptCode != ''">
when id = #{obj.id}
then #{obj.hdeptCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="hdept_name=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.hdeptName != null and obj.hdeptName != ''">
when id = #{obj.id}
then
#{obj.hdeptName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="help_code=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.helpCode != null and obj.helpCode != ''">
when id = #{obj.id}
then #{obj.helpCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="upper_GUID=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.upperGUID != null and obj.upperGUID != ''">
when id = #{obj.id}
then #{obj.upperGUID,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="is_order_right=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.isOrderRight != null and obj.isOrderRight != ''">
when id = #{obj.id}
then #{obj.isOrderRight,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.category != null and obj.category != ''">
when id = #{obj.id}
then #{obj.category,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="director=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.director != null and obj.director != ''">
when id = #{obj.id}
then #{obj.director,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="state=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.state != null and obj.state != ''">
when id = #{obj.id}
then #{obj.state,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="is_last_level=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.isLastLevel != null and obj.isLastLevel != ''">
when id = #{obj.id}
then #{obj.isLastLevel,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.create_time != null">
when id = #{obj.id}
then #{obj.create_time,jdbcType=DATE}
</if>
</foreach>
</trim>
<trim prefix="update_time=case" suffix="end,">
<foreach collection="list" item="obj" index="index">
<if test="obj.update_time != null">
when id = #{obj.id}
then #{obj.update_time,jdbcType=DATE}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="obj" index="index">
id
= #{obj.id}
</foreach>
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phxl.modules.goods.dao.hisCtMedicineMaterial.HisCtMedicineMaterialDao">
<!--BaseResultMap-->
<resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="med_code" property="medCode" jdbcType="VARCHAR"/>
<result column="med_name" property="medName" jdbcType="VARCHAR"/>
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
<result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
<result column="s_name" property="sName" jdbcType="VARCHAR"/>
<result column="p_name" property="pName" jdbcType="VARCHAR"/>
<result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
<result column="producer" property="producer" jdbcType="VARCHAR"/>
<result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
<result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
<result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
<result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
<result column="price" property="price" jdbcType="DECIMAL"/>
<result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
<result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
<result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
<result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
<result column="length" property="length" jdbcType="DECIMAL"/>
<result column="width" property="width" jdbcType="DECIMAL"/>
<result column="height" property="height" jdbcType="DECIMAL"/>
<result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
<result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
<result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
<result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
<result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
<result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
<result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
<result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
<result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
<result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
<result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
<result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
<result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
<result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
<result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
<result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
<result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
<result column="brand" property="brand" jdbcType="VARCHAR"/>
<result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
<result column="memo" property="memo" jdbcType="VARCHAR"/>
</resultMap>
<!--Base_Column_List-->
<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>
<!-- 新增HisCtMedicineMaterial-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{sName,jdbcType=VARCHAR}
,#{pName,jdbcType=VARCHAR}
,#{helpCode,jdbcType=VARCHAR}
,#{producer,jdbcType=VARCHAR}
,#{agentName,jdbcType=VARCHAR}
,#{medGoodsCateGUID,jdbcType=VARCHAR}
,#{medGoodsCateName,jdbcType=VARCHAR}
,#{registKey,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL}
,#{salePrice,jdbcType=DECIMAL}
,#{batSalePrice,jdbcType=DECIMAL}
,#{productionAddress,jdbcType=VARCHAR}
,#{dosageForm,jdbcType=VARCHAR}
,#{length,jdbcType=DECIMAL}
,#{width,jdbcType=DECIMAL}
,#{height,jdbcType=DECIMAL}
,#{grossWeight,jdbcType=DECIMAL}
,#{netWeight,jdbcType=DECIMAL}
,#{unitStyle,jdbcType=VARCHAR}
,#{bigUnitStyle,jdbcType=VARCHAR}
,#{bigUnitQty,jdbcType=DECIMAL}
,#{bigBcd,jdbcType=VARCHAR}
,#{minUnitStyle,jdbcType=VARCHAR}
,#{minUnitQty,jdbcType=DECIMAL}
,#{litBcd,jdbcType=VARCHAR}
,#{isLotCtrlInput,jdbcType=VARCHAR}
,#{bizState,jdbcType=VARCHAR}
,#{importedFlag,jdbcType=VARCHAR}
,#{reportFlag,jdbcType=VARCHAR}
,#{noxiousFlag,jdbcType=VARCHAR}
,#{drugNerveFlag,jdbcType=VARCHAR}
,#{productStandardCode,jdbcType=VARCHAR}
,#{specStandardCode,jdbcType=VARCHAR}
,#{brand,jdbcType=VARCHAR}
,#{coldFlag,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{memo,jdbcType=VARCHAR}
)
</insert>
<!-- 按需修改HisCtMedicineMaterial-->
<update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
update med_hli_medicine_material
<set>
<if test="medName != null and medName != ''">
med_name = #{medName,jdbcType=VARCHAR},
</if>
<if test="goodsCode != null and goodsCode != ''">
goods_code = #{goodsCode,jdbcType=VARCHAR},
</if>
<if test="goodsSpec != null and goodsSpec != ''">
goods_spec = #{goodsSpec,jdbcType=VARCHAR},
</if>
<if test="goodsName != null and goodsName != ''">
goods_name = #{goodsName,jdbcType=VARCHAR},
</if>
<if test="sName != null and sName != ''">
s_name = #{sName,jdbcType=VARCHAR},
</if>
<if test="pName != null and pName != ''">
p_name = #{pName,jdbcType=VARCHAR},
</if>
<if test="helpCode != null and helpCode != ''">
help_code = #{helpCode,jdbcType=VARCHAR},
</if>
<if test="producer != null and producer != ''">
producer = #{producer,jdbcType=VARCHAR},
</if>
<if test="agentName != null and agentName != ''">
agent_name = #{agentName,jdbcType=VARCHAR},
</if>
<if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
</if>
<if test="medGoodsCateName != null and medGoodsCateName != ''">
med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
</if>
<if test="registKey != null and registKey != ''">
regist_key = #{registKey,jdbcType=VARCHAR},
</if>
<if test="price != null and price != ''">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="salePrice != null and salePrice != ''">
sale_price = #{salePrice,jdbcType=DECIMAL},
</if>
<if test="batSalePrice != null and batSalePrice != ''">
bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
</if>
<if test="productionAddress != null and productionAddress != ''">
production_address = #{productionAddress,jdbcType=VARCHAR},
</if>
<if test="dosageForm != null and dosageForm != ''">
dosage_form = #{dosageForm,jdbcType=VARCHAR},
</if>
<if test="length != null and length != ''">
length = #{length,jdbcType=DECIMAL},
</if>
<if test="width != null and width != ''">
width = #{width,jdbcType=DECIMAL},
</if>
<if test="height != null and height != ''">
height = #{height,jdbcType=DECIMAL},
</if>
<if test="grossWeight != null and grossWeight != ''">
gross_weight = #{grossWeight,jdbcType=DECIMAL},
</if>
<if test="netWeight != null and netWeight != ''">
net_weight = #{netWeight,jdbcType=DECIMAL},
</if>
<if test="unitStyle != null and unitStyle != ''">
unit_style = #{unitStyle,jdbcType=VARCHAR},
</if>
<if test="bigUnitStyle != null and bigUnitStyle != ''">
big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
</if>
<if test="bigUnitQty != null and bigUnitQty != ''">
big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
</if>
<if test="bigBcd != null and bigBcd != ''">
big_bcd = #{bigBcd,jdbcType=VARCHAR},
</if>
<if test="minUnitStyle != null and minUnitStyle != ''">
min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
</if>
<if test="minUnitQty != null and minUnitQty != ''">
min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
</if>
<if test="litBcd != null and litBcd != ''">
lit_bcd = #{litBcd,jdbcType=VARCHAR},
</if>
<if test="isLotCtrlInput != null and isLotCtrlInput != ''">
is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
</if>
<if test="bizState != null and bizState != ''">
biz_state = #{bizState,jdbcType=VARCHAR},
</if>
<if test="importedFlag != null and importedFlag != ''">
imported_flag = #{importedFlag,jdbcType=VARCHAR},
</if>
<if test="reportFlag != null and reportFlag != ''">
report_flag = #{reportFlag,jdbcType=VARCHAR},
</if>
<if test="noxiousFlag != null and noxiousFlag != ''">
noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
</if>
<if test="drugNerveFlag != null and drugNerveFlag != ''">
drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
</if>
<if test="productStandardCode != null and productStandardCode != ''">
product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
</if>
<if test="specStandardCode != null and specStandardCode != ''">
spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
</if>
<if test="brand != null and brand != ''">
brand = #{brand,jdbcType=VARCHAR},
</if>
<if test="coldFlag != null and coldFlag != ''">
cold_flag = #{coldFlag,jdbcType=VARCHAR},
</if>
<if test="supplierCode != null and supplierCode != ''">
supplier_code = #{supplierCode,jdbcType=VARCHAR},
</if>
<if test="supplierName != null and supplierName != ''">
supplier_name=#{supplierName,jdbcType=VARCHAR},
</if>
<if test="memo != null and memo != ''">
memo=#{memo,jdbcType=VARCHAR}
</if>
</set>
where med_code = #{medCode,jdbcType=BIGINT}
</update>
<!-- 查询HisCtMedicineMaterial详情 -->
<select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
select
<include refid="Base_Column_List"/>
from med_hli_medicine_material material
<where>
<if test="goodsCode!=null and goodsCode!=''">
And goods_code = #{goodsCode,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.phxl.modules.goods.dao.interfaceLog.InterfaceLogDao">
<insert id="insert">
INSERT INTO med_interface_log(
id,
request_time,
request_method,
request_param
) VALUES (
#{id},
#{requestTime},
#{requestMethod},
#{requestParam}
)
</insert>
<!-- 更新接口请求结果信息-->
<update id="update" parameterType="com.phxl.modules.goods.entity.interfaceLog.InterfaceLog">
update med_interface_log
<set>
<if test="resultCode != null and resultCode != ''">
result_code = #{resultCode,jdbcType=VARCHAR},
</if>
<if test="resultContent != null and resultContent != ''">
result_content = #{resultContent,jdbcType=VARCHAR},
</if>
<if test="exception != null and exception != ''">
exception = #{exception,jdbcType=VARCHAR}
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBackDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="producer_name" property="producerName" jdbcType="VARCHAR" />
<result column="regist_key" property="registKey" jdbcType="VARCHAR" />
<result column="settle_qty" property="settleQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="settle_price" property="settlePrice" jdbcType="DECIMAL" />
<result column="settle_amount" property="settleAmount" jdbcType="DECIMAL" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
<result column="invoice_no" property="invoiceNo" jdbcType="VARCHAR" />
<result column="invoice_code" property="invoiceCode" jdbcType="VARCHAR" />
<result column="invoice_time" property="invoiceTime" jdbcType="DECIMAL" />
<result column="invoice_amount" property="invoiceAmount" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.settleBillNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.producerName},
#{obj.registKey},
#{obj.settleQty},
#{obj.unit},
#{obj.settlePrice},
#{obj.settleAmount},
#{obj.create_time},
#{obj.update_time},
#{obj.invoiceNo},
#{obj.invoiceCode},
#{obj.invoiceTime},
#{obj.invoiceAmount}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.invoiceback.SuInvoiceBackDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="settle_bill_no" property="settleBillNo" jdbcType="VARCHAR" />
<result column="settle_date" property="settleDate" jdbcType="TIMESTAMP" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="goods_sum" property="goodsSum" jdbcType="TINYINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="begin_date" property="beginDate" jdbcType="TIMESTAMP" />
<result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增invoiceback-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.invoiceback.SuInvoiceBack">
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)
values (
#{id,jdbcType=VARCHAR}
,#{settleBillNo,jdbcType=VARCHAR}
,#{settleDate,jdbcType=TIMESTAMP}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{goodsSum,jdbcType=TINYINT}
,#{amount,jdbcType=DECIMAL}
,#{beginDate,jdbcType=TIMESTAMP}
,#{endDate,jdbcType=TIMESTAMP}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medinstore.MedInStoreDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
<result column="supplier_do_no" property="supplierDoNo" jdbcType="VARCHAR" />
<result column="supplier_do_row_no" property="supplierDoRowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
<result column="mvqty" property="mvqty" jdbcType="DECIMAL" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedInStoreDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medPlanRowNo},
#{obj.supplierDoNo},
#{obj.supplierDoRowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.unit},
#{obj.manufacturer},
#{obj.purchaserPrice},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.arrivalqty},
#{obj.mvqty},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medinstore.MedInStoreDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medinstore.MedInStore">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增MedInStore-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medinstore.MedInStore">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medGuid,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{medDeptGuid,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreGuid,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{supplierGuid,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medplan.MedPlanDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="po_qty" property="poQty" jdbcType="DECIMAL" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="taxprice" property="taxprice" jdbcType="DECIMAL" />
<result column="taxsum" property="taxsum" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<sql id="Base_Column_List">id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum</sql>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
insert into med_hli_plan_detail (id,bill_no,row_no,goods_code,goods_name,goods_spec,manufacturer,po_qty,unit,taxprice,taxsum)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.poQty},
#{obj.unit},
#{obj.taxprice},
#{obj.taxsum}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medplan.MedPlan">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="bill_type" property="billType" jdbcType="VARCHAR" />
<result column="settle_type" property="settleType" jdbcType="VARCHAR" />
<result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
<result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
<result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medCode},
#{obj.medName},
#{obj.supplierCode},
#{obj.suppliername},
#{obj.billNo},
#{obj.billType},
#{obj.medDeptCode},
#{obj.medDeptName},
#{obj.medStoreCode},
#{obj.medStoreName},
#{obj.firstFlag},
#{obj.planBeginDate},
#{obj.planEndDate},
#{obj.memo},
#{obj.operaterName},
#{obj.inputDate},
#{obj.create_time},
#{obj.update_time}
</trim>
</foreach>
</insert>
<!-- 新增MedPlan-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{supplierCode,jdbcType=VARCHAR}
,#{suppliername,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{billType,jdbcType=VARCHAR}
,#{settleType,jdbcType=VARCHAR}
,#{medDeptCode,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreCode,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{firstFlag,jdbcType=VARCHAR}
,#{planBeginDate,jdbcType=TIMESTAMP}
,#{planEndDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{create_time,jdbcType=TIMESTAMP}
,#{update_time,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medstock.MedStockDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.medstock.MedStock">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
<result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
<result column="store_code" property="storeCode" jdbcType="VARCHAR" />
<result column="store_name" property="storeName" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medSuppliercode},
#{obj.medSuppliername},
#{obj.storeCode},
#{obj.storeName},
#{obj.goodsCode},
#{obj.goodsSpec},
#{obj.goodsName},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.stockQty},
#{obj.createTime},
#{obj.updateTime},
#{obj.medCode},
#{obj.medName},
</trim>
</foreach>
</insert>
<!-- 新增HisSpills-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.medstock.MedStock">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medSuppliercode,jdbcType=VARCHAR}
,#{medSuppliername,jdbcType=VARCHAR}
,#{storeCode,jdbcType=VARCHAR}
,#{storeName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=TIMESTAMP}
,#{goodsSpec,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{productionDate,jdbcType=VARCHAR}
,#{expireDate,jdbcType=DECIMAL}
,#{stockQty,jdbcType=DECIMAL}
,#{createTime,jdbcType=DECIMAL}
,#{updateTime,jdbcType=TIMESTAMP}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.spills.HisSpillsDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.spills.HisSpills">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_code" property="medCode" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="depot_code" property="depotCode" jdbcType="VARCHAR" />
<result column="depot_name" property="depotName" jdbcType="VARCHAR" />
<result column="tack_stockdate" property="tackStockDate" jdbcType="TIMESTAMP" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="number" property="number" jdbcType="DECIMAL" />
<result column="storck_num" property="storckNum" jdbcType="DECIMAL" />
<result column="difference_num" property="differenceNum" jdbcType="DECIMAL" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="tackstock_billno" property="tackStockBillNo" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medCode},
#{obj.medName},
#{obj.depotCode},
#{obj.depotName},
#{obj.tackStockDate},
#{obj.operaterName},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.lot},
#{obj.unit},
#{obj.number},
#{obj.storckNum},
#{obj.differenceNum},
#{obj.productionDate},
#{obj.expireDate},
#{obj.supplierCode},
#{obj.supplierName},
#{obj.tackStockBillNo},
#{obj.price}
</trim>
</foreach>
</insert>
<!-- 新增HisSpills-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.spills.HisSpills">
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)
values (
#{id,jdbcType=VARCHAR}
,#{medCode,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{depotCode,jdbcType=VARCHAR}
,#{depotName,jdbcType=VARCHAR}
,#{tackStockDate,jdbcType=TIMESTAMP}
,#{operaterName,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=VARCHAR}
,#{manufacturer,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{unit,jdbcType=VARCHAR}
,#{number,jdbcType=DECIMAL}
,#{storckNum,jdbcType=DECIMAL}
,#{differenceNum,jdbcType=DECIMAL}
,#{productionDate,jdbcType=TIMESTAMP}
,#{expireDate,jdbcType=TIMESTAMP}
,#{supplierCode,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{tackStockBillNo,jdbcType=VARCHAR}
,#{price,jdbcType=DECIMAL}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDetailDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.suoutstore.SuOutStoreDetail">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="row_no" property="rowNo" jdbcType="TINYINT" />
<result column="med_plan_no" property="medPlanNo" jdbcType="VARCHAR" />
<result column="med_plan_row_no" property="medPlanRowNo" jdbcType="TINYINT" />
<result column="goods_guid" property="goodsGuid" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit" property="unit" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="purchaser_price" property="purchaserPrice" jdbcType="DECIMAL" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="poqty" property="poqty" jdbcType="DECIMAL" />
<result column="arrivalqty" property="arrivalqty" jdbcType="DECIMAL" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入MedPlanDetail -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.billNo},
#{obj.rowNo},
#{obj.medPlanNo},
#{obj.medPlanRowNo},
#{obj.goodsGuid},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.unit},
#{obj.manufacturer},
#{obj.purchaserPrice},
#{obj.amount},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.poqty},
#{obj.arrivalqty},
#{obj.memo}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.suoutstore.SuOutStoreDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
<result column="med_guid" property="medGuid" jdbcType="VARCHAR" />
<result column="med_name" property="medName" jdbcType="VARCHAR" />
<result column="med_dept_guid" property="medDeptGuid" jdbcType="VARCHAR" />
<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
<result column="med_store_guid" property="medStoreGuid" jdbcType="VARCHAR" />
<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
<result column="supplier_guid" property="supplierGuid" jdbcType="VARCHAR" />
<result column="supplier_name" property="supplierName" jdbcType="VARCHAR" />
<result column="bill_date" property="billDate" jdbcType="TIMESTAMP" />
<result column="count_sum" property="countSum" jdbcType="TINYINT" />
<result column="detail_sum" property="detailSum" jdbcType="DECIMAL" />
<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!-- 新增MedPlan-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.suoutstore.SuOutStore">
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)
values (
#{id,jdbcType=VARCHAR}
,#{billNo,jdbcType=VARCHAR}
,#{medGuid,jdbcType=VARCHAR}
,#{medName,jdbcType=VARCHAR}
,#{medDeptGuid,jdbcType=VARCHAR}
,#{medDeptName,jdbcType=VARCHAR}
,#{medStoreGuid,jdbcType=VARCHAR}
,#{medStoreName,jdbcType=VARCHAR}
,#{supplierGuid,jdbcType=VARCHAR}
,#{supplierName,jdbcType=VARCHAR}
,#{billDate,jdbcType=TIMESTAMP}
,#{countSum,jdbcType=TINYINT}
,#{detailSum,jdbcType=DECIMAL}
,#{operaterName,jdbcType=VARCHAR}
,#{inputDate,jdbcType=TIMESTAMP}
,#{memo,jdbcType=VARCHAR}
,#{createTime,jdbcType=TIMESTAMP}
,#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.supplierstock.SupplierStockDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="supplier_code" property="suppliercode" jdbcType="VARCHAR" />
<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
<result column="lot" property="lot" jdbcType="VARCHAR" />
<result column="production_date" property="productionDate" jdbcType="TIMESTAMP" />
<result column="expire_date" property="expireDate" jdbcType="TIMESTAMP" />
<result column="stock_qty" property="stockQty" jdbcType="DECIMAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
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)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.suppliercode},
#{obj.suppliername},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.goodsSpec},
#{obj.manufacturer},
#{obj.lot},
#{obj.productionDate},
#{obj.expireDate},
#{obj.stockQty},
#{obj.createTime},
#{obj.updateTime}
</trim>
</foreach>
</insert>
<!-- 新增SupplierStock-->
<insert id="insert" parameterType="com.phxl.modules.goods.entity.supplierstock.SupplierStock">
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)
values (
#{id,jdbcType=VARCHAR}
,#{suppliercode,jdbcType=VARCHAR}
,#{suppliername,jdbcType=VARCHAR}
,#{goodsCode,jdbcType=VARCHAR}
,#{goodsName,jdbcType=VARCHAR}
,#{goodsSpec,jdbcType=TIMESTAMP}
,#{manufacturer,jdbcType=VARCHAR}
,#{lot,jdbcType=VARCHAR}
,#{productionDate,jdbcType=TIMESTAMP}
,#{expireDate,jdbcType=TIMESTAMP}
,#{stockQty,jdbcType=DECIMAL}
,#{createTime,jdbcType=TIMESTAMP}
,#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.supplygoods.MedSupplyGoodsDao">
<!--BaseResultMap -->
<resultMap id="BaseResultMap"
type="com.phxl.modules.goods.entity.supplygoods.MedSupplyGoods">
<id column="id" property="id" jdbcType="BIGINT" />
<result column="med_suppliercode" property="medSuppliercode" jdbcType="VARCHAR" />
<result column="med_suppliername" property="medSuppliername" jdbcType="VARCHAR" />
<result column="goods_code" property="goodsCode" jdbcType="VARCHAR" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="producer" property="producer" jdbcType="VARCHAR" />
<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR" />
<result column="unit_style" property="unitStyle" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="price" property="price" jdbcType="DECIMAL" />
</resultMap>
<!--Base_Column_List -->
<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>
<!--批量插入 -->
<insert id="batchInsert" parameterType="list">
insert into med_supply_catalog (id,med_suppliercode,med_suppliername,goods_code,goods_name,producer,goods_spec,unit_style,create_time,update_time,price)
values
<foreach collection ="list" item="obj" separator =",">
<trim prefix=" (" suffix=")" suffixOverrides=",">
#{obj.id},
#{obj.medSuppliercode},
#{obj.medSuppliername},
#{obj.goodsCode},
#{obj.goodsName},
#{obj.producer},
#{obj.goodsSpec},
#{obj.unitStyle},
#{obj.createTime},
#{obj.updateTime},
#{obj.price}
</trim>
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
</configuration>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
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
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<!-- 定时器开关 -->
<task:annotation-driven />
<bean id="weChat" class="com.phxl.modules.wechat.utils.WeChatUtils"></bean>
<task:scheduled-tasks>
<!--
每隔5秒执行一次:*/5 * * * * ?
每隔1分钟执行一次:0 */1 * * * ?
每天23点执行一次:0 0 23 * * ?
每天凌晨1点执行一次:0 0 1 * * ?
每天凌晨2点执行一次:0 0 2 * * ?
-->
<task:scheduled ref="weChat" method="getAccessToken" cron="0 */118 * * * ?" />
</task:scheduled-tasks>
<context:component-scan base-package="com.phxl.modules" />
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"
default-lazy-init="true">
<!-- 启用注解 -->
<context:component-scan base-package="com.phxl.modules" />
<!-- 引入属性文件 -->
<context:property-placeholder location="classpath:config.properties"/>
<!-- 配置数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!-- 配置sqlsessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations">
<list>
<value>classpath:/mappings/**/*.xml</value>
</list>
</property>
</bean>
<!-- 扫描Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.phxl.modules"/>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 缓存配置 -->
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManagerConfigFile" value="classpath:${ehcache.configFile}" />
</bean>
<!-- 启用注解事务 -->
<tx:annotation-driven/>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd">
<context:annotation-config />
<context:component-scan base-package="com.phxl.modules.goods.web.spd">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<util:properties id="config" location="classpath:config.properties"/>
</beans>
ALTER TABLE med_hli_plan ADD COLUMN settle_type VARCHAR(10) COMMENT '0:零库存 1:非零库存' AFTER bill_type;
\ No newline at end of file
ALTER TABLE med_bill_settlement ADD COLUMN use_bill_no LONGTEXT COMMENT '发药单号';
ALTER TABLE med_bill_settlement_detail DROP use_bill_no;
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<mvc:default-servlet-handler/>
<context:component-scan base-package="com.phxl.*" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!--设置最大上传文件501M-->
<property name="maxUploadSize" value="525336576"/>
<property name="resolveLazily" value="true"/>
</bean>
<!-- 处理JSON数据转换的 -->
<bean id="mappingJacksonHttpMessageConverter"
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
<value>text/xml;charset=UTF-8</value>
<value>application/xml;charset=UTF-8</value>
</list>
</property>
</bean>
<!-- SpringMVC在超出上传文件限制时,会抛出org.springframework.web.multipart.MaxUploadSizeExceededException -->
<!-- 该异常是SpringMVC在检查上传的文件信息时抛出来的,而且此时还没有进入到Controller方法中 -->
<!-- <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
遇到MaxUploadSizeExceededException异常时,自动跳转到/WEB-INF/jsp/error_fileupload.jsp页面
<prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">error</prop>
</props>
</property>
</bean> -->
</beans>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>送货单打印(普通A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}送货单</h3></td>
<td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
</tr>
<tr>
<td width="25%" height="30">供应商:${fOrgName}</td>
<td width="25%" height="30">订单号:${orderNo}</td>
<td width="25%" height="30">送货单号:${sendNo}</td>
<!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
</tr>
<tr>
<td height="30">制单人:${sendUsername}</td>
<td height="30" colspan="2">制单时间:${sendDate}</td>
</tr>
<tr>
<td height="30" >收货科室:${deptName}</td>
<td height="30" colspan="2">收货地址:${tfAddress}</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 25px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80;">有效期至</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="30%" align="left">验收人:</td>
<td width="30%" align="left">收货人:</td>
<td width="20%" align="left">总金额:${totalPrice}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>入库单打印(三联单)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}验收入库单</h3></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
<tr>
<td width="21%" height="15">供应商:${forgName}</td>
<td width="17%" height="15">入库日期:${inTime}</td>
<td width="26%" height="15">入库单号:${InNo}</td>
</tr>
<tr>
<td width="21%" height="15">发票号:${invoiceNo}</td>
<td width="17%" height="15">送货单号:${Send_Id}</td>
<td width="26%" height="15">单位:元</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 18px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20px;">
<td width="25%" align="left"></td>
<td width="25%" align="left"></td>
<td width="21%" align="left"></td>
<td width="28%" align="left">合计金额:${totalPrice}</td>
</tr>
<tr height="20px;">
<td width="25%" align="left">制单人:${userName}</td>
<td width="25%" align="left">会计:</td>
<td width="21%" align="left">审核人:</td>
<td width="28%" align="left">备注:</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>出库单打印(三联单)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:20px;">${rOrgName}物资出库单</h3></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 5px;">
<tr>
<td width="21%" height="15">领用科室:${deptName}</td>
<td width="17%" height="15">出库日期:${outTime}</td>
<td width="27%" height="15">出库单号:${outNo}</td>
</tr>
<tr>
<td width="21%" height="15">拣货单号:${pickNo}</td>
<td width="17%" height="15">送货单号:${sendNo}</td>
<td width="27%" height="15">单位:元</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="margin-top: 10px;border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 18px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="200">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="150">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="40">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">单价</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="90">金额</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20px;">
<td width="25%" align="left"></td>
<td width="25%" align="left"></td>
<td width="21%" align="left"></td>
<td width="28%" align="left">合计金额:${totalPrice}</td>
</tr>
<tr height="20px;">
<td width="25%" align="left">制单人:${userName}</td>
<td width="25%" align="left">会计:</td>
<td width="21%" align="left">保管:</td>
<td width="28%" align="left">经办人:</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>送货单打印(普通A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${rOrgName}${printDeliveryName}设备送货单</h3></td>
<td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
</tr>
<tr>
<td width="25%" height="30">供应商:${fOrgName}</td>
<td width="25%" height="30">送货单号:${sendNo}</td>
<!--<td width="25%" height="30">医疗机构:${rOrgName}</td> -->
</tr>
<tr>
<td height="30">制单人:${sendUserName}</td>
<td height="30" colspan="2">制单时间:${sendDate}</td>
</tr>
<tr>
<td height="30" >收货科室:${tDeptName}</td>
<td height="30" colspan="2">收货地址:${tfAddress}</td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 25px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单价</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="30%" align="left">验收人:</td>
<td width="30%" align="left">收货人:</td>
<td width="20%" align="left">总金额:${totalPrice}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>送货单打印(手术A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${fOrgName}医用耗材送货单</h3></td>
<td width="12%" height="30" rowspan="4" valign="top">${qrCode}</td>
</tr>
<tr>
<td width="25%" height="30">送货单号:${sendNo}</td>
<td width="25%" height="30">订单号:${orderNo}</td>
<td width="25%" height="30">医疗机构:${rOrgName}</td>
</tr>
<tr>
<td height="30" colspan="2">收货地址:${tfAddress}</td>
<td height="30" >期望到货时间:${expectDate}</td>
</tr>
<tr>
<td height="30">制单人:${sendUsername}</td>
<td height="30" colspan="2">制单时间:${sendDate}</td>
</tr>
<tr>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="30" colspan='4'><hr width='100%' color='#65a6be' /></td></tr>
<tr>
<td width="25%" height="30">就诊号:${treatmentNo}</td>
<td width="25%" height="30">患者姓名:${name}</td>
<td width="25%" height="30">性别:${gender}</td>
<td width="25%" height="30">年龄:${age}</td>
</tr>
<tr>
<td width="25%" height="30">手术名称:${operName}</td>
<td width="25%" height="30">手术日期:${operDate}</td>
<td width="25%" height="30">品牌:${tfBrand}</td>
<td width="25%" height="30">备注:${tfRemark}</td>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="20%" align="left">验收人:</td>
<td width="20%" align="left">收货人:</td>
<td width="15%" align="left">产品总数量:${materailAmount}</td>
<td width="15%" align="left">外来植入物总数量:${outerImpAmount}</td>
<td width="15%" align="left">灭菌总数量:${sterilizeAmount}</td>
<td width="15%" align="left">工具总数量:${toolAmount}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<title>二维码模板页面</title>
</head>
<body>
<div style="width: 265px;height: 130px; margin: 0px auto;">
<div style="text-align:center;font-size: 12px;font-family:宋体,SimSun;font-weight:900;"><span>
${title}
</span></div>
<div style="font-size: 9px;">
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:4px;">
<tr>
<td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">名称:</td>
<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>
<td style="text-align: center;" width="106" rowspan="6" >
${qrImage}
<div style="width:106px;"><span style="width:100%;font-size:10px;font-family:宋体,SimSun;font-weight:900;">${qrcode}</span></div>
</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">型号:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${fmodel}</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">规格:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${spec}</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">批号:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${flot}</td>
</tr>
<tr>
<td style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">效期:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${prodDate}-${usefulDate}</td>
</tr>
<tr>
<td valign="top" style="text-align:right;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="45" height="15px">注册证:</td>
<td style="border-bottom:0.1px solid #000000;font-size:10px;font-family:宋体,SimSun;font-weight:900;" width="116" height="15px">${registerNo}</td>
</tr>
</table>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<title>微信绑定页面</title>
</head>
<body>
<div style="width: 240px;">
<div style="height: 240px;width: 240px;">
${qrImage}
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>使用登记明细打印(普通A4)</title>
</head>
<body>
<div>
<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" colspan="3"><h3 style=" font-weight:bold;text-align:center;letter-spacing: 5px;font-size:24px;">${jgName}</h3></td>
<td width="12%" height="30" rowspan="4">${qrImage}</td>
</tr>
<tr>
<td width="25%" height="30">使用清单号:${useNo}</td>
<td width="25%" height="30">送货单号:${sendNo}</td>
<td width="25%" height="30">供应商:${fOrgName}</td>
<td></td>
</tr>
<tr>
<td width="25%" height="30">登记科室:${deptName}</td>
<td width="25%" height="30">登记人:${createUserName}</td>
<td width="25%" height="30">登记时间:${createTime}</td>
<td></td>
</tr>
<tr>
<td width="25%" height="30">就诊号:${treatmentNo}</td>
<td width="25%" height="30">患者姓名:${hzName}</td>
<td width="25%" height="30">手术名称:${operName}</td>
<td></td>
</tr>
<tr>
</tr>
</table>
</div>
<div>
<table style="border-collapse:collapse;border-spacing:0;font-size: 14px;">
<tr style="height: 25px;">
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;">序号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="190">产品名称</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="100">型号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">单位</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">包装规格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">价格</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="50">数量</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">金额</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产批号</td>
<td style="background: #eaeaea;text-align: center;border-left:1px solid #000000;border-top:1px solid #000000;" width="80">生产日期</td>
<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>
</tr>
${tableContent}
</table>
</div>
<div>
${afterTable
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr height="35px;">
<td width="30%" align="left">医生签字:</td>
<td width="20%" align="right">总金额:${zje}</td>
</tr>
</table>
}
</div>
</div>
</body>
</html>
\ No newline at end of file
<%-- <%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<script type="text/javascript" src="<%=basePath%>js/jquery.js" charset="utf-8"></script>
<style>
html,body{text-align:center;margin:0px auto;}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("#select").change(function(){
var value = $('#select option:selected') .val();
debugger;
if(value == '0'){
$("#form").attr('action','<%=basePath%>oss/uploadImage');
}else if(value == '1'){
$("#form").attr('action','<%=basePath%>oss/uploadHeadImage');
}else if(value == '2'){
$("#form").attr('action','<%=basePath%>oss/uploadAudio');
}else if(value == '3'){
$("#form").attr('action','<%=basePath%>oss/uploadVideo');
}
});
});
</script>
</head>
<body>
<div style="width:auto;height:20;margin-left:auto;margin-left:auto;">
${msg}
</div>
<form name="form" id="form" aligin="ceter" action="<%=basePath%>oss/uploadImage" enctype="multipart/form-data" method="post"">
<div id="newUpload2">
<select id="select">
<option value ="0">图片</option>
<option value ="1">头像</option>
<option value="2">音频</option>
<option value="3">视频</option>
</select>
<input type="file" name="fileUpload">
</div>
<input type="submit" value="上传" >
</form>
</body>
</html> --%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<script type="text/javascript" src="<%=basePath%>js/jquery.js"
charset="utf-8"></script>
<title>搜索词自动完成</title>
<style type="text/css">
#search {
text-align: center;
position: relative;
}
.autocomplete {
border: 1px solid #9ACCFB;
background-color: white;
text-align: left;
}
.autocomplete li {
list-style-type: none;
}
.clickable {
cursor: default;
}
.highlight {
background-color: #9ACCFB;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
sendxml();
});
function sendxml(){
var xmlData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><book><name>王森勇</name><author>tiger</author></book>";
var url = "<%=basePath%>bookInfo/sendxml";
$.ajax({
type: 'POST',
url: url ,
data: xmlData ,
dataType:"xml",
'success': function (data) {
alert(data);
} ,
'error': function (reslut) {
alert(reslut);
},
contentType:"application/xml"
});
}
$(function(){
//取得div层
var $search = $('#search');
//取得输入框JQuery对象
var $searchInput = $search.find('#search-text');
//关闭浏览器提供给输入框的自动完成
$searchInput.attr('autocomplete','off');
//创建自动完成的下拉列表,用于显示服务器返回的数据,插入在搜索按钮的后面,等显示的时候再调整位置
var $autocomplete = $('<div class="autocomplete"></div>').hide().insertAfter('#submit');
//清空下拉列表的内容并且隐藏下拉列表区
var clear = function(){
$autocomplete.empty().hide();
};
//注册事件,当输入框失去焦点的时候清空下拉列表并隐藏
$searchInput.blur(function(){
setTimeout(clear,500);
});
//下拉列表中高亮的项目的索引,当显示下拉列表项的时候,移动鼠标或者键盘的上下键就会移动高亮的项目,想百度搜索那样
var selectedItem = null;
//timeout的ID
var timeoutid = null;
//设置下拉项的高亮背景
var setSelectedItem = function(item){
//更新索引变量
selectedItem = item ;
//按上下键是循环显示的,小于0就置成最大的值,大于最大值就置成0
if(selectedItem < 0){
selectedItem = $autocomplete.find('li').length - 1;
}
else if(selectedItem > $autocomplete.find('li').length-1 ) {
selectedItem = 0;
}
//首先移除其他列表项的高亮背景,然后再高亮当前索引的背景
$autocomplete.find('li').removeClass('highlight')
.eq(selectedItem).addClass('highlight');
};
var ajax_request = function(){
//ajax服务端通信
$.ajax({
'url':'<%=basePath%>oss/datas', //服务器的地址
'data' : {
'search-text' : $searchInput.val()
}, //参数
'dataType' : 'json', //返回数据类型
'type' : 'POST', //请求类型
'success' : function(data) {
if (data.length) {
$autocomplete.empty();
//遍历data,添加到自动完成区
$.each(data, function(index, term) {
//创建li标签,添加到下拉列表中
$('<li></li>').text(term).appendTo($autocomplete)
.addClass('clickable').hover(
function() {
//下拉列表每一项的事件,鼠标移进去的操作
$(this).siblings().removeClass(
'highlight');
$(this).addClass('highlight');
selectedItem = index;
},
function() {
//下拉列表每一项的事件,鼠标离开的操作
$(this).removeClass('highlight');
//当鼠标离开时索引置-1,当作标记
selectedItem = -1;
}).click(function() {
//鼠标单击下拉列表的这一项的话,就将这一项的值添加到输入框中
$searchInput.val(term);
//清空并隐藏下拉列表
$autocomplete.empty().hide();
});
});//事件注册完毕
//设置下拉列表的位置,然后显示下拉列表
var ypos = $searchInput.position().top;
var xpos = $searchInput.position().left;
$autocomplete.css('width', );
$autocomplete.css({
'position' : 'relative',
'left' : xpos + "px",
'top' : ypos + "px"
});
setSelectedItem(0);
//显示下拉列表
$autocomplete.show();
}
}
});
};
//对输入框进行事件注册
$searchInput
.keyup(
function(event) {
//字母数字,退格,空格
if (event.keyCode > 40 || event.keyCode == 8
|| event.keyCode == 32) {
//首先删除下拉列表中的信息
$autocomplete.empty().hide();
clearTimeout(timeoutid);
timeoutid = setTimeout(ajax_request, 100);
} else if (event.keyCode == 38) {
//上
//selectedItem = -1 代表鼠标离开
if (selectedItem == -1) {
setSelectedItem($autocomplete.find('li').length - 1);
} else {
//索引减1
setSelectedItem(selectedItem - 1);
}
event.preventDefault();
} else if (event.keyCode == 40) {
//下
//selectedItem = -1 代表鼠标离开
if (selectedItem == -1) {
setSelectedItem(0);
} else {
//索引加1
setSelectedItem(selectedItem + 1);
}
event.preventDefault();
}
}).keypress(
function(event) {
//enter键
if (event.keyCode == 13) {
//列表为空或者鼠标离开导致当前没有索引值
if ($autocomplete.find('li').length == 0
|| selectedItem == -1) {
return;
}
$searchInput.val($autocomplete.find('li').eq(
selectedItem).text());
$autocomplete.empty().hide();
event.preventDefault();
}
}).keydown(function(event) {
//esc键
if (event.keyCode == 27) {
$autocomplete.empty().hide();
event.preventDefault();
}
});
//注册窗口大小改变的事件,重新调整下拉列表的位置
$(window).resize(function() {
var ypos = $searchInput.position().top;
var xpos = $searchInput.position().left;
$autocomplete.css('width', $searchInput.css('width'));
$autocomplete.css({
'position' : 'relative',
'left' : xpos+2 + "px",
'top' : ypos + "px"
});
});
});
function fileUpload() {
var fileName = $("#upfile").val();
if (fileName == null || fileName == "") {
alert("请选择文件");
} else {
debugger;
var fileType = fileName
.substr(fileName.length - 4, fileName.length);
if (fileType == ".xls" || fileType == "xlsx") {
var formData = new FormData();
formData.append("file", $("#upfile").prop("files")[0]);
$.ajax({
type : "post",
url : "<%=basePath%>exports/inLeadExcel",
data : formData,
cache : false,
processData : false,
contentType : false,
dataType : 'json', //返回数据类型
success : function(data) {
alert(data);
}
})
} else {
alert("导入文件类型错误!");
}
}
}
</script>
</head>
<body>
<div id="search">
<label for="search-text">请输入关键词</label><input type="text"
id="search-text" name="search-text" /> <input type="button"
id="submit" value="搜索" />
<a href="<%=basePath%>exports/printDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF" target="_blank"><button type="button" class="ant-btn ant-btn-primary"><span>打 印</span></button></a>
<a href="<%=basePath%>exports/exportDeliveryDetail?sendId=FBC29053A90C489EBA544C57C06F77CF"><button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;"><span>导 出</span></button></a>
<button type="button" class="ant-btn ant-btn-primary" style="margin-right: 8px;" onclick="$('#upfile').click();"><span>导 入</span></button>
<input type="file" class="file_input" id="upfile" onchange="fileUpload();" title=" " style="display:none">
</div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" >
<!-- 区分项目名称,防止默认重名 -->
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>maven.example.root</param-value>
</context-param>
<!-- 设置Spring容器加载配置文件路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring/app*.xml</param-value>
</context-param>
<!-- Spring的log4j监听器 -->
<!-- <listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>-->
<!-- spring监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring 刷新Introspector防止内存泄露 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring view分发器 -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/WEB-INF/views/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
// JavaScript Document
jQuery.extend({
createUploadIframe: function(id, uri)
{
//create frame
var frameId = 'jUploadFrame' + id;
if(window.ActiveXObject) {
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
if(typeof uri== 'boolean'){
io.src = 'javascript:false';
}
else if(typeof uri== 'string'){
io.src = uri;
}
}
else {
var io = document.createElement('iframe');
io.id = frameId;
io.name = frameId;
}
io.style.position = 'absolute';
io.style.top = '-1000px';
io.style.left = '-1000px';
document.body.appendChild(io);
return io;
},
createUploadForm: function(id, fileElementId)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = s.fileElementId;
var form = jQuery.createUploadForm(id, s.fileElementId);
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
if( s.global && ! jQuery.active++ )
{
// Watch for a new set of requests
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {};
if( s.global )
{
jQuery.event.trigger("ajaxSend", [xml, s]);
}
var uploadCallback = function(isTimeout)
{
// Wait for a response to come back
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if( xml || isTimeout == "timeout")
{
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if( status != "error" )
{
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData( xml, s.dataType );
if( s.success )
{
// ifa local callback was specified, fire it and pass it the data
s.success( data, status );
};
if( s.global )
{
// Fire the global callback
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
};
} else
{
jQuery.handleError(s, xml, status);
}
} catch(e)
{
status = "error";
jQuery.handleError(s, xml, status, e);
};
if( s.global )
{
// The request was completed
jQuery.event.trigger( "ajaxComplete", [xml, s] );
};
// Handle the global AJAX counter
if(s.global && ! --jQuery.active)
{
jQuery.event.trigger("ajaxStop");
};
if(s.complete)
{
s.complete(xml, status);
} ;
jQuery(io).unbind();
setTimeout(function()
{ try
{
jQuery(io).remove();
jQuery(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100);
xml = null;
};
}
// Timeout checker
if( s.timeout > 0 )
{
setTimeout(function(){
if( !requestDone )
{
// Check to see ifthe request is still happening
uploadCallback( "timeout" );
}
}, s.timeout);
}
try
{
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if(form.encoding)
{
form.encoding = 'multipart/form-data';
}
else
{
form.enctype = 'multipart/form-data';
}
jQuery(form).submit();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if(window.attachEvent){
document.getElementById(frameId).attachEvent('onload', uploadCallback);
}
else{
document.getElementById(frameId).addEventListener('load', uploadCallback, false);
}
return {abort: function () {}};
},
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || s, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
},
uploadHttpData: function( r, type ) {
var data = !type;
data = type == "xml" || data ? r.responseXML : r.responseText;
// ifthe type is "script", eval it in global context
if( type == "script" )
{
jQuery.globalEval( data );
}
// Get the JavaScript object, ifJSON is used.
if( type == "json" )
{
eval( "data = " + data );
}
// evaluate scripts within html
if( type == "html" )
{
jQuery("<div>").html(data).evalScripts();
}
return data;
}
});
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!