第三方产品选入bug修改提交

master
郑明梁 2 years ago
parent 69d4b65562
commit a49566e015

@ -302,6 +302,7 @@ public class ThrProductsAddDiController {
if (null == thrProductsAdddiEntity) if (null == thrProductsAdddiEntity)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
if (thrProductsService.isExit(thrProductsAdddiEntity.getCode(), thrProductsAdddiEntity.getThirdSysFk())) { if (thrProductsService.isExit(thrProductsAdddiEntity.getCode(), thrProductsAdddiEntity.getThirdSysFk())) {
return ResultVOUtils.error(500, "已存在相同产品编码,无法添加!"); return ResultVOUtils.error(500, "已存在相同产品编码,无法添加!");
} }

@ -41,4 +41,6 @@ public interface ThrProductsAddDiDao {
boolean insert(ThrProductsAddDiEntity thrProductsAddDiEntity); boolean insert(ThrProductsAddDiEntity thrProductsAddDiEntity);
List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest);
} }

@ -34,4 +34,6 @@ public interface ThrProductsAddDiService {
ThrProductsAddDiEntity filterThrProductsGetId( Integer id); ThrProductsAddDiEntity filterThrProductsGetId( Integer id);
boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity); boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity);
List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest);
} }

@ -130,4 +130,9 @@ public class ThrProductsAddDiServiceImpl implements ThrProductsAddDiService {
public boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity) { public boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity) {
return thrProductsAddDiDao.insert(thrProductsAddDiEntity); return thrProductsAddDiDao.insert(thrProductsAddDiEntity);
} }
@Override
public List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest) {
return thrProductsAddDiDao.filterThrProductsDiList(filterThrProductsRequest);
}
} }

@ -7,7 +7,9 @@ import com.github.pagehelper.PageHelper;
import com.glxp.api.entity.thrsys.ThrProductsEntity; import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.dao.thrsys.ThrProductsDao; import com.glxp.api.dao.thrsys.ThrProductsDao;
import com.glxp.api.req.thrsys.FilterThrProductsRequest; import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.res.thrsys.ThrProductsAddDiResponse;
import com.glxp.api.res.thrsys.ThrProductsResponse; import com.glxp.api.res.thrsys.ThrProductsResponse;
import com.glxp.api.service.thrsys.ThrProductsAddDiService;
import com.glxp.api.service.thrsys.ThrProductsService; import com.glxp.api.service.thrsys.ThrProductsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -29,6 +31,8 @@ public class ThrProductsServiceImpl implements ThrProductsService {
@Resource @Resource
ThrProductsDao thrProductsDao; ThrProductsDao thrProductsDao;
@Resource
ThrProductsAddDiService thrProductsAddDiService;
@Override @Override
public ThrProductsEntity selectByCode(String code) { public ThrProductsEntity selectByCode(String code) {
@ -98,11 +102,13 @@ public class ThrProductsServiceImpl implements ThrProductsService {
@Override @Override
public Boolean isExit(String code, String thirdIdFk) { public Boolean isExit(String code, String thirdIdFk) {
//判断di表有没有该产品数据
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setThirdSysFk(thirdIdFk); filterThrProductsRequest.setThirdSysFk(thirdIdFk);
filterThrProductsRequest.setCode(code); filterThrProductsRequest.setCode(code);
List<ThrProductsAddDiResponse> filterThrProductsDiList=thrProductsAddDiService.filterThrProductsDiList(filterThrProductsRequest);
List<ThrProductsEntity> data = thrProductsDao.selectThrProducts(filterThrProductsRequest); List<ThrProductsEntity> data = thrProductsDao.selectThrProducts(filterThrProductsRequest);
if (CollUtil.isNotEmpty(data)) { if (CollUtil.isNotEmpty(data) || CollUtil.isNotEmpty(filterThrProductsDiList)) {
return true; return true;
} }
return false; return false;

@ -183,5 +183,19 @@
) )
</insert> </insert>
<select id="filterThrProductsDiList" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.res.thrsys.ThrProductsAddDiResponse">
SELECT tdi.*
FROM thr_products_add_di tdi
<where>
<if test="thirdSysFk != null">
AND tdi.thirdSysFk = #{thirdSysFk}
</if>
<if test="code != null">
AND tdi.code = #{code}
</if>
</where>
</select>
</mapper> </mapper>

Loading…
Cancel
Save