8/8 药品管理

dev_unify
wangwei 8 months ago
parent 686a88991a
commit f2d7b3ab2d

@ -289,6 +289,48 @@ public class UdiRlSupController extends BaseController {
return ResultVOUtils.success("选入成功!");
}
@AuthRuleAnnotation("")
@PostMapping("/sale/info/drug/insertFilter")
@Log(title = "单据管理", businessType = BusinessType.INSERT)
public BaseResponse insertDrugFilter(@RequestBody UdiInfoExportRequest udiInfoExportRequest) {
CompanyEntity companyEntity = companyService.findCompany(udiInfoExportRequest.getCustomerId() + "");
if (companyEntity != null) {
if ("110".equals(companyEntity.getUnitIdFk())) {
udiInfoExportRequest.setUnitFk(null);
} else {
udiInfoExportRequest.setUnitFk(companyEntity.getUnitIdFk());
}
}
//查询本企业有没有选择该产品有选择不能选择
CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();
companyProductRelevanceRequest.setCustomerId(udiInfoExportRequest.getCustomerId() + "");
List<CompanyProductRelevanceResponse> basicInstrumentMaintainRelevanceResponses = null;
companyProductRelevanceRequest.setDiType(1);
companyProductRelevanceRequest.setProductType(2);
basicInstrumentMaintainRelevanceResponses = companyProductRelevanceService.filterUdiGp(companyProductRelevanceRequest);
String rlidStr = udiInfoExportRequest.getRlIds().get(0);
for (CompanyProductRelevanceResponse obj : basicInstrumentMaintainRelevanceResponses) {
String rlid = String.valueOf(obj.getRlId());
if (rlid.equals(rlidStr)) {
return ResultVOUtils.error(999, "该企业已选择该产品,请勿重复选择!");
}
}
companyProductsRelService.insertCompanyProducts(udiInfoExportRequest);
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setId(Long.parseLong(rlidStr));
udiRelevanceEntity.setLockStatus(1);
udiRelevanceEntity.setProductsType(2);
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
UdiProductEntity udiProductEntity = new UdiProductEntity();
udiProductEntity.setProductsType(2);
BeanUtil.copyProperties(udiInfoExportRequest.getSupplementRequest(), udiProductEntity);
//处理是否需要扫码字段
classifyCodeService.updateRequireScanCode(udiProductEntity);
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
udiProductService.insertUdiInfo(udiProductEntity);
return ResultVOUtils.success("选入成功!");
}
@AuthRuleAnnotation("")
@PostMapping("/sale/info/updateCompanyProductRelevance")
@Log(title = "单据管理", businessType = BusinessType.UPDATE)

@ -62,7 +62,6 @@ public class UdiSyncController {
nameCode = filterUdiRelRequest.getNameCode();
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setAddType(filterUdiRelRequest.getProductsType());
BeanUtil.copyProperties(filterUdiRelRequest, productInfoFilterRequest);
if (StrUtil.isNotEmpty(nameCode)) {
productInfoFilterRequest.setNameCode(nameCode);
@ -103,6 +102,61 @@ public class UdiSyncController {
}
}
@AuthRuleAnnotation("")
@GetMapping("udiwms/drugs/filter")
public BaseResponse getDurgs(FilterUdiRelRequest filterUdiRelRequest) {
String nameCode;
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUdiCode())) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiRelRequest.getUdiCode());
if (udiEntity != null) {
nameCode = udiEntity.getUdi();
} else {
return ResultVOUtils.error(500, "无效UDI码");
}
} else
nameCode = filterUdiRelRequest.getNameCode();
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
BeanUtil.copyProperties(filterUdiRelRequest, productInfoFilterRequest);
if (StrUtil.isNotEmpty(nameCode)) {
productInfoFilterRequest.setNameCode(nameCode);
} else {
productInfoFilterRequest.setDiType("1");
}
try {
BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.getDrugs(productInfoFilterRequest);
if (udiDlDeviceResponse.getCode() == 20000) {
if (filterUdiRelRequest.getIsCheck() != null && filterUdiRelRequest.getIsCheck()) {
List<ProductInfoEntity> productInfoEntities = udiDlDeviceResponse.getData().getList();
if (productInfoEntities != null && productInfoEntities.size() > 0) {
for (ProductInfoEntity productInfoEntity : productInfoEntities) {
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(productInfoEntity.getUuid());
if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 0) {
for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) {
if (udiRelevanceEntity.getThirdId() == null &&
udiRelevanceEntity.getThirdId2() == null && udiRelevanceEntity.getThirdId1() == null &&
udiRelevanceEntity.getThirdId3() == null && udiRelevanceEntity.getThirdId4() == null) {
//不能添加
productInfoEntity.setCheck(true);
break;
} else
productInfoEntity.setCheck(false);
}
} else {
productInfoEntity.setCheck(false);
}
}
}
}
}
return udiDlDeviceResponse;
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResultVOUtils.error(500, "连接UDI数据下载服务出错");
}
}
//获取同步库医疗器械注册人信息
@AuthRuleAnnotation("")

@ -273,10 +273,12 @@ public class IoOrderController extends BaseController {
orderEntity.setDeptCode(addOrderRequest.getDeptCode());
orderEntity.setBillNo(addOrderRequest.getBillNo());
orderEntity.setInvCode(addOrderRequest.getInvCode());
orderEntity.setProductType(addOrderRequest.getProductType());
if (addOrderRequest.getProductType() == null){
orderEntity.setProductType(1);
}else {
orderEntity.setProductType(addOrderRequest.getProductType());
}
orderService.updateByBillNo(orderEntity);
IoCodeTempEntity warehouseEntity = new IoCodeTempEntity();
warehouseEntity.setOrderId(orderEntity.getBillNo());
warehouseEntity.setAction(orderEntity.getAction());
@ -621,11 +623,14 @@ public class IoOrderController extends BaseController {
* @return
*/
@GetMapping("udiwms/inout/order/filterOrderTrace")
public BaseResponse filterOrderTrace(String billNo) {
public BaseResponse filterOrderTrace(String billNo,Integer productType) {
if (StrUtil.isBlank(billNo)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
List<IoOrderEntity> list = orderService.filterOrderTrace(billNo);
if (productType == null){
productType = 1;
}
List<IoOrderEntity> list = orderService.filterOrderTrace(billNo,productType);
List<IoOrderResponse> responses = orderService.findResponse(list);
return ResultVOUtils.success(responses);
}

@ -334,7 +334,7 @@ public class PurOrderController {
}
/**
/**pageSimpleResponse
*
*/
@PostMapping("/purchase/order/addPlanDetailAndOrder")

@ -499,6 +499,15 @@ public class BasicProductsEntity {
private Integer medicareType;
@TableField(value = "pinyinInitial")
private String pinyinInitial;
@TableField(value = "majorStatus")
private String majorStatus;
public static final String COL_ID = "id";

@ -274,4 +274,5 @@ public class AddProductRequest {
*
*/
private String payFeeCode;
private String packUnit;
}

@ -68,4 +68,12 @@ public class SupplementRequest {
private String flbm;
private String requireScanCode;
//药品新增数据
private String prepnUnit;
private String prepnSpec;
private String ggxh;
}

@ -122,6 +122,13 @@ public class UdiInfoRequest {
private String catalogcode;
//药品数据
private String prepnSpec;
private String prepnUnit;
private String bzgg;
public void setCheck(Boolean check) {
isCheck = check;
}

@ -72,5 +72,5 @@ public class FilterCodeRequest extends ListPageRequest {
*
*/
private Integer productType = 1;//默认是器械
}

@ -32,5 +32,5 @@ public class FilterOrderDetailBizRequest extends ListPageRequest {
private Long bizIdFk;
private Integer productType = 1;
}

@ -42,6 +42,6 @@ public class FilterOrderDetailCodeRequest extends ListPageRequest {
private Long bizIdFk;
private Integer productType = 1;//默认器械
}

@ -39,7 +39,7 @@ public class PurOrderDetailRequest extends ListPageRequest {
*/
private String supId;
private Integer productType = 1;//默认器械
}

@ -53,5 +53,9 @@ public class FilterThrProductsRequest extends ListPageRequest {
private String internalMaterialCode;
/**
*
*/
private Integer productType = 1;
}

@ -166,6 +166,7 @@ public class UdiRlSupResponse {
private Integer distributeLevelCount;
private String useLevelDi;
private String useLevelUnit;
private String packUnit;
private Integer useLeverCount;

@ -105,6 +105,84 @@ public class SyncUdiService {
}
public BaseResponse getDrugs(ProductInfoFilterRequest productInfoFilterRequest) {
//过滤--1.参数不能全未空
if ((productInfoFilterRequest.getYlqxzcrbarmc() == null || productInfoFilterRequest.getYlqxzcrbarmc().equals("")) &&
(productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals("")) &&
(productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals("")) &&
(productInfoFilterRequest.getGgxh() == null || productInfoFilterRequest.getGgxh().equals("")) &&
(productInfoFilterRequest.getUuid() == null || productInfoFilterRequest.getUuid().equals("")) &&
(productInfoFilterRequest.getZczbhhzbapzbh() == null || productInfoFilterRequest.getZczbhhzbapzbh().equals("")) &&
(productInfoFilterRequest.getDeviceRecordKey() == null || productInfoFilterRequest.getDeviceRecordKey().equals(""))
) {
return ResultVOUtils.error(500, "查询条件不能为空!");
}
if (StrUtil.isEmpty(productInfoFilterRequest.getYlqxzcrbarmc()) &&
StrUtil.isEmpty(productInfoFilterRequest.getCpmctymc())
&& StrUtil.isEmpty(productInfoFilterRequest.getNameCode())
&& StrUtil.isEmpty(productInfoFilterRequest.getGgxh())
&& StrUtil.isEmpty(productInfoFilterRequest.getUuid())
&& StrUtil.isEmpty(productInfoFilterRequest.getZczbhhzbapzbh())) {
if (productInfoFilterRequest.getNameCode() != null && !productInfoFilterRequest.getNameCode().equals("") && productInfoFilterRequest.getNameCode().length() < 10) {
return ResultVOUtils.error(500, "请输入完整的最小销售单元标识!");
}
}
// if (StrUtil.isEmpty(productInfoFilterRequest.getYlqxzcrbarmc()) && StrUtil.isEmpty(productInfoFilterRequest.getNameCode())) {
// if (StrUtil.isNotEmpty(productInfoFilterRequest.getCpmctymc())) {
// return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
// }
// if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) {
// return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
// }
// if (productInfoFilterRequest.getZczbhhzbapzbh() != null && !productInfoFilterRequest.getZczbhhzbapzbh().equals("")) {
// return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
// }
// }
// if ((productInfoFilterRequest.getYlqxzcrbarmc() == null || productInfoFilterRequest.getYlqxzcrbarmc().equals(""))
// && (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals(""))
// && (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals(""))
//
// ) {
// if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) {
// return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
// }
// if (productInfoFilterRequest.getZczbhhzbapzbh() != null && !productInfoFilterRequest.getZczbhhzbapzbh().equals("")) {
// return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称");
// }
// }
if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) {
return ResultVOUtils.error(500, "请输入完整的产品通用名称!");
}
productInfoFilterRequest.setIsNewest(1);
// productInfoFilterRequest.setDiType("1");
String keyCache = productInfoFilterRequest.toCacheKey();
if (StrUtil.isEmpty(keyCache)) {
return ResultVOUtils.error(500, "查询条件不能为空!");
}
String totalStr = (String) redisUtil.get(keyCache);
long total = 0;
if (StrUtil.isEmpty(totalStr)) {
total = productInfoService.filterUdiNoPageCount(productInfoFilterRequest);
redisUtil.set(keyCache, total + "");
} else {
total = Long.parseLong(totalStr);
}
List<ProductInfoEntity> productInfoEntityList = productInfoService.filterUdiNoPage(productInfoFilterRequest);
PageSimpleResponse<ProductInfoEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(total);
pageSimpleResponse.setList(productInfoEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
public BaseResponse filterCompany(@Valid UdiCompanyRequest udiCompanyRequest) {

@ -249,6 +249,7 @@ public class UdiProductServiceImpl implements UdiProductService {
udiProductEntity.setGgxh(addProductRequest.getSpec());
udiProductEntity.setPrice(addProductRequest.getPrice() == null ? "0" : addProductRequest.getPrice().toString());
udiProductEntity.setZczbhhzbapzbh(addProductRequest.getRegisterNo());
udiProductEntity.setUpdateTime(new Date());
if (IntUtil.value(udiProductEntity.getPackLevel()) == 1) {
udiProductEntity.setDiType(1);
}
@ -262,6 +263,7 @@ public class UdiProductServiceImpl implements UdiProductService {
udiRelevanceEntity.setDistributeLevelUnit(addProductRequest.getDistributeLevelUnit());
udiRelevanceEntity.setDistributeLevelCount(addProductRequest.getDistributeLevelCount());
udiRelevanceEntity.setPayFeeCode(addProductRequest.getPayFeeCode());
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceDao.updateById(udiRelevanceEntity);
}
@ -285,7 +287,12 @@ public class UdiProductServiceImpl implements UdiProductService {
throw new JsonException(500, "层级编码已存在!");
}
UdiProductEntity udiProductEntity = new UdiProductEntity();
BeanUtils.copyProperties(updateLevelDrugRequest, udiProductEntity);
// BeanUtils.copyProperties(updateLevelDrugRequest, udiProductEntity);
BeanUtils.copyProperties(addProductRequest, udiProductEntity);
udiProductEntity.setNameCode(updateLevelDrugRequest.getNameCode());
udiProductEntity.setBhxjsl(updateLevelDrugRequest.getBhxjsl());
udiProductEntity.setPackUnit(updateLevelDrugRequest.getPackUnit());
udiProductEntity.setSjcpbm(updateLevelDrugRequest.getSjcpbm());
udiProductEntity.setCpmctymc(addProductRequest.getCpmctymc());
udiProductEntity.setUuid(udiRelevanceEntity.getUuid());
udiProductEntity.setProductsType(2);

@ -92,7 +92,7 @@ public interface IoOrderService {
* @param billNo
* @return
*/
List<IoOrderEntity> filterOrderTrace(String billNo);
List<IoOrderEntity> filterOrderTrace(String billNo,Integer productType);
/**
* VO

@ -742,8 +742,8 @@ public class IoOrderServiceImpl implements IoOrderService {
}
@Override
public List<IoOrderEntity> filterOrderTrace(String billNo) {
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", billNo));
public List<IoOrderEntity> filterOrderTrace(String billNo,Integer productType) {
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().eq("billNo", billNo).eq("productType",productType));
if (null == order) {
return Collections.emptyList();
}

@ -855,7 +855,6 @@ public class SpsSyncDownloadService {
* @return
*/
protected boolean generateDeviceInfoFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) {
log.error("基础设备信息 info 的很多很好的活动和");
BasicExportTypeEnum exportType = BasicExportTypeEnum.DEVICE_INFO_DATA;
//文件数据
Map<String, Object> jsonMap = new WeakHashMap<>(4);

@ -316,9 +316,6 @@
<if test="addType != null and addType != ''">
AND addType = #{addType}
</if>
<if test="diType != '' and diType != null">
AND diType = #{diType}
</if>
</where>
limit #{page},#{limit}
</select>

@ -532,6 +532,45 @@
<if test="bzgg != null">
bzgg=#{bzgg},
</if>
<if test="levelUnit != null">
levelUnit=#{levelUnit},
</if>
<if test="prepnUnit != null">
prepnUnit=#{prepnUnit},
</if>
<if test="prepnSpec != null">
prepnSpec=#{prepnSpec},
</if>
<if test="specialCode != null">
specialCode=#{specialCode},
</if>
<if test="storageCondition != null">
storageCondition=#{storageCondition},
</if>
<if test="transportCondition != null">
transportCondition=#{transportCondition},
</if>
<if test="indate != null">
indate=#{indate},
</if>
<if test="useAttribute != null">
useAttribute=#{useAttribute},
</if>
<if test="majorType != null">
majorType=#{majorType},
</if>
<if test="majorStatus != null">
majorStatus=#{majorStatus},
</if>
<if test="physicType != null">
physicType=#{physicType},
</if>
<if test="medicareType != null">
medicareType=#{medicareType},
</if>
<if test="packMatrial != null">
packMatrial=#{packMatrial},
</if>
</trim>
WHERE nameCode = #{nameCode}
and uuid = #{uuid}
@ -1220,6 +1259,18 @@
<if test="matrial != null">
matrial=#{matrial},
</if>
<if test="prepnSpec != null">
prepnSpec=#{prepnSpec},
</if>
<if test="prepnUnit != null">
prepnUnit=#{prepnUnit},
</if>
<if test="bzgg != null">
bzgg=#{bzgg},
</if>
<if test="price != null">
price=#{price},
</if>
</trim>
WHERE uuid = #{uuid}
</update>

@ -68,9 +68,6 @@
<if test="code != null and code != ''">
AND ic.code = #{code}
</if>
<if test="productType != null and productType != ''">
AND bp.productsType = #{productType}
</if>
<if test="orderId != null and orderId != ''">
AND ic.orderId like concat('%', #{orderId}, '%')
</if>

@ -2,7 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.inout.IoOrderDetailBizDao">
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderDetailBizResponse">
select io_order_detail_biz.*
select io_order_detail_biz.*,
bp.packUnit,
bp.prepnSpec,
bp.prepnUnit,
bp.bzgg
from io_order_detail_biz
left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
@ -10,9 +14,6 @@
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
<if test="productType != null">
AND bp.productsType = #{productType}
</if>
<if test="relId != null">
AND bindRlFk = #{relId}
</if>

@ -11,9 +11,6 @@
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
<if test="productType != null">
AND bp.productsType = #{productType}
</if>
<if test="relIdFk != null and relIdFk != ''">
AND bindRlFk = #{relIdFk}
</if>

@ -91,9 +91,6 @@
<if test="productId != null">
AND productId = #{productId}
</if>
<if test="productType != null">
AND basic_products.productsType = #{productType}
</if>
<if test="supId != '' and supId != null">
AND supId = #{supId}
</if>

@ -185,6 +185,9 @@
FROM thr_products_add_di tdi
left join basic_corp bc on tdi.customerId = bc.erpId
<where>
<if test="productType != null">
AND tdi.productType = #{productType}
</if>
<if test="checkStatus != null">
AND tdi.status = #{checkStatus}
</if>

@ -952,3 +952,8 @@ CALL Pro_Temp_ColumnWork('io_order', 'productType',
' tinyint NULL DEFAULT NULL COMMENT ''产品类型(1.耗材2.药品)''',
1);
CALL Pro_Temp_ColumnWork('thr_products_add_di', 'isStack', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('thr_products_add_di', 'productType',
' tinyint NULL DEFAULT b''1'' COMMENT ''产品类型 1:耗材 2:药品''',
1);
CALL Pro_Temp_ColumnWork('basic_products', 'pinyinInitial', 'varchar(255)', 1);

Loading…
Cancel
Save