feat: 0702-扫码校验功能

dev_ksck_axxyy
chenhc 1 year ago
parent fdfa933336
commit a13a3b9fab

@ -440,6 +440,17 @@ public class IoCodeTempController extends BaseController {
return ResultVOUtils.error(500, "单据只允许录入普通耗材" + ",请检查后重试!");
}
}
//是否开启校验扫码 0:不校验1:只允许录入扫码产品2:只允许录入不扫码产品
if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 1)){
if (IntUtil.value(udiInfoEntity.getRequireScanCode()) != 1) {
return ResultVOUtils.error(500, "单据只允许录入需要扫码产品" + ",请检查后重试!");
}
}else if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 2)) {
if (IntUtil.value(udiInfoEntity.getHcType()) != 0) {
return ResultVOUtils.error(500, "单据只允许录入不需要扫码产品" + ",请检查后重试!");
}
}
}
String orderId = addOrderRequest.getBillNo();

@ -212,6 +212,17 @@ public class IoOrderDetailBizController extends BaseController {
return ResultVOUtils.error(500, "单据只允许录入普通耗材" + ",请检查后重试!");
}
}
//是否开启校验扫码 0:不校验1:只允许录入扫码产品2:只允许录入不扫码产品
if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 1)){
if (IntUtil.value(udiRelevanceResponse.getRequireScanCode()) != 1) {
return ResultVOUtils.error(500, "单据只允许录入需要扫码产品" + ",请检查后重试!");
}
}else if (IntUtil.value(bussinessTypeEntity.getCodeCheck() == 2)) {
if (IntUtil.value(udiRelevanceResponse.getHcType()) != 0) {
return ResultVOUtils.error(500, "单据只允许录入不需要扫码产品" + ",请检查后重试!");
}
}
}
if (IntUtil.value(bussinessTypeEntity.getCheckCertExpire()) == 2 && udiRelevanceResponse.isNeedCert()) {

@ -4,6 +4,7 @@ package com.glxp.api.controller.thrsys;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageInfo;
@ -33,6 +34,7 @@ import com.glxp.api.res.thrsys.UdiInfoResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.*;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.service.thrsys.ThrSystemService;
import com.glxp.api.service.thrsys.impl.ThrProductsAddDiService;
@ -53,6 +55,7 @@ import java.io.File;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* DI
@ -85,6 +88,8 @@ public class ThrProductsAddDiController {
CustomerService customerService;
@Resource
GennerOrderUtils gennerOrderUtils;
@Resource
SystemParamConfigService systemParamConfigService;
/**
* DI
@ -187,6 +192,90 @@ public class ThrProductsAddDiController {
//审核通过
//第三方产品审核通过
if (thrProductsAddDiEntity.getType() == 2) {
//是否开启内部物资编码
String internalMaterialCode = systemParamConfigService.selectValueByParamKey("internal_material_code");
if (IntUtil.value(internalMaterialCode) > 0) {
Long udiRelIdFk = gennerOrderUtils.getRelId();
//字段更新
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
//更新产品信息
UdiProductEntity udiProductEntity = new UdiProductEntity();
BeanUtil.copyProperties(thrProductsAddDiEntity,udiProductEntity);
udiProductEntity.setUuid(thrProductsAddDiEntity.getUuid());
udiProductEntity.setCpmctymc(thrProductsAddDiEntity.getName());
udiProductEntity.setNameCode(thrProductsAddDiEntity.getCode());
udiProductEntity.setSpmc(thrProductsAddDiEntity.getName());
udiProductEntity.setGgxh(thrProductsAddDiEntity.getSpec());
udiProductEntity.setSptm(thrProductsAddDiEntity.getSptm());
udiProductEntity.setZczbhhzbapzbh(thrProductsAddDiEntity.getRegisterNo());
udiProductEntity.setYlqxzcrbarmc(thrProductsAddDiEntity.getManufactory());
udiProductEntity.setYbbm(thrProductsAddDiEntity.getYbbm());
udiProductEntity.setMeasname(thrProductsAddDiEntity.getMeasname());
udiProductEntity.setManufactory(thrProductsAddDiEntity.getManufactory());
udiProductEntity.setSpmc(thrProductsAddDiEntity.getSpmc());
udiProductEntity.setCpms(thrProductsAddDiEntity.getCpms());
udiProductEntity.setPrice(thrProductsAddDiEntity.getPrice());
udiProductEntity.setBasicPrductRemak1(thrProductsAddDiEntity.getBasicPrductRemak1());
udiProductEntity.setBasicPrductRemak2(thrProductsAddDiEntity.getBasicPrductRemak2());
udiProductEntity.setBasicPrductRemak3(thrProductsAddDiEntity.getBasicPrductRemak3());
udiProductEntity.setBasicPrductRemak4(thrProductsAddDiEntity.getBasicPrductRemak4());
udiProductEntity.setBasicPrductRemak5(thrProductsAddDiEntity.getBasicPrductRemak5());
udiProductEntity.setBasicPrductRemak6(thrProductsAddDiEntity.getBasicPrductRemak6());
udiProductEntity.setBasicPrductRemak7(thrProductsAddDiEntity.getBasicPrductRemak7());
udiProductEntity.setBasicPrductRemak8(thrProductsAddDiEntity.getBasicPrductRemak8());
udiProductEntity.setGroupBuy(thrProductsAddDiEntity.getGroupBuy());
udiProductEntity.setCatalogname1(thrProductsAddDiEntity.getCatalogname1());
udiProductEntity.setCatalogname2(thrProductsAddDiEntity.getCatalogname2());
udiProductEntity.setCatalogname3(thrProductsAddDiEntity.getCatalogname3());
udiProductEntity.setMatrial(thrProductsAddDiEntity.getMatrial());
udiProductEntity.setDiType(1);
BeanUtil.copyProperties(udiProductEntity,udiRelevanceEntity);
udiRelevanceEntity.setGroupBuy(thrProductsAddDiEntity.getGroupBuy());
udiRelevanceEntity.setPurType(thrProductsAddDiEntity.getPurType());
udiRelevanceEntity.setAttributeType(thrProductsAddDiEntity.getAttributeType());
udiRelevanceEntity.setHcType(thrProductsAddDiEntity.getHcType());
udiRelevanceEntity.setId(udiRelIdFk);
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceEntity.setThirdId(udiProductEntity.getCode());
udiRelevanceEntity.setMainId(udiProductEntity.getCode());
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceEntity.setUuid(udiProductEntity.getUuid());
udiRelevanceEntity.setSupName(thrProductsAddDiEntity.getSupName());
udiRelevanceEntity.setIsDisable(false);
udiProductEntity.setNameCode(null);
udiProductService.insertUdiInfo(udiProductEntity);
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity);
//回填关联关系到关联表
CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
companyProductRelevanceEntity.setCustomerId(thrProductsAddDiEntity.getCustomerId() + "");
companyProductRelevanceEntity.setUdiRlIdFk(udiRelIdFk);
companyProductRelevanceEntity.setCreateTime(new Date());
companyProductRelevanceEntity.setUpdateTime(new Date());
companyProductRelevanceEntity.setUnitFk(thrProductsAddDiEntity.getCustomerId().toString());
companyProductRelevanceEntity.setAuditStatus("1");
if (StrUtil.isNotEmpty(thrProductsAddDiEntity.getPrice()))
companyProductRelevanceEntity.setPrice(new BigDecimal(thrProductsAddDiEntity.getPrice()));
companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
if (StrUtil.isNotEmpty(thrProductsAddDiEntity.getSelectThridSysStr())) {
List<String> thirdSysList = JSONUtil.toList(thrProductsAddDiEntity.getSelectThridSysStr(), String.class);
if (thirdSysList.size() > 0) {
for (String thirdSys : thirdSysList) {
BasicNewUploadDiEntity newUploadDiEntity = new BasicNewUploadDiEntity();
newUploadDiEntity.setRelId(udiRelIdFk + "");
newUploadDiEntity.setUpdateTime(new Date());
newUploadDiEntity.setUploadStatus(0);
newUploadDiEntity.setThirdSysFk(thirdSys);
basicNewUploadDiService.insertNewUploadDi(newUploadDiEntity);
}
}
}
thrProductsAddDiEntity.setRemark(remark);
thrProductsAddDiEntity.setStatus(status);
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);
}else {
// ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
// BeanUtil.copyProperties(thrProductsAddDiEntity, thrProductsEntity);
// thrProductsService.insertThrProducts(thrProductsEntity);
@ -194,9 +283,10 @@ public class ThrProductsAddDiController {
ThrSystemEntity basicThirdSysEntity = thrSystemService.selectMainThrSys();
if (basicThirdSysEntity.getThirdId().equals(thrProductsAddDiEntity.getThirdSysFk()))
if (!udiContrastService.isExit(null, thrProductsAddDiEntity.getCode(), null)) {
udiContrastService.createOnlyApply(thrProductsAddDiEntity);
thrProductsAddDiEntity.setStatus(4);
thrProductsAddDiService.updateById(thrProductsAddDiEntity);
udiContrastService.createOnlyApply(thrProductsAddDiEntity);
thrProductsAddDiEntity.setStatus(4);
thrProductsAddDiService.updateById(thrProductsAddDiEntity);
}
}
} else { //选入DI信息审核通过
//审核通过后追加到耗材字典中
@ -361,6 +451,32 @@ public class ThrProductsAddDiController {
return ResultVOUtils.success();
}
/**
*
*
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/udiwms/thrsys/addThrAddProductsNew")
@Log(title = "第三方产品信息", businessType = BusinessType.INSERT)
public BaseResponse addThrAddProductsNew(@RequestBody ThrProductsAddDiEntity thrProductsAdddiEntity) {
if (null == thrProductsAdddiEntity)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
String customerId = getCustomerId() + "";
String internalMaterialCode = thrProductsAddDiService.getInternalMaterialCode("10","66");
thrProductsAdddiEntity.setInternalMaterialCode(internalMaterialCode);
thrProductsAdddiEntity.setCode(internalMaterialCode);
thrProductsAdddiEntity.setThirdSysFk("thirdId");
thrProductsAdddiEntity.setUuid(CustomUtil.getUUId());
thrProductsAdddiEntity.setCreateTime(new Date());
thrProductsAdddiEntity.setStatus(1); //未审核
thrProductsAdddiEntity.setType(2);
thrProductsAdddiEntity.setCustomerId(Long.parseLong(customerId));
thrProductsAddDiService.insertThrProducts(thrProductsAdddiEntity);
return ResultVOUtils.success();
}
/**
* DI

@ -46,4 +46,6 @@ public interface ThrProductsAddDiDao extends BaseMapperPlus<ThrProductsAddDiDao,
List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsAddDiEntity> filterThrProductsDiLists(FilterThrProductsRequest filterThrProductsRequest);
String getInternalMaterialCode(@Param("prefix")String prefix);
}

@ -35,4 +35,6 @@ public interface ThrProductsDao extends BaseMapperPlus<ThrProductsDao, ThrProduc
int insertOrUpdateEntity(ThrProductsEntity record);
ThrProductsEntity filterThrProductsByMainId(@Param("relId") String relId);
String getInternalMaterialCode(@Param("prefix")String prefix);
}

@ -461,4 +461,10 @@ public class BasicBussinessTypeEntity {
private Integer vailHcType;
/**
* 0:1:2:
*/
@TableField(value = "codeCheck")
private Integer codeCheck;
}

@ -393,4 +393,17 @@ public class ThrProductsAddDiEntity {
@TableField(value = "catalogCode3")
@ApiModelProperty(value = "三级分类名称(部位、功能、品种)")
private Integer catalogCode3;
/**
* 10
*/
@TableField(value = "sourceType")
@ApiModelProperty(value = "来源类型 1新增0选入")
private Integer sourceType;
/**
*
*/
@TableField(value = "internalMaterialCode")
@ApiModelProperty(value = "'内部物资编码'")
private String internalMaterialCode;
}

@ -315,4 +315,12 @@ public class BussinessTypeSaveRequest {
* 0:1:2:
*/
private Integer vailHcType;
/**
* 0:1:2:
*/
@TableField(value = "codeCheck")
private Integer codeCheck;
}

@ -45,6 +45,7 @@ public class FilterUdiRelRequest extends ListPageRequest {
private String customerId;
private String udplatCode;
private String mainId;
private String mainIdLike;
private Boolean isAdavence;
/**
* 1:23

@ -1,37 +1,62 @@
package com.glxp.api.req.thrsys;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AddThrDiProductsExcelVo {
@ExcelProperty("DI最小销售产品标识")
private String nameCode;
@ExcelProperty("商品条码")
private String sptm;
@ExcelProperty("医保编码")
private String ybbm;
@ExcelProperty("产品名称")
private String spmc;
@ExcelProperty("规格型号")
private String spec;
@ExcelProperty("计量单位")
private String measname;
@ExcelProperty("生产企业")
private String manufactory;
@ExcelProperty("商品名称")
private String spmc;
@ExcelProperty("产品描述")
private String cpms;
@ExcelProperty("注册证号")
private String zczbhhzbapzbh;
@ExcelProperty("医保编码")
private String ybbm;
@ExcelProperty("产品价格")
private String price;
@ExcelProperty("是否集采(是/否)")
private String groupBuy;
@ExcelProperty("采购类型(普通入账/预验收/寄售)")
@ExcelProperty("采购类型(入账/寄售/预验收)")
private String purType;
@ExcelProperty("产品属性(设备/耗材/服务费)")
@ExcelProperty("产品属性(统一写耗材)")
private String attributeType;
@ExcelProperty("耗材类型(高值/低值)")
private String hcType;
@ExcelProperty("收费码")
private String basicPrductRemak1;
@ExcelProperty("供应商")
private String supName;
// @ExcelProperty("DI最小销售产品标识")
// private String nameCode;
// @ExcelProperty("商品条码")
// private String sptm;
//
//
//
// @ExcelProperty("产品描述")
// private String cpms;
//
// @ExcelProperty("是否集采(是/否)")
// private String groupBuy;
//
//
// @ExcelProperty("耗材类型(高值/低值)")
// private String hcType;
// @ExcelProperty("收费码")
// private String basicPrductRemak1;
}

@ -97,4 +97,7 @@ public class AddThrDiProductsRequest {
private String thirdSysFk;
private String code;
private Integer sourceType;
}

@ -49,6 +49,9 @@ public class FilterThrProductsRequest extends ListPageRequest {
private String uuid;
private Integer diType;
private Integer sourceType;
private String internalMaterialCode;
}

@ -184,4 +184,11 @@ public class BasicBussinessTypeResponse {
*/
private Integer vailHcType;
/**
* 0:1:2:
*/
@TableField(value = "codeCheck")
private Integer codeCheck;
}

@ -1,7 +1,9 @@
package com.glxp.api.res.thrsys;
import com.baomidou.mybatisplus.annotation.TableField;
import com.glxp.api.entity.thrsys.ThrProductsAddDiEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -52,4 +54,11 @@ public class ThrProductsAddDiResponse extends ThrProductsAddDiEntity {
private String matrial;
private String deviceRecordKey;
/**
*
*/
@TableField(value = "internalMaterialCode")
@ApiModelProperty(value = "'内部物资编码'")
private String internalMaterialCode;
}

@ -22,6 +22,8 @@ import com.glxp.api.res.thrsys.ThrProductsAddDiResponse;
import com.glxp.api.res.thrsys.UdiInfoResponse;
import com.glxp.api.service.basic.ProductInfoService;
import com.glxp.api.service.thrsys.ThrHslbService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.Excel.ExcelHandler;
import com.glxp.api.util.Excel.Exception.RenException;
import lombok.extern.slf4j.Slf4j;
@ -159,6 +161,8 @@ public class ThrProductsAddDiService extends ServiceImpl<ThrProductsAddDiDao, Th
thrProductsAddDiEntity.setCatalogCode2(catalogcode2);
thrProductsAddDiEntity.setCatalogCode3(catalogcode3);
}
String internalMaterialCode = this.getInternalMaterialCode("10","66");
thrProductsAddDiEntity.setInternalMaterialCode(internalMaterialCode);
list.add(thrProductsAddDiEntity);
}
return thrProductsAddDiDao.insertThrDiProducts(list);
@ -226,76 +230,174 @@ public class ThrProductsAddDiService extends ServiceImpl<ThrProductsAddDiDao, Th
@Resource
ExcelHandler excelHandler;
//
// public void excelImport(MultipartFile multipartFile, Long customerId) {
// try {
// List<AddThrDiProductsExcelVo> voList = excelHandler.importExcel(multipartFile, AddThrDiProductsExcelVo.class, null);
// if (CollectionUtils.isNotEmpty(voList)) {
// log.info("本次成功入:" + voList.size() + "条,数据如下---------------");
// voList.forEach(excelVo -> {
// ProductInfoEntity productInfoEntity = productInfoService.findByNameCode(excelVo.getNameCode());
// AddThrDiProductsRequest addThrDiProductsRequest = new AddThrDiProductsRequest();
// if (productInfoEntity != null) {
// addThrDiProductsRequest.setUuids(List.of(productInfoEntity.getUuid()));
// } else {
// addThrDiProductsRequest.setUuids(List.of("null"));
// }
// //todo
// addThrDiProductsRequest.setSptm(excelVo.getSptm());
// addThrDiProductsRequest.setManufactory(excelVo.getManufactory());
// addThrDiProductsRequest.setCpms(excelVo.getCpms());
// addThrDiProductsRequest.setMeasname(excelVo.getMeasname());
// addThrDiProductsRequest.setPrice(excelVo.getPrice());
// addThrDiProductsRequest.setBasicPrductRemak1(excelVo.getBasicPrductRemak1());
// addThrDiProductsRequest.setSpmc(excelVo.getSpmc());
// addThrDiProductsRequest.setYbbm(excelVo.getYbbm());
// addThrDiProductsRequest.setCustomerId(customerId);
// if (StrUtil.isNotEmpty(excelVo.getAttributeType())) {
// if (excelVo.getAttributeType().equals("设备")) {
// addThrDiProductsRequest.setAttributeType(1);
// } else if (excelVo.getAttributeType().equals("耗材")) {
// addThrDiProductsRequest.setAttributeType(2);
// } else if (excelVo.getAttributeType().equals("服务费")) {
// addThrDiProductsRequest.setAttributeType(3);
// }
// }
//
// if (StrUtil.isNotEmpty(excelVo.getGroupBuy())) {
// if (excelVo.getGroupBuy().equals("是")) {
// addThrDiProductsRequest.setGroupBuy(true);
// } else
// addThrDiProductsRequest.setGroupBuy(false);
// }
// if (StrUtil.isNotEmpty(excelVo.getHcType())) {
// if (excelVo.getHcType().equals("高值")) {
// addThrDiProductsRequest.setHcType(1);
// } else if (excelVo.getHcType().equals("低值")) {
// addThrDiProductsRequest.setHcType(2);
// }
// }
//
// if (StrUtil.isNotEmpty(excelVo.getPurType())) {
// if (excelVo.getPurType().equals("普通入账")) {
// addThrDiProductsRequest.setPurType(1);
// }
// if (excelVo.getPurType().equals("预验收")) {
// addThrDiProductsRequest.setPurType(2);
// } else
// addThrDiProductsRequest.setPurType(3);
// }
// addThrAddDiProducts(addThrDiProductsRequest);
//
// //1.校验国家库信息
//// addThrDiProductsRequest.setAttributeType();
//
//
// });
//
// }
// } catch (Exception e) {
// throw new RenException("导入失败");
// }
// }
@Resource
ThrProductsAddDiService thrProductsAddDiService;
@Transactional(rollbackFor = Exception.class)
public void excelImport(MultipartFile multipartFile, Long customerId) {
try {
List<AddThrDiProductsExcelVo> voList = excelHandler.importExcel(multipartFile, AddThrDiProductsExcelVo.class, null);
if (CollectionUtils.isNotEmpty(voList)) {
log.info("本次成功入:" + voList.size() + "条,数据如下---------------");
voList.forEach(excelVo -> {
ProductInfoEntity productInfoEntity = productInfoService.findByNameCode(excelVo.getNameCode());
AddThrDiProductsRequest addThrDiProductsRequest = new AddThrDiProductsRequest();
if (productInfoEntity != null) {
addThrDiProductsRequest.setUuids(List.of(productInfoEntity.getUuid()));
} else {
addThrDiProductsRequest.setUuids(List.of("null"));
ThrProductsAddDiEntity thrProductsAdddiEntity = new ThrProductsAddDiEntity();
String internalMaterialCode = thrProductsAddDiService.getInternalMaterialCode("10","66");
thrProductsAdddiEntity.setInternalMaterialCode(internalMaterialCode);
thrProductsAdddiEntity.setCode(internalMaterialCode);
thrProductsAdddiEntity.setThirdSysFk("thirdId");
thrProductsAdddiEntity.setUuid(CustomUtil.getUUId());
thrProductsAdddiEntity.setCreateTime(new Date());
thrProductsAdddiEntity.setStatus(1); //未审核
thrProductsAdddiEntity.setType(2);
thrProductsAdddiEntity.setCustomerId(customerId);
thrProductsAdddiEntity.setSpec(excelVo.getSpec());
thrProductsAdddiEntity.setSpmc(excelVo.getSpmc());
thrProductsAdddiEntity.setName(excelVo.getSpmc());
thrProductsAdddiEntity.setMeasname(excelVo.getMeasname());
thrProductsAdddiEntity.setManufactory(excelVo.getManufactory());
thrProductsAdddiEntity.setZczbhhzbapzbh(excelVo.getZczbhhzbapzbh());
thrProductsAdddiEntity.setPrice(excelVo.getPrice());
thrProductsAdddiEntity.setSupName(excelVo.getSupName());
thrProductsAdddiEntity.setSourceType(1);
//医保编码解析
String catalogcode = excelVo.getYbbm();
thrProductsAdddiEntity.setYbbm(excelVo.getYbbm());
if (StrUtil.isNotEmpty(catalogcode) && catalogcode.length() >= 7) {
Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3));
Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5));
Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7));
thrProductsAdddiEntity.setCatalogCode1(catalogcode1);
thrProductsAdddiEntity.setCatalogCode2(catalogcode2);
thrProductsAdddiEntity.setCatalogCode3(catalogcode3);
}
//todo
addThrDiProductsRequest.setSptm(excelVo.getSptm());
addThrDiProductsRequest.setManufactory(excelVo.getManufactory());
addThrDiProductsRequest.setCpms(excelVo.getCpms());
addThrDiProductsRequest.setMeasname(excelVo.getMeasname());
addThrDiProductsRequest.setPrice(excelVo.getPrice());
addThrDiProductsRequest.setBasicPrductRemak1(excelVo.getBasicPrductRemak1());
addThrDiProductsRequest.setSpmc(excelVo.getSpmc());
addThrDiProductsRequest.setYbbm(excelVo.getYbbm());
addThrDiProductsRequest.setCustomerId(customerId);
if (StrUtil.isNotEmpty(excelVo.getAttributeType())) {
if (excelVo.getAttributeType().equals("设备")) {
addThrDiProductsRequest.setAttributeType(1);
thrProductsAdddiEntity.setAttributeType(1);
} else if (excelVo.getAttributeType().equals("耗材")) {
addThrDiProductsRequest.setAttributeType(2);
thrProductsAdddiEntity.setAttributeType(2);
} else if (excelVo.getAttributeType().equals("服务费")) {
addThrDiProductsRequest.setAttributeType(3);
thrProductsAdddiEntity.setAttributeType(3);
}
}
if (StrUtil.isNotEmpty(excelVo.getGroupBuy())) {
if (excelVo.getGroupBuy().equals("是")) {
addThrDiProductsRequest.setGroupBuy(true);
} else
addThrDiProductsRequest.setGroupBuy(false);
}
if (StrUtil.isNotEmpty(excelVo.getHcType())) {
if (excelVo.getHcType().equals("高值")) {
addThrDiProductsRequest.setHcType(1);
} else if (excelVo.getHcType().equals("低值")) {
addThrDiProductsRequest.setHcType(2);
}
}
if (StrUtil.isNotEmpty(excelVo.getPurType())) {
if (excelVo.getPurType().equals("普通入账")) {
addThrDiProductsRequest.setPurType(1);
if (excelVo.getPurType().equals("入账")) {
thrProductsAdddiEntity.setPurType(1);
}
if (excelVo.getPurType().equals("预验收")) {
addThrDiProductsRequest.setPurType(2);
thrProductsAdddiEntity.setPurType(2);
} else
addThrDiProductsRequest.setPurType(3);
thrProductsAdddiEntity.setPurType(3);
}
addThrAddDiProducts(addThrDiProductsRequest);
//1.校验国家库信息
// addThrDiProductsRequest.setAttributeType();
thrProductsAddDiService.insertThrProducts(thrProductsAdddiEntity);
});
}
} catch (Exception e) {
System.out.println(e);
throw new RenException("导入失败");
}
}
public String getInternalMaterialCode(String index1,String index2) {
String prefix = index1+index2;
String addDiCode = thrProductsAddDiDao.getInternalMaterialCode(prefix);
if (StrUtil.isEmpty(addDiCode) ){
int incrementedNumber = 1;
return prefix+String.format("%09d", incrementedNumber);
}else{
// 去除前缀并转换为数字加1
int incrementedNumber = incrementNumberAfterPrefix(addDiCode, prefix);
return prefix+String.format("%09d", incrementedNumber);
}
}
public static int incrementNumberAfterPrefix(String originalString, String prefix) {
// 检查字符串是否以指定前缀开始
if (originalString != null && originalString.startsWith(prefix)) {
// 去除前缀
String numberString = originalString.substring(prefix.length());
// 尝试将剩余部分转换为整数并加1
try {
int number = Integer.parseInt(numberString);
return number + 1;
} catch (NumberFormatException e) {
// 如果剩余部分不是有效的数字,则抛出异常或进行其他处理
throw new IllegalArgumentException("Remaining string is not a valid number: " + numberString);
}
} else {
// 如果字符串不以指定前缀开始,则抛出异常或进行其他处理
throw new IllegalArgumentException("String does not start with the specified prefix: " + prefix);
}
}
}

@ -482,6 +482,9 @@
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="mainIdLike != '' and mainIdLike != null">
AND mainId LIKE concat('%', #{mainIdLike}, '%')
</if>
<if test="relCode != '' and relCode != null">
AND relCode = #{relCode}
</if>

@ -133,6 +133,9 @@
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%')
</if>
<if test="mainId != '' and mainId != null">
AND basic_udirel.mainId LIKE concat('%',#{mainId}, '%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc}, '%')
</if>

@ -188,6 +188,9 @@
<if test="checkStatus != null">
AND tdi.status = #{checkStatus}
</if>
<if test="sourceType != null">
AND tdi.sourceType = #{sourceType}
</if>
<if test="id != null">
AND tdi.id = #{id}
</if>
@ -203,6 +206,9 @@
<if test="name != '' and name != null">
AND tdi.name like concat('%', #{name}, '%')
</if>
<if test="internalMaterialCode != '' and internalMaterialCode != null">
AND tdi.internalMaterialCode like concat('%', #{internalMaterialCode}, '%')
</if>
<if test="spec != '' and spec != null">
AND tdi.spec = #{spec}
</if>
@ -262,4 +268,10 @@
<!-- </if>-->
</where>
</select>
<select id="getInternalMaterialCode" resultType="string">
SELECT MAX(internalMaterialCode)
FROM thr_products_add_di
WHERE internalMaterialCode LIKE concat(#{prefix},'%');
</select>
</mapper>

@ -627,3 +627,54 @@ CALL Pro_Temp_ColumnWork('device_repair', 'repairBillNo',
CALL Pro_Temp_ColumnWork('device_upkeep', 'taskBillNo',
'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''保养任务单号''',
1);
UPDATE auth_menu SET `menu_name` = '选入入院产品', `parent_id` = 1819, `order_num` = 3, `path` = 'supplier/products/supProductsOptinDi',
`component` = 'supplier/products/supProductsOptinDi', `query_param` = NULL, `is_frame` = 1, `is_cache` = 0, `menu_type` = 'C',
`visible` = '0', `status` = '0', `perms` = NULL, `icon` = NULL, `create_by` = '超级用户', `create_time` = '2023-02-17 10:04:07',
`update_by` = NULL, `update_time` = NULL, `remark` = NULL WHERE `menu_id` = 1759;
INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`,
`status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES
(2013, '新增入院产品', 1819, 3, 'supplier/products/supProductsAddDi', 'supplier/products/supProductsAddDi',
NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-17 10:04:07', NULL, NULL, NULL);
UPDATE sys_custom_config SET `businessType` = 'supProductsAddDi', `remark` = '新增入院产品', `type` = '1', `handleChangeFuc` = NULL WHERE `id` = 22;
INSERT ignore INTO sys_custom_config(`id`, `businessType`, `remark`, `type`, `handleChangeFuc`) VALUES (84, 'supProductsOptinDi', '选入入院产品', '1', NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2105, 84, '2', 1, 'code', 'DI产品标识', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2106, 84, '2', 1, 'name', '物资名称', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2107, 84, '2', 1, 'spec', '规格型号', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2108, 84, '2', 1, 'registerNo', '注册证编号', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2109, 84, '2', 1, 'checkStatus', '审核状态', 'select', NULL, NULL, '{\"1\":\"未审核\",\"2\":\"已审核\",\"3\":\"未通过\",\"\":\"全部\"}', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2110, 84, '1', 1, 'index', '序号', 'id', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2111, 84, '1', 1, 'code', '物资产品标识', 'text', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2112, 84, '1', 1, 'name', '物资名称', 'text', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2113, 84, '1', 1, 'spec', '规格型号', 'text', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2114, 84, '1', 1, 'ylqxzcrbarmc', '医疗器械注册人', 'text', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2115, 84, '1', 1, 'registerNo', '注册证编号', 'text', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2116, 84, '1', 1, 'status', '审核状态', 'laber', '', NULL, '{\"1\":\"未审核\",\"2\":\"已审核\",\"3\":\"未通过\"}', NULL, 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2117, 84, '1', 1, 'oper', '操作', 'button', '', NULL, '', 120, NULL, '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"详情\",\"clickFuc\":\"detail\",\"disabledFuc\":\"\",\"hasPermi\":\"\"},{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"删除\",\"clickFuc\":\"deleteProduct\",\"disabledFuc\":\"row.status == 2\",\"hasPermi\":\"\"}]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CALL Pro_Temp_ColumnWork('thr_products_add_di', 'sourceType',
'bit(1) NOT NULL DEFAULT b''0'' COMMENT ''来源类型 1新增0选入''',
1);
CALL Pro_Temp_ColumnWork('thr_products_add_di', 'internalMaterialCode',
'varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''内部物资编码''',
1);
UPDATE sys_custom_config_detail SET `configId` = 22, `type` = '1', `isShow` = 1, `columnName` = 'internalMaterialCode', `columnDesc` = '内部物资编码', `columnType` = 'text', `colorRule` = NULL, `sort` = NULL, `lableRule` = NULL, `width` = NULL, `tooltip` = 1, `buttonRule` = NULL, `number` = NULL, `lineNumber` = NULL, `clickFuc` = NULL, `size` = NULL, `style` = NULL, `disabled` = NULL, `checkRules` = NULL, `inputType` = NULL, `disabledFuc` = NULL, `expression` = NULL, `dataFuc` = NULL, `isShowXx` = NULL WHERE `id` = 275;
INSERT ignore INTO sys_custom_config_detail (`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2118, 32, '1', 1, 'internalMaterialCode', '内部物资编码', 'text', NULL, NULL, NULL, NULL, 1, NULL, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_param_config (`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`, `paramExplain`, `updateTime`) VALUES (1070, 0, '开启内部物资编码', 'internal_material_code', '1', 1, 0, '开启内部物资编码 01', NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2019, 18, '2', 1, 'mainId', '内部物资编码', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2020, 22, '2', 1, 'internalMaterialCode', '内部物资编码', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT ignore INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`, `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`, `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`, `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`, `dataFuc`, `isShowXx`) VALUES (2021, 8, '2', 1, 'mainIdLike', '内部物资编码', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'codeCheck',
'tinyint NULL DEFAULT NULL COMMENT '' 是否开启校验扫码 0:不校验1:只允许录入扫码产品2:只允许录入不扫码产品''', 1);

Loading…
Cancel
Save