|
|
|
@ -8,10 +8,12 @@ import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.alibaba.fastjson2.TypeReference;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.glxp.mipsdl.client.CommonHttpClient;
|
|
|
|
|
import com.glxp.mipsdl.client.ctqyy.entity.InvResultEntity;
|
|
|
|
|
import com.glxp.mipsdl.config.ThirdSysConfig;
|
|
|
|
|
import com.glxp.mipsdl.constant.ConstantType;
|
|
|
|
|
import com.glxp.mipsdl.constant.Constants;
|
|
|
|
@ -47,10 +49,13 @@ import com.glxp.mipsdl.http.HttpClient;
|
|
|
|
|
import com.glxp.mipsdl.req.base.*;
|
|
|
|
|
import com.glxp.mipsdl.req.ctqyy.*;
|
|
|
|
|
import com.glxp.mipsdl.req.post.*;
|
|
|
|
|
import com.glxp.mipsdl.req.ptxhyy.PtxhyyInvRequest;
|
|
|
|
|
import com.glxp.mipsdl.req.zaxyy.ZaxzyyOrderRequest;
|
|
|
|
|
import com.glxp.mipsdl.req.zzzyy.ZzzyyRequest;
|
|
|
|
|
import com.glxp.mipsdl.res.BaseResponse;
|
|
|
|
|
import com.glxp.mipsdl.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.mipsdl.res.ctqyy.CtBaseResponse;
|
|
|
|
|
import com.glxp.mipsdl.res.ptxhyy.PtxhInvResponse;
|
|
|
|
|
import com.glxp.mipsdl.res.udiwms.*;
|
|
|
|
|
import com.glxp.mipsdl.service.auth.AuthWarehouseService;
|
|
|
|
|
import com.glxp.mipsdl.service.order.OrderUploadLogService;
|
|
|
|
@ -66,6 +71,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -709,6 +715,125 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取库存出入库明细
|
|
|
|
|
*
|
|
|
|
|
* @param udiwmsInvProductsRequest
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse getInvResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) {
|
|
|
|
|
CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest();
|
|
|
|
|
ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd"));
|
|
|
|
|
ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd"));
|
|
|
|
|
|
|
|
|
|
CtqyyRequest ctqyyRequest = new CtqyyRequest();
|
|
|
|
|
ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialUnit"));
|
|
|
|
|
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest));
|
|
|
|
|
|
|
|
|
|
// String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest);
|
|
|
|
|
String response = "{\"code\":20000,\"message\":\"success\",\"data\":{\"list\":[{\"applyNo\":\"74192\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"65\",\"CreditName\":\"急诊科\",\"AccoutDate\":\"2024-02-2210:36:28\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"77375\",\"materialName\":\"一次性注射器2ml\",\"materialSpec\":\"0.6\",\"materialUnit\":\"支\",\"batchNo\":65212,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":200,\"importPrc\":0.21,\"importMoney\":42,\"factoryCode\":\"0006064349\",\"factoryName\":\"河南曙光汇知康生物科技股份有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":64113,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":19,\"importPrc\":1.15,\"importMoney\":21.85,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":65526,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":81,\"importPrc\":1.15,\"importMoney\":93.15,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74209\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"92\",\"CreditName\":\"儿科\",\"AccoutDate\":\"2024-02-2315:31:58\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"30936\",\"materialName\":\"一次性静脉输液针5(1/2)\",\"materialSpec\":\"/条\",\"materialUnit\":\"条\",\"batchNo\":64898,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":250,\"importPrc\":0.17,\"importMoney\":42.5,\"factoryCode\":\"0006063565\",\"factoryName\":\"浙江康康\"}],\"total\":4}}";
|
|
|
|
|
|
|
|
|
|
BaseResponse<PageSimpleResponse<InvResultEntity>> baseResponse =
|
|
|
|
|
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<InvResultEntity>>>() {
|
|
|
|
|
});
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
List<InvResultEntity> ptxhInvResponses = baseResponse.getData().getList();
|
|
|
|
|
List<ThrInvResultResponse> thrInvResultResponses = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(ptxhInvResponses)) {
|
|
|
|
|
for (InvResultEntity ptxhInvResponse : ptxhInvResponses) {
|
|
|
|
|
ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse();
|
|
|
|
|
thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode());
|
|
|
|
|
thrInvResultResponse.setCpmctymc(ptxhInvResponse.getMaterialName());
|
|
|
|
|
thrInvResultResponse.setGgxh(ptxhInvResponse.getMaterialSpec());
|
|
|
|
|
thrInvResultResponse.setBatchNo(ptxhInvResponse.getBatchNo());
|
|
|
|
|
thrInvResultResponse.setMeasname(ptxhInvResponse.getMaterialUnit());
|
|
|
|
|
thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getImportPrc()));
|
|
|
|
|
thrInvResultResponse.setAmount(BigDecimal.valueOf(ptxhInvResponse.getImportMoney()));
|
|
|
|
|
// thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName());
|
|
|
|
|
// thrInvResultResponse.setDeptCode(ptxhInvResponse.getDebit());
|
|
|
|
|
// thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName());
|
|
|
|
|
// thrInvResultResponse.setInvCode(ptxhInvResponse.getCredit());
|
|
|
|
|
|
|
|
|
|
thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName());
|
|
|
|
|
thrInvResultResponse.setDeptCode("1002");
|
|
|
|
|
thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName());
|
|
|
|
|
thrInvResultResponse.setInvCode("1000003");
|
|
|
|
|
|
|
|
|
|
thrInvResultResponse.setManufacturer(ptxhInvResponse.getFactoryName());
|
|
|
|
|
thrInvResultResponse.setManufactoryCode(ptxhInvResponse.getFactoryCode());
|
|
|
|
|
thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT);
|
|
|
|
|
thrInvResultResponse.setBillType(ptxhInvResponse.getIoType());
|
|
|
|
|
thrInvResultResponse.setType("1");
|
|
|
|
|
thrInvResultResponse.setOutCount(ptxhInvResponse.getQuantity() + "");
|
|
|
|
|
thrInvResultResponse.setReCount(ptxhInvResponse.getQuantity() + "");
|
|
|
|
|
thrInvResultResponses.add(thrInvResultResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PageSimpleResponse<ThrInvResultResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l);
|
|
|
|
|
pageSimpleResponse.setList(thrInvResultResponses);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
return baseResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse getInvCodeResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) {
|
|
|
|
|
CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest();
|
|
|
|
|
ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd"));
|
|
|
|
|
ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd"));
|
|
|
|
|
|
|
|
|
|
CtqyyRequest ctqyyRequest = new CtqyyRequest();
|
|
|
|
|
ctqyyRequest.setMsgHeader(getMsgHeader("getSickHighitem"));
|
|
|
|
|
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest));
|
|
|
|
|
|
|
|
|
|
// String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest);
|
|
|
|
|
String response = "{\"code\":20000,\"message\":\"success\",\"data\":{\"list\":[{\"applyNo\":\"74192\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"65\",\"CreditName\":\"急诊科\",\"AccoutDate\":\"2024-02-2210:36:28\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"77375\",\"materialName\":\"一次性注射器2ml\",\"materialSpec\":\"0.6\",\"materialUnit\":\"支\",\"batchNo\":65212,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":200,\"importPrc\":0.21,\"importMoney\":42,\"factoryCode\":\"0006064349\",\"factoryName\":\"河南曙光汇知康生物科技股份有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":64113,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":19,\"importPrc\":1.15,\"importMoney\":21.85,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":65526,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":81,\"importPrc\":1.15,\"importMoney\":93.15,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74209\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"92\",\"CreditName\":\"儿科\",\"AccoutDate\":\"2024-02-2315:31:58\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"30936\",\"materialName\":\"一次性静脉输液针5(1/2)\",\"materialSpec\":\"/条\",\"materialUnit\":\"条\",\"batchNo\":64898,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":250,\"importPrc\":0.17,\"importMoney\":42.5,\"factoryCode\":\"0006063565\",\"factoryName\":\"浙江康康\"}],\"total\":4}}";
|
|
|
|
|
|
|
|
|
|
BaseResponse<PageSimpleResponse<InvResultEntity>> baseResponse =
|
|
|
|
|
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<InvResultEntity>>>() {
|
|
|
|
|
});
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
List<InvResultEntity> ptxhInvResponses = baseResponse.getData().getList();
|
|
|
|
|
List<ThrInvResultResponse> thrInvResultResponses = new ArrayList<>();
|
|
|
|
|
if (CollUtil.isNotEmpty(ptxhInvResponses)) {
|
|
|
|
|
for (InvResultEntity ptxhInvResponse : ptxhInvResponses) {
|
|
|
|
|
ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse();
|
|
|
|
|
thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode());
|
|
|
|
|
thrInvResultResponse.setCpmctymc(ptxhInvResponse.getMaterialName());
|
|
|
|
|
thrInvResultResponse.setGgxh(ptxhInvResponse.getMaterialSpec());
|
|
|
|
|
thrInvResultResponse.setBatchNo(ptxhInvResponse.getBatchNo());
|
|
|
|
|
thrInvResultResponse.setMeasname(ptxhInvResponse.getMaterialUnit());
|
|
|
|
|
thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getImportPrc()));
|
|
|
|
|
thrInvResultResponse.setAmount(BigDecimal.valueOf(ptxhInvResponse.getImportMoney()));
|
|
|
|
|
// thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName());
|
|
|
|
|
// thrInvResultResponse.setDeptCode(ptxhInvResponse.getDebit());
|
|
|
|
|
// thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName());
|
|
|
|
|
// thrInvResultResponse.setInvCode(ptxhInvResponse.getCredit());
|
|
|
|
|
|
|
|
|
|
thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName());
|
|
|
|
|
thrInvResultResponse.setDeptCode("1002");
|
|
|
|
|
thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName());
|
|
|
|
|
thrInvResultResponse.setInvCode("1000003");
|
|
|
|
|
|
|
|
|
|
thrInvResultResponse.setManufacturer(ptxhInvResponse.getFactoryName());
|
|
|
|
|
thrInvResultResponse.setManufactoryCode(ptxhInvResponse.getFactoryCode());
|
|
|
|
|
thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT);
|
|
|
|
|
thrInvResultResponse.setBillType(ptxhInvResponse.getIoType());
|
|
|
|
|
thrInvResultResponse.setType("1");
|
|
|
|
|
thrInvResultResponse.setOutCount(ptxhInvResponse.getQuantity() + "");
|
|
|
|
|
thrInvResultResponse.setReCount(ptxhInvResponse.getQuantity() + "");
|
|
|
|
|
thrInvResultResponses.add(thrInvResultResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PageSimpleResponse<ThrInvResultResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
|
pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l);
|
|
|
|
|
pageSimpleResponse.setList(thrInvResultResponses);
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
return baseResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse getInvProducts(UdiwmsInvProductsRequest udiwmsInvProductsRequest) {
|
|
|
|
|