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

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

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

Loading…
Cancel
Save