Merge branch 'master' of codeup.aliyun.com:64d9c5feeceb191898f636d7/honor-dd-light-ds-java

master
ljl 12 months ago
commit 4ee3bb3b5f

@ -5,6 +5,7 @@ import com.ms.dal.entity.DdCategoryToSourceRelation;
import com.ms.api.service.DdCategoryToSourceRelationIdService;
import com.ms.dal.mapper.DdCategoryToSourceRelationIdMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -63,7 +64,7 @@ public class DdCategoryToSourceRelationIdServiceImpl implements DdCategoryToSour
}
@Override
public Integer getSingleDdCanUsedDsCid(Long shopId, String curCid) {
public Integer getSingleDdCanUsedDsCid(@Param("shopId") Long shopId, @Param("curCid") String curCid) {
String dsCid = ddCategoryToSourceRelationIdMapper.getSingleDdCanUsedDsCid(shopId, curCid);
if (dsCid == null) {
return 0;

@ -61,7 +61,7 @@ public class SearchChoicenessSourceItemService extends SPIBaseService implements
}
if(ddCanUsed != null && ddCanUsed > 0 && cid != null && cid > 0) {
cid = getSingleDdCanUsedDsCid(cid);
cid = getSingleDdCanUsedDsCid(String.valueOf(cid));
if (cid == 0) {
result.put("result", "success");
result.put("sourceItems", new ArrayList<>());
@ -140,7 +140,7 @@ public class SearchChoicenessSourceItemService extends SPIBaseService implements
condition.setPageSize(1);
condition.setShopId(shopId);
Pager<MoveCollectTaskDetail> moveCollectTaskPager = moveCollectTaskDetailService.getMoveCollectTaskList(condition);
if(moveCollectTaskPager == null){
if(moveCollectTaskPager == null || moveCollectTaskPager.getData().size() == 0){
return 0;
}
@ -148,8 +148,8 @@ public class SearchChoicenessSourceItemService extends SPIBaseService implements
return getDsCidByDdCid(ddCid);
}
private Integer getSingleDdCanUsedDsCid(Integer curCid) {
return ddCategoryToSourceRelationIdService.getSingleDdCanUsedDsCid(shopId, String.valueOf(curCid));
private Integer getSingleDdCanUsedDsCid(String curCid) {
return ddCategoryToSourceRelationIdService.getSingleDdCanUsedDsCid(shopId, curCid);
}
private Integer getDsCidByDdCid(Long ddCid) {

@ -158,10 +158,12 @@
<select id="getSingleDdCanUsedDsCid" resultType="java.lang.String">
select m.source_category_id from dd_category_to_source_relation m
left join category_shop c on m.dd_category_id = c.category_id
where c.shop_id = #{shopId}
<if test="curCid != null">
and source_category_id = #{curCid,jdbcType=VARCHAR}
</if>
<where>
c.shop_id = #{shopId}
<if test="curCid != null">
and source_category_id = #{curCid}
</if>
</where>
limit 1
</select>
<insert id="batchInsert" keyColumn="dd_category_to_source_relation_id" keyProperty="ddCategoryToSourceRelationId" >

Loading…
Cancel
Save