diff --git a/src/main/java/com/glxp/api/service/basic/BasicGenJsonService.java b/src/main/java/com/glxp/api/controller/basic/BasicGenJsonService.java similarity index 95% rename from src/main/java/com/glxp/api/service/basic/BasicGenJsonService.java rename to src/main/java/com/glxp/api/controller/basic/BasicGenJsonService.java index 02486b2..62966cc 100644 --- a/src/main/java/com/glxp/api/service/basic/BasicGenJsonService.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicGenJsonService.java @@ -1,4 +1,4 @@ -package com.glxp.api.service.basic; +package com.glxp.api.controller.basic; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; @@ -14,6 +14,7 @@ import com.glxp.api.req.basic.FilterUdiRelRequest; import com.glxp.api.req.basic.UdiInfoExportRequest; import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse; import com.glxp.api.res.basic.UdiRelevanceResponse; +import com.glxp.api.service.basic.UdiRelevanceService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; @@ -21,6 +22,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.File; + import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; @@ -86,7 +88,7 @@ public class BasicGenJsonService { if (field.getName().contains("thirdId")) { Object fieldValue = ReflectUtil.getFieldValue(udiRelevanceEntity, field); if (null != fieldValue) { - FilterThrProductsRequest filter = new FilterThrProductsRequest(); + com.glxp.api.req.thrsys.FilterThrProductsRequest filter = new com.glxp.api.req.thrsys.FilterThrProductsRequest(); filter.setCode(String.valueOf(fieldValue)); filter.setThirdSysFk("thirdId"); List result = thrProductsDao.filterThrProducts(filter); diff --git a/src/main/java/com/glxp/api/controller/basic/BasicProductsExportLogController.java b/src/main/java/com/glxp/api/controller/basic/BasicProductsExportLogController.java index 3918f32..dafeb18 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicProductsExportLogController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicProductsExportLogController.java @@ -1,37 +1,22 @@ package com.glxp.api.controller.basic; -import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.Log; -import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BasicProcessStatus; import com.glxp.api.constant.BusinessType; import com.glxp.api.entity.basic.BasicProductsExportLogEntity; -import com.glxp.api.req.basic.FilterUdiEpLogRequest; -import com.glxp.api.req.basic.FilterUdiRelRequest; import com.glxp.api.req.basic.UdiInfoExportRequest; import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse; -import com.glxp.api.service.basic.BasicGenJsonService; import com.glxp.api.service.basic.BasicProductsExportLogService; -import com.glxp.api.service.basic.UdiRelevanceService; import com.glxp.api.util.CustomUtil; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.FileInputStream; -import java.io.OutputStream; import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; /** * 医疗器械信息导出 diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java new file mode 100644 index 0000000..15c3b5c --- /dev/null +++ b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java @@ -0,0 +1,55 @@ +package com.glxp.api.controller.basic; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.annotation.Log; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.BusinessType; +import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.basic.*; + +import com.glxp.api.service.basic.UdiRlSupService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 供应商关联耗材字典信息 + */ +@RestController +public class UdiRlSupController extends BaseController { + @Resource + private UdiRlSupService udiRlSupService; + + + + @AuthRuleAnnotation("") + @PostMapping("/sale/info/insertCompanyProductRelevance") + @Log(title = "单据管理", businessType = BusinessType.INSERT) + public BaseResponse insertCompanyProductRelevance(@RequestBody UdiRlSupEntity udiRlSupEntity) { + if (udiRlSupService.findCompanyProductRelevanceByProductUuid(udiRlSupEntity) != null) { + return ResultVOUtils.error(ResultEnum.DATA_REPEAT); + } + udiRlSupEntity.setUnitFk(null); + udiRlSupEntity.setCreateTime(new Date()); + udiRlSupEntity.setUpdateTime(new Date()); + udiRlSupEntity.setAuditStatus("3"); + boolean b = udiRlSupService.insertCompanyProductRelevance(udiRlSupEntity); + return ResultVOUtils.success("成功"); + } + +} diff --git a/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java b/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java new file mode 100644 index 0000000..c5b00e7 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/basic/UdiRlSupDao.java @@ -0,0 +1,19 @@ +package com.glxp.api.dao.basic; + +import com.glxp.api.dao.BaseMapperPlus; +import com.glxp.api.entity.basic.UdiRlSupEntity; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface UdiRlSupDao extends BaseMapperPlus { + + + UdiRlSupEntity findCompanyProductRelevanceByProductUuid(UdiRlSupEntity udiRlSupEntity); + + + boolean insertCompanyProductRelevance(UdiRlSupEntity companyCertEntity); +} diff --git a/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java b/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java new file mode 100644 index 0000000..d9ea0c6 --- /dev/null +++ b/src/main/java/com/glxp/api/service/basic/UdiRlSupService.java @@ -0,0 +1,22 @@ +package com.glxp.api.service.basic; + + +import com.glxp.api.entity.basic.UdiRlSupEntity; +import com.glxp.api.req.basic.CompanyProductRelevanceRequest; +import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest; +import com.glxp.api.res.basic.UdiRlSupResponse; + +import java.util.List; + +public interface UdiRlSupService { + + + + UdiRlSupEntity findCompanyProductRelevanceByProductUuid(UdiRlSupEntity udiRlSupEntity); + + + + boolean insertCompanyProductRelevance(UdiRlSupEntity companyCertEntity); + + +} diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java new file mode 100644 index 0000000..576d340 --- /dev/null +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiRlSupServiceImpl.java @@ -0,0 +1,37 @@ +package com.glxp.api.service.basic.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.glxp.api.dao.basic.UdiRlSupDao; +import com.glxp.api.entity.basic.UdiRlSupEntity; +import com.glxp.api.req.basic.CompanyProductRelevanceRequest; +import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest; +import com.glxp.api.res.basic.UdiRlSupResponse; +import com.glxp.api.service.basic.UdiRlSupService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +@Transactional(rollbackFor = Exception.class) +public class UdiRlSupServiceImpl implements UdiRlSupService { + + @Resource + UdiRlSupDao udiRlSupDao; + + + @Override + public UdiRlSupEntity findCompanyProductRelevanceByProductUuid(UdiRlSupEntity udiRlSupEntity) { + return udiRlSupDao.findCompanyProductRelevanceByProductUuid(udiRlSupEntity); + } + + + @Override + public boolean insertCompanyProductRelevance(UdiRlSupEntity udiRlSupEntity) { + return udiRlSupDao.insertCompanyProductRelevance(udiRlSupEntity); + } + +} diff --git a/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml new file mode 100644 index 0000000..42e5ce2 --- /dev/null +++ b/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + replace + INTO company_product_relevance(customerId, productId, enterpriseId, registrationId, + createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk, + price, createUser, updateUser) + values (#{customerId}, + #{productId}, + #{enterpriseId}, + #{registrationId}, + #{createTime}, + #{updateTime}, + #{auditStatus}, + #{productUuid}, + #{udiRlIdFk}, + #{unitFk}, + #{price}, + #{createUser}, + #{updateUser}) + + + +