耗材字典新增,修改完善

master
anthonywj 2 years ago
parent 9d0876b452
commit 0a025cf733

@ -283,6 +283,8 @@ public class UdiRelevanceController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
//更新关联表
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
BeanUtils.copyProperties(udiRelevanceSaveRequest, udiRelevanceEntity);
udiRelevanceEntity.setId(udiRelevanceSaveRequest.getId());
@ -290,8 +292,9 @@ public class UdiRelevanceController {
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceEntity.setUpdateUser(customerService.getUserId() + "");
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
//关联更新
UdiProductEntity udiProductEntity = new UdiProductEntity();
udiProductEntity.setSptm(udiRelevanceSaveRequest.getSptm());
udiProductEntity.setYbbm(udiRelevanceSaveRequest.getYbbm());
udiProductEntity.setMeasname(udiRelevanceSaveRequest.getMeasname());
udiProductEntity.setManufactory(udiRelevanceSaveRequest.getManufactory());
@ -313,13 +316,37 @@ public class UdiRelevanceController {
udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI);
}
udiProductEntity.setUuid(udiRelevanceSaveRequest.getUuid());
udiProductService.updateUdiInfoByUuid(udiProductEntity);
//关联修改提交
if (udiRelevanceSaveRequest.getRelSubmit() != null && udiRelevanceSaveRequest.getRelSubmit()) {
udiProductService.updateUdiInfoByUuid(udiProductEntity);
} else {
udiProductService.updateUdiInfo(udiProductEntity);
return ResultVOUtils.success("更新成功");
}
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/update/di")
public BaseResponse updateSingel(@RequestBody UdiRelevanceSaveRequest udiRelevanceSaveRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
//更新关联表
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setId(udiRelevanceSaveRequest.getId());
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceEntity.setUpdateUser(customerService.getUserId() + "");
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
//单独更新DI
UdiProductEntity diEntity = new UdiProductEntity();
// diEntity.setMeasname(udiRelevanceSaveRequest.getMeasname());
diEntity.setPackUnit(udiRelevanceSaveRequest.getPackUnit());
diEntity.setSptm(udiRelevanceSaveRequest.getSptm());
diEntity.setUuid(udiRelevanceSaveRequest.getUuid());
diEntity.setNameCode(udiRelevanceSaveRequest.getNameCode());
udiProductService.updateUdiInfo(diEntity);
return ResultVOUtils.success("更新成功");
}

@ -51,13 +51,13 @@ public class NmpaUdiClient {
public List<UdiProductEntity> getOrUpdateByUuid(String uuid) {
List<UdiProductEntity> udiInfoEntities = getUdiByUuid(uuid);
if (CollUtil.isNotEmpty(udiInfoEntities)) {
UdiProductEntity udiProductEntity = udiProductService.findByNameCode(udiInfoEntities.get(0).getNameCode());
if (udiProductEntity != null) {
List<UdiProductEntity> exitUdis = udiProductService.findByUuids(udiProductEntity.getUuid());
return exitUdis;
}
}
// if (CollUtil.isNotEmpty(udiInfoEntities)) {
// UdiProductEntity udiProductEntity = udiProductService.findByNameCode(udiInfoEntities.get(0).getNameCode());
// if (udiProductEntity != null) {
// List<UdiProductEntity> exitUdis = udiProductService.findByUuids(udiProductEntity.getUuid());
// return exitUdis;
// }
// }
return udiInfoEntities;
}

@ -140,7 +140,6 @@ public class UdiContrastService {
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setThirdId(udiCombineRequest.getThirdId());
udiRelevanceEntity.setMainId(udiCombineRequest.getThirdId());
String time = DateUtil.getDateTime();
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid());

@ -315,7 +315,7 @@
<if test="basicPrductRemak7 != null">basicPrductRemak7=#{basicPrductRemak7},</if>
<if test="basicPrductRemak8 != null">basicPrductRemak8=#{basicPrductRemak8},</if>
</trim>
WHERE nameCode = #{nameCode}
WHERE nameCode = #{nameCode} and uuid = #{uuid}
</update>
<update id="updateUdiInfoByUuid" parameterType="com.glxp.api.entity.basic.UdiProductEntity">

Loading…
Cancel
Save