代码更新完善

cert
1178634255 2 years ago
parent bd3a94ba44
commit 7794dc5ac8

@ -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.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; 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.req.basic.UdiInfoExportRequest;
import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse; import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.basic.UdiRelevanceService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
@ -21,6 +22,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -86,7 +88,7 @@ public class BasicGenJsonService {
if (field.getName().contains("thirdId")) { if (field.getName().contains("thirdId")) {
Object fieldValue = ReflectUtil.getFieldValue(udiRelevanceEntity, field); Object fieldValue = ReflectUtil.getFieldValue(udiRelevanceEntity, field);
if (null != fieldValue) { 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.setCode(String.valueOf(fieldValue));
filter.setThirdSysFk("thirdId"); filter.setThirdSysFk("thirdId");
List<ThrProductsEntity> result = thrProductsDao.filterThrProducts(filter); List<ThrProductsEntity> result = thrProductsDao.filterThrProducts(filter);

@ -1,37 +1,22 @@
package com.glxp.api.controller.basic; package com.glxp.api.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log; 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.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicProcessStatus; import com.glxp.api.constant.BasicProcessStatus;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.basic.BasicProductsExportLogEntity; 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.req.basic.UdiInfoExportRequest;
import com.glxp.api.res.basic.UdiRelevanceExportJsonResponse; 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.BasicProductsExportLogService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
import lombok.extern.slf4j.Slf4j; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; 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.Date;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* *

@ -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…
Cancel
Save