Commit 4292a7fc by fudahua

绑定流程门店下判断

parent c5a8df19
......@@ -66,4 +66,6 @@ public interface TabHaobanStaffClerkRelationMapper {
int cleanStaffDepart( @Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
TabHaobanStaffClerkRelation getOneBindCodeNoStatus(@Param("enterpriseId")String enterpriseId, @Param("clerkCode")String clerkCode);
TabHaobanStaffClerkRelation getOneBindStoreId(@Param("staffId")String staffId, @Param("storeId")String storeId);
}
\ No newline at end of file
......@@ -49,4 +49,6 @@ public interface StaffClerkRelationService {
StaffClerkRelationDTO getOneBindCodeNoStatus(String enterpriseId, String clerkCode);
StaffClerkRelationDTO getOneBindByStoreId(String staffId, String storeId);
}
......@@ -95,4 +95,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public StaffClerkRelationDTO getOneBindCodeNoStatus(String enterpriseId, String clerkCode) {
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class,mapper.getOneBindCodeNoStatus(enterpriseId,clerkCode));
}
@Override
public StaffClerkRelationDTO getOneBindByStoreId(String staffId, String storeId) {
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class,mapper.getOneBindStoreId(staffId,storeId));
}
}
......@@ -110,6 +110,13 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
response.setMessage("已经被绑定,不能绑定");
return response;
}
StaffClerkRelationDTO storeHasBind = staffClerkRelatinService.getOneBindByStoreId(staffClerkRelationDTO.getStaffId(), staffClerkRelationDTO.getStoreId());
if (storeHasBind!=null) {
response.setCode(3);
response.setMessage("该导购已在该门店下有其它成员绑定");
return response;
}
staffClerkRelatinService.bind(staffClerkRelationDTO);
return response;
}
......
......@@ -284,4 +284,14 @@
and clerk_code = #{clerkCode}
order by update_time desc limit 1
</select>
<select id="getOneBindStoreId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where store_id = #{storeId,jdbcType=VARCHAR}
and staff_id = #{staffId}
and status_flag=1
order by update_time desc limit 1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment