修改bug

master
wangwei 2 years ago
parent 2db5497a93
commit 8216e6fcbd

@ -183,6 +183,14 @@ public class UdiRlSupController {
if (StrUtil.isEmpty(udiInfoExportRequest.getUnitFk())) {
return ResultVOUtils.error(500, "未选择供应商!");
}
//先判断产品是否存在
CompanyProductRelevanceRequest filterUdiInfoRequest = new CompanyProductRelevanceRequest();
filterUdiInfoRequest.setNameCode(udiInfoExportRequest.getNameCode());
List<UdiRlSupResponse> udiRlSupResponses = udiRlSupService.filterUdiGp(filterUdiInfoRequest);
if(udiRlSupResponses.size()!=0){
return ResultVOUtils.error(999,"产品已存在,请勿重复导入!");
}
companyProductsRelService.insertCompanyProducts(udiInfoExportRequest);
return ResultVOUtils.success("后台正在导入,请稍后刷新查看!");
}

@ -173,7 +173,7 @@ public class ThrProductsController {
if (null == thrProductsEntity)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
BeanUtils.copyProperties(thrProductsEntity,filterThrProductsRequest);
List<ThrProductsEntity> thrProductsEntities = thrProductsService.filterThrProducts(filterThrProductsRequest);
List<ThrProductsEntity> thrProductsEntities = thrProductsService.filterThrProducts1(filterThrProductsRequest);
if(thrProductsEntities.size()==0){
thrProductsEntity.setUpdateUser(String.valueOf(customerService.getUserId()));
thrProductsEntity.setCreateUser(String.valueOf(customerService.getUserId()));

@ -21,6 +21,7 @@ public interface ThrProductsDao {
List<ThrProductsEntity> filterThrProducts(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsEntity> filterThrProducts1(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsResponse> filterJoinThrProducts(FilterThrProductsRequest filterThrProductsRequest);

@ -22,6 +22,8 @@ public interface ThrProductsService {
List<ThrProductsEntity> filterThrProducts(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsEntity> filterThrProducts1(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsResponse> filterJoinThrProducts(FilterThrProductsRequest filterThrProductsRequest);
ThrProductsEntity selectById(String id);

@ -56,6 +56,18 @@ public class ThrProductsServiceImpl implements ThrProductsService {
return data;
}
public List<ThrProductsEntity> filterThrProducts1(FilterThrProductsRequest filterThrProductsRequest) {
if (filterThrProductsRequest == null) {
return Collections.emptyList();
}
if (filterThrProductsRequest.getPage() != null) {
int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit();
PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit());
}
List<ThrProductsEntity> data = thrProductsDao.filterThrProducts1(filterThrProductsRequest);
return data;
}
@Override
public List<ThrProductsResponse> filterJoinThrProducts(FilterThrProductsRequest filterThrProductsRequest) {
if (filterThrProductsRequest == null) {

@ -46,6 +46,49 @@
</if>
</where>
</select>
<select id="filterThrProducts1" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
SELECT * FROM thr_products
<where>
<if test="name != '' and name != null">
AND name = #{name}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="sptm != '' and sptm != null">
AND sptm= #{sptm}
</if>
<if test="ybbm != '' and ybbm != null">
AND ybbm = #{ybbm}
</if>
<if test="registerNo != '' and registerNo != null">
AND registerNo= #{registerNo}
</if>
<if test="manufactory != '' and manufactory != null">
AND manufactory= #{manufactory}
</if>
<if test="spec != '' and spec != null">
AND spec = #{spec}
</if>
<if test="unionCode != '' and unionCode != null">
or code LIKE = #{unionCode} or sptm = #{unionCode} or ybbm LIKE
= #{unionCode}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
<if test="thirdSys != '' and thirdSys != null">
AND thirdSys = #{thirdSys}
</if>
<if test="supName != '' and supName != null">
AND supName LIKE = #{supName}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
<select id="filterJoinThrProducts" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"

Loading…
Cancel
Save