代码更新完善
parent
bd3a94ba44
commit
7794dc5ac8
@ -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("成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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<UdiRlSupDao, UdiRlSupEntity, UdiRlSupEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
UdiRlSupEntity findCompanyProductRelevanceByProductUuid(UdiRlSupEntity udiRlSupEntity);
|
||||||
|
|
||||||
|
|
||||||
|
boolean insertCompanyProductRelevance(UdiRlSupEntity companyCertEntity);
|
||||||
|
}
|
@ -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);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
|
||||||
|
<mapper namespace="com.glxp.api.dao.basic.UdiRlSupDao">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findCompanyProductRelevanceByProductUuid"
|
||||||
|
parameterType="com.glxp.api.entity.basic.UdiRlSupEntity"
|
||||||
|
resultType="com.glxp.api.entity.basic.UdiRlSupEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM company_product_relevance
|
||||||
|
<where>
|
||||||
|
<if test="customerId != null and customerId != ''">
|
||||||
|
and customerId = #{customerId}
|
||||||
|
</if>
|
||||||
|
<if test="productId != null and productId != ''">
|
||||||
|
and productId = #{productId}
|
||||||
|
</if>
|
||||||
|
<if test="productUuid != null and productUuid != ''">
|
||||||
|
and productUuid = #{productUuid}
|
||||||
|
</if>
|
||||||
|
<if test="unitFk != null and unitFk != ''">
|
||||||
|
and unitFk = #{unitFk}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertCompanyProductRelevance"
|
||||||
|
parameterType="com.glxp.api.entity.basic.UdiRlSupEntity">
|
||||||
|
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})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue